From 4c8c153f5b4a82ca44297a47301c30ac1ad3d810 Mon Sep 17 00:00:00 2001 From: Chao Zhang Date: Tue, 3 May 2016 12:46:49 +0800 Subject: Gallery2: modify some UI interface according to UI document. 1. Modify layout of actionbar when selected photo; 2. Modify menu string in Video Page; 3. Modify compare button's position in photo editor; 4. Modify bottom panel's height in photo editor; 5. Set video play icon to 48dp in PhotoView; Change-Id: Ic660d5dde87998e87eb02482ac7ba7e2ba2f0bb1 CRs-Fixed: 1010984 --- src/com/android/gallery3d/app/AlbumPage.java | 12 ++++++++---- src/com/android/gallery3d/app/GalleryActionBar.java | 7 +++---- src/com/android/gallery3d/ui/AbstractSlotRenderer.java | 2 +- src/com/android/gallery3d/ui/PhotoView.java | 5 ++++- src/com/android/gallery3d/ui/TimeLineTitleMaker.java | 6 ++++-- 5 files changed, 20 insertions(+), 12 deletions(-) (limited to 'src') 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())) { -- cgit v1.2.3