diff options
author | Cagdas Caglak <cagdascaglak@gmail.com> | 2017-04-22 02:35:44 +0300 |
---|---|---|
committer | LuK1337 <priv.luk@gmail.com> | 2019-10-21 21:42:08 +0200 |
commit | 22b375c631257d47c8d401dce9e4f24612a3291e (patch) | |
tree | 74aef87d0fecbf5ec20ac4e24486a96efcde027d | |
parent | 3664c3aa74c5097dd8025781f59c82c433cb57b8 (diff) | |
download | android_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.xml | 2 | ||||
-rwxr-xr-x | src/com/android/gallery3d/app/AlbumSetPage.java | 9 |
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; } |