summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCagdas Caglak <cagdascaglak@gmail.com>2017-04-22 02:35:44 +0300
committerLuK1337 <priv.luk@gmail.com>2019-10-21 21:42:08 +0200
commit22b375c631257d47c8d401dce9e4f24612a3291e (patch)
tree74aef87d0fecbf5ec20ac4e24486a96efcde027d
parent3664c3aa74c5097dd8025781f59c82c433cb57b8 (diff)
downloadandroid_packages_apps_Gallery2-22b375c631257d47c8d401dce9e4f24612a3291e.tar.gz
android_packages_apps_Gallery2-22b375c631257d47c8d401dce9e4f24612a3291e.tar.bz2
android_packages_apps_Gallery2-22b375c631257d47c8d401dce9e4f24612a3291e.zip
Gallery2: Fix views overlap
"No photos found" and camera button were overlapped. Camera button layout params changed and it was moved no data text below and aligned center horizontal. Change-Id: Idd76efaa54dd178eb3ff2cb5fae3ca17ef5acea3
-rw-r--r--res/values/ids.xml2
-rwxr-xr-xsrc/com/android/gallery3d/app/AlbumSetPage.java9
2 files changed, 10 insertions, 1 deletions
diff --git a/res/values/ids.xml b/res/values/ids.xml
index f5b4a48fd..93ea5c0ec 100644
--- a/res/values/ids.xml
+++ b/res/values/ids.xml
@@ -23,4 +23,6 @@
<item type="id" name="ingest_notification_scanning" />
<item type="id" name="ingest_notification_importing" />
+
+ <item type="id" name="empty_album" />
</resources>
diff --git a/src/com/android/gallery3d/app/AlbumSetPage.java b/src/com/android/gallery3d/app/AlbumSetPage.java
index ec658961f..2b87f97b4 100755
--- a/src/com/android/gallery3d/app/AlbumSetPage.java
+++ b/src/com/android/gallery3d/app/AlbumSetPage.java
@@ -261,6 +261,7 @@ public class AlbumSetPage extends ActivityState implements
tvEmptyAlbum.setTextColor(Color.parseColor("#8A000000"));
tvEmptyAlbum.setGravity(Gravity.CENTER);
tvEmptyAlbum.setTextSize(TypedValue.COMPLEX_UNIT_SP, 20);
+ tvEmptyAlbum.setId(R.id.empty_album);
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
@@ -412,8 +413,14 @@ public class AlbumSetPage extends ActivityState implements
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
- lp.addRule(RelativeLayout.CENTER_IN_PARENT);
+ if (tvEmptyAlbum != null && tvEmptyAlbum.getVisibility() == View.VISIBLE) {
+ lp.addRule(RelativeLayout.BELOW, tvEmptyAlbum.getId());
+ lp.addRule(RelativeLayout.CENTER_HORIZONTAL);
+ } else {
+ lp.addRule(RelativeLayout.CENTER_IN_PARENT);
+ }
galleryRoot.addView(mCameraButton, lp);
+
return true;
}