diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2016-05-09 00:34:53 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-05-09 00:34:53 -0700 |
| commit | 213e60d133e3b137d8d6d57748d0f653c5f05303 (patch) | |
| tree | b49bac70d14ff8335854b1b902848c9651af73f9 /src | |
| parent | a56f1aa5e1e25f0132c2db533413bd671156c312 (diff) | |
| parent | 4c8c153f5b4a82ca44297a47301c30ac1ad3d810 (diff) | |
| download | android_packages_apps_Gallery2-213e60d133e3b137d8d6d57748d0f653c5f05303.tar.gz android_packages_apps_Gallery2-213e60d133e3b137d8d6d57748d0f653c5f05303.tar.bz2 android_packages_apps_Gallery2-213e60d133e3b137d8d6d57748d0f653c5f05303.zip | |
Merge "Gallery2: modify some UI interface according to UI document." into android_ui.lnx.1.2-dev
Diffstat (limited to 'src')
5 files changed, 20 insertions, 12 deletions
diff --git a/src/com/android/gallery3d/app/AlbumPage.java b/src/com/android/gallery3d/app/AlbumPage.java index 4d2e291c1..3ceb7a09a 100644 --- a/src/com/android/gallery3d/app/AlbumPage.java +++ b/src/com/android/gallery3d/app/AlbumPage.java @@ -657,6 +657,7 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster menu.findItem(R.id.action_sync_picasa_albums).setVisible(mIsVideoScreen); MenuItem item = menu.findItem(R.id.action_view_type); updateMenuTitle(item); + updateMenuTitle(menu.findItem(R.id.action_select)); } //actionBar.setSubtitle(null); @@ -920,10 +921,13 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster } } - public void updateMenuTitle(MenuItem item) { - - item.setTitle(mViewType ? R.string.action_viewtype_list - : R.string.action_viewtype_grid); + public void updateMenuTitle(MenuItem item) { + if (item.getItemId() == R.id.action_view_type) { + item.setTitle(mViewType ? R.string.action_viewtype_list + : R.string.action_viewtype_grid); + } else if (item.getItemId() == R.id.action_select) { + item.setTitle(mIsVideoScreen ? R.string.select_video : R.string.select_item); + } } private void switchView() { diff --git a/src/com/android/gallery3d/app/GalleryActionBar.java b/src/com/android/gallery3d/app/GalleryActionBar.java index 71bb6381a..ebec5731b 100644 --- a/src/com/android/gallery3d/app/GalleryActionBar.java +++ b/src/com/android/gallery3d/app/GalleryActionBar.java @@ -451,10 +451,9 @@ public class GalleryActionBar { } } - public void setBackGroundTransparent() - { - mActionBar.setBackgroundDrawable(new ColorDrawable(Color.argb(66, 0, 0, 0))); - + public void setBackGroundTransparent() { + mActionBar.setBackgroundDrawable( + new ColorDrawable(mContext.getResources().getColor(R.color.photo_page_action_bar))); } public void setBackGroundDefault() diff --git a/src/com/android/gallery3d/ui/AbstractSlotRenderer.java b/src/com/android/gallery3d/ui/AbstractSlotRenderer.java index f5a08097d..0807814a3 100644 --- a/src/com/android/gallery3d/ui/AbstractSlotRenderer.java +++ b/src/com/android/gallery3d/ui/AbstractSlotRenderer.java @@ -131,7 +131,7 @@ public abstract class AbstractSlotRenderer implements SlotView.SlotRenderer { } protected void drawSelectedFrame(GLCanvas canvas, int width, int height) { - mSelectionIcon.draw(canvas,15,15); + mSelectionIcon.draw(canvas, 5, 5); //drawFrame(canvas, mFrameSelected.getPaddings(), mFrameSelected, 0, 0, width, height); } diff --git a/src/com/android/gallery3d/ui/PhotoView.java b/src/com/android/gallery3d/ui/PhotoView.java index 228229006..5c9992401 100644 --- a/src/com/android/gallery3d/ui/PhotoView.java +++ b/src/com/android/gallery3d/ui/PhotoView.java @@ -205,6 +205,7 @@ public class PhotoView extends GLView { private UndoBarView mUndoBar; private Texture mVideoPlayIcon; private Texture mDrmIcon; + private int mVideoPlayIconSize = 0; private SynchronizedHandler mHandler; @@ -308,6 +309,8 @@ public class PhotoView extends GLView { } }); mVideoPlayIcon = new ResourceTexture(mContext, R.drawable.play_detail); + mVideoPlayIconSize = mContext.getResources().getDimensionPixelSize( + R.dimen.photo_view_video_icon_size); mDrmIcon = new ResourceTexture(mContext, R.drawable.drm_image); for (int i = -SCREEN_NAIL_MAX; i <= SCREEN_NAIL_MAX; i++) { if (i == 0) { @@ -942,7 +945,7 @@ public class PhotoView extends GLView { // Draw the video play icon (in the place where the spinner was) private void drawVideoPlayIcon(GLCanvas canvas, int side) { - int s = side / ICON_RATIO; + int s = mVideoPlayIconSize; // Draw the video play icon at the center mVideoPlayIcon.draw(canvas, -s / 2, -s / 2, s, s); } diff --git a/src/com/android/gallery3d/ui/TimeLineTitleMaker.java b/src/com/android/gallery3d/ui/TimeLineTitleMaker.java index 2b368753a..7a2c9e050 100755 --- a/src/com/android/gallery3d/ui/TimeLineTitleMaker.java +++ b/src/com/android/gallery3d/ui/TimeLineTitleMaker.java @@ -48,7 +48,7 @@ public class TimeLineTitleMaker { private final Context mContext; private final TimeLineSlotView mTimeLineSlotView; - private final int TIMELINETITLE_START_X = 16; + private final int TIMELINETITLE_START_X; public TimeLineTitleMaker(Context context, TimeLineSlotRenderer.LabelSpec spec, TimeLineSlotView slotView) { mContext = context; @@ -56,6 +56,8 @@ public class TimeLineTitleMaker { mTimeLineSlotView = slotView; mTitlePaint = getTextPaint(spec.timeLineTitleFontSize, spec.timeLineTitleTextColor , true); mCountPaint = getTextPaint(spec.timeLineTitleFontSize, spec.timeLineNumberTextColor, true); + TIMELINETITLE_START_X = context.getResources().getDimensionPixelSize( + R.dimen.timeline_title_margin); } private static TextPaint getTextPaint( @@ -164,7 +166,7 @@ public class TimeLineTitleMaker { countString, 0, countString.length(), mediaCountBounds); int w = mediaCountBounds.width(); y = (height - spec.timeLineTitleFontSize)/2; - x = width - countString.length() -w; + x = width - TIMELINETITLE_START_X - w; // re-calculate x for RTL if (View.LAYOUT_DIRECTION_RTL == TextUtils .getLayoutDirectionFromLocale(Locale.getDefault())) { |
