diff options
author | Tony Mantler <nicoya@google.com> | 2014-08-11 11:52:34 -0700 |
---|---|---|
committer | Tony Mantler <nicoya@google.com> | 2014-08-11 13:37:09 -0700 |
commit | 1aaf4f9954040322bee0ccc77a18eb731a65c781 (patch) | |
tree | 83451d3bc884309a80385d9c40638918e2d52e4c | |
parent | c013991008a8d7baf4ae40103c150b99f0a102e8 (diff) | |
download | android_packages_apps_UnifiedEmail-1aaf4f9954040322bee0ccc77a18eb731a65c781.tar.gz android_packages_apps_UnifiedEmail-1aaf4f9954040322bee0ccc77a18eb731a65c781.tar.bz2 android_packages_apps_UnifiedEmail-1aaf4f9954040322bee0ccc77a18eb731a65c781.zip |
Add bottom margin for last footer item in drawer
b/15966080
Change-Id: I6adff812aee597b6bb0943bde11e39aa563fe06f
-rw-r--r-- | res/layout/drawer_footer_item.xml | 6 | ||||
-rw-r--r-- | src/com/android/mail/ui/FolderListFragment.java | 12 |
2 files changed, 17 insertions, 1 deletions
diff --git a/res/layout/drawer_footer_item.xml b/res/layout/drawer_footer_item.xml index 9e003fc94..946bdd0bf 100644 --- a/res/layout/drawer_footer_item.xml +++ b/res/layout/drawer_footer_item.xml @@ -30,7 +30,6 @@ android:layout_marginTop="8dp" android:layout_marginBottom="8dp" /> - <LinearLayout android:layout_height="wrap_content" android:layout_width="match_parent" @@ -55,4 +54,9 @@ style="@style/DrawerFooterListItemStyle"/> </LinearLayout> + <Space + android:id="@+id/bottom_margin" + android:layout_width="match_parent" + android:layout_height="8dp" /> + </LinearLayout> diff --git a/src/com/android/mail/ui/FolderListFragment.java b/src/com/android/mail/ui/FolderListFragment.java index 67bd14174..52cbe87ae 100644 --- a/src/com/android/mail/ui/FolderListFragment.java +++ b/src/com/android/mail/ui/FolderListFragment.java @@ -1310,6 +1310,8 @@ public class FolderListFragment extends ListFragment implements footerItemView.findViewById(R.id.top_border).setVisibility( item.shouldShowTopBorder() ? View.VISIBLE : View.GONE); + footerItemView.findViewById(R.id.bottom_margin).setVisibility( + item.shouldIncludeBottomMargin() ? View.VISIBLE : View.GONE); // adjust the text of the footer item final TextView textView = (TextView) footerItemView. @@ -1346,6 +1348,7 @@ public class FolderListFragment extends ListFragment implements if (!mFooterItems.isEmpty()) { mFooterItems.get(0).setShowTopBorder(true); + mFooterItems.get(mFooterItems.size() - 1).setIncludeBottomMargin(true); } notifyDataSetChanged(); @@ -1469,6 +1472,7 @@ public class FolderListFragment extends ListFragment implements private final int mTextResourceID; private boolean mShowTopBorder; + private boolean mIncludeBottomMargin; private FooterItem(final int imageResourceID, final int textResourceID) { mImageResourceID = imageResourceID; @@ -1514,6 +1518,14 @@ public class FolderListFragment extends ListFragment implements mShowTopBorder = show; } + public boolean shouldIncludeBottomMargin() { + return mIncludeBottomMargin; + } + + public void setIncludeBottomMargin(boolean include) { + mIncludeBottomMargin = include; + } + // for analytics String getEventLabel() { final StringBuilder sb = new StringBuilder("drawer_footer"); |