summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-03-17 20:51:30 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-03-17 20:51:30 -0700
commite9f453cea2aff1f9ae4cb996fe6f64772b7a9090 (patch)
treed5cc65c74765b0a8f67a36ad307c2563e7c35b7b /src/com
parent26223608a193d137ea4bcf3d3d5d2ce51fe4be44 (diff)
parentd9f2785ed1322f100137e2e9f76ee2e509a6fd4a (diff)
downloadandroid_packages_apps_Gallery2-e9f453cea2aff1f9ae4cb996fe6f64772b7a9090.tar.gz
android_packages_apps_Gallery2-e9f453cea2aff1f9ae4cb996fe6f64772b7a9090.tar.bz2
android_packages_apps_Gallery2-e9f453cea2aff1f9ae4cb996fe6f64772b7a9090.zip
Merge "Gallery2: Adjust the layout of bottom controls of photopage" into android_ui.lnx.1.2-dev
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java10
-rw-r--r--src/com/android/gallery3d/app/PhotoPageBottomControls.java32
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);
}
}