0

Android: Fix bottom padding of gesture navigation

The last item of gesture navigation sheet needs more space to match
the UI guideline. This CL gives extra bottom padding to address it. A
bit more value (navigation_sheet_content_wrap_padding) is necessary
when the sheet wraps around the content (as opposed to when clipping
the height to the half of the screen).

Bug: 993036
Change-Id: I729a82866105d2c159f1597558c88d5ecda0d0f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1775681
Reviewed-by: Matthew Jones <mdjones@chromium.org>
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691835}
This commit is contained in:
Jinsuk Kim
2019-08-29 22:38:43 +00:00
committed by Commit Bot
parent f8e26eedfc
commit a43cde1716
3 changed files with 12 additions and 6 deletions
chrome/android/java
res
src
org
chromium
chrome
browser

@ -12,5 +12,6 @@
android:layout_height="match_parent"
android:divider="@null"
android:dividerHeight="0dp"
android:paddingTop="@dimen/navigation_sheet_content_top_padding" />
android:paddingTop="@dimen/navigation_sheet_content_top_padding"
android:paddingBottom="@dimen/navigation_sheet_content_bottom_padding" />
</org.chromium.chrome.browser.gesturenav.NavigationSheetView>

@ -657,7 +657,8 @@
<dimen name="navigation_bubble_text_end_padding">8dp</dimen>
<dimen name="navigation_sheet_toolbar_bottom_padding">44dp</dimen>
<dimen name="navigation_sheet_content_top_padding">18dp</dimen>
<dimen name="navigation_sheet_content_bottom_padding">8dp</dimen>
<dimen name="navigation_sheet_content_bottom_padding">4dp</dimen>
<dimen name="navigation_sheet_content_wrap_padding">4dp</dimen>
<!-- ChromeTextInputLayout dimensions -->
<dimen name="text_input_layout_padding_start">3dp</dimen>

@ -5,6 +5,7 @@
package org.chromium.chrome.browser.gesturenav;
import android.content.Context;
import android.support.annotation.IdRes;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ListView;
@ -30,10 +31,13 @@ public class NavigationSheetView extends RelativeLayout {
public NavigationSheetView(Context context, AttributeSet attrs) {
super(context, attrs);
mItemHeight = getResources().getDimensionPixelSize(R.dimen.navigation_popup_item_height);
mContentPadding =
getResources().getDimensionPixelSize(R.dimen.navigation_sheet_content_top_padding)
+ getResources().getDimensionPixelSize(
R.dimen.navigation_sheet_content_bottom_padding);
mContentPadding = getSizePx(context, R.dimen.navigation_sheet_content_top_padding)
+ getSizePx(context, R.dimen.navigation_sheet_content_bottom_padding)
+ getSizePx(context, R.dimen.navigation_sheet_content_wrap_padding);
}
private static int getSizePx(Context context, @IdRes int id) {
return context.getResources().getDimensionPixelSize(id);
}
/**