diff options
| author | huiyan <huiyan@codeaurora.org> | 2016-03-11 13:37:08 +0800 |
|---|---|---|
| committer | huiyan <huiyan@codeaurora.org> | 2016-03-11 13:38:57 +0800 |
| commit | d9f2785ed1322f100137e2e9f76ee2e509a6fd4a (patch) | |
| tree | 33627f030c61c0568ec7331421926cbabd89ce74 /src/com | |
| parent | 97b5b5bdf26970e8873ada05de73555a9872c933 (diff) | |
| download | android_packages_apps_Gallery2-d9f2785ed1322f100137e2e9f76ee2e509a6fd4a.tar.gz android_packages_apps_Gallery2-d9f2785ed1322f100137e2e9f76ee2e509a6fd4a.tar.bz2 android_packages_apps_Gallery2-d9f2785ed1322f100137e2e9f76ee2e509a6fd4a.zip | |
Gallery2: Adjust the layout of bottom controls of photopage
Implement new feature: Adjust the layout of bottom controls of photopage,
to display nicely.
Change-Id: I61791303dc8e474976a948ff4fe72031d49f07e2
CRs-Fixed: 988011
Diffstat (limited to 'src/com')
| -rw-r--r-- | src/com/android/gallery3d/app/PhotoPage.java | 10 | ||||
| -rw-r--r-- | src/com/android/gallery3d/app/PhotoPageBottomControls.java | 32 |
2 files changed, 1 insertions, 41 deletions
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java index b11dadcc2..0a7d58944 100644 --- a/src/com/android/gallery3d/app/PhotoPage.java +++ b/src/com/android/gallery3d/app/PhotoPage.java @@ -207,7 +207,6 @@ public abstract class PhotoPage extends ActivityState implements private ShareActionProvider mShareActionProvider; private Intent mShareIntent; - private boolean mIsPhotoChanged = true; private final PanoramaSupportCallback mUpdatePanoramaMenuItemsCallback = new PanoramaSupportCallback() { @Override @@ -516,7 +515,6 @@ public abstract class PhotoPage extends ActivityState implements public void onPhotoChanged(int index, Path item) { int oldIndex = mCurrentIndex; mCurrentIndex = index; - mIsPhotoChanged = true; if (mHasCameraScreennailOrPlaceholder) { if (mCurrentIndex > 0) { @@ -628,14 +626,6 @@ public abstract class PhotoPage extends ActivityState implements if (mCurrentPhoto == null) { return false; } - if (mIsPhotoChanged) { - if (mCurrentPhoto.getMediaType() == MediaObject.MEDIA_TYPE_VIDEO) { - mBottomControls.setSharePositionForVideo(mActivity); - } else { - mBottomControls.setSharePositionForImage(); - } - mIsPhotoChanged = false; - } switch (control) { case R.id.photopage_bottom_controls: return mShowBars; diff --git a/src/com/android/gallery3d/app/PhotoPageBottomControls.java b/src/com/android/gallery3d/app/PhotoPageBottomControls.java index f12f6fb69..80ae3875b 100644 --- a/src/com/android/gallery3d/app/PhotoPageBottomControls.java +++ b/src/com/android/gallery3d/app/PhotoPageBottomControls.java @@ -53,8 +53,6 @@ public class PhotoPageBottomControls implements OnClickListener { private static final int CONTAINER_ANIM_DURATION_MS = 200; private static final int CONTROL_ANIM_DURATION_MS = 150; - private ImageButton imgShare; - private RelativeLayout.LayoutParams defaultParams; private static Animation getControlAnimForVisibility(boolean visible) { Animation anim = visible ? new AlphaAnimation(0f, 1f) @@ -72,10 +70,6 @@ public class PhotoPageBottomControls implements OnClickListener { mContainer = (ViewGroup) inflater .inflate(R.layout.photopage_bottom_controls, mParentLayout, false); mParentLayout.addView(mContainer); - imgShare = (ImageButton) mContainer - .findViewById(R.id.photopage_bottom_control_share); - defaultParams = (RelativeLayout.LayoutParams) imgShare - .getLayoutParams(); for (int i = mContainer.getChildCount() - 1; i >= 0; i--) { View child = mContainer.getChildAt(i); child.setOnClickListener(this); @@ -90,30 +84,6 @@ public class PhotoPageBottomControls implements OnClickListener { mDelegate.refreshBottomControlsWhenReady(); } - public void setSharePositionForImage() { - RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) imgShare - .getLayoutParams(); - params.removeRule(RelativeLayout.ALIGN_PARENT_START); - params.removeRule(RelativeLayout.ALIGN_PARENT_LEFT); - params.leftMargin = 0; - params.addRule(RelativeLayout.CENTER_IN_PARENT,-1); - imgShare.setLayoutParams(params); - } - - public void setSharePositionForVideo(Context context) { - imgShare = (ImageButton) mContainer - .findViewById(R.id.photopage_bottom_control_share); - RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) imgShare - .getLayoutParams(); - params.addRule(RelativeLayout.ALIGN_PARENT_START,-1); - Resources r = context.getResources(); - int margin = (int) TypedValue.applyDimension( - TypedValue.COMPLEX_UNIT_DIP, 20, r.getDisplayMetrics()); - params.leftMargin = margin; - imgShare.setLayoutParams(params); - - } - private void hide() { mContainer.clearAnimation(); mContainerAnimOut.reset(); @@ -150,7 +120,7 @@ public class PhotoPageBottomControls implements OnClickListener { control.clearAnimation(); control.startAnimation(getControlAnimForVisibility(curVisibility)); } - control.setVisibility(curVisibility ? View.VISIBLE : View.INVISIBLE); + control.setVisibility(curVisibility ? View.VISIBLE : View.GONE); mControlsVisible.put(control, curVisibility); } } |
