Commit f73d9c3d authored by Leo Zhang's avatar Leo Zhang Committed by Commit Bot

Fix ListMenuButton padding value for Android 4.1.*

Views with padding listPreferredItemPaddingStart will crash on Android
4.1.*.
Tested on Android 4.1.2 and 4.2.2.

Bug: 792809
Change-Id: I007885ac549391c097e187d591107d6fea4c7cb4
Reviewed-on: https://chromium-review.googlesource.com/823650Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Leo Zhang <googleo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524302}
parent 9b911f2f
......@@ -6,8 +6,7 @@
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeightSmall"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:textColor="@color/dark_mode_tint"
android:gravity="center_vertical"
android:textSize="16sp" />
android:textSize="16sp"
style="@style/ListMenuItemStyle" />
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2017 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<resources>
<!-- ListMenuButton. listPreferredItemPaddingStart/End are not supported before API 17
of Android. (https://crbug.com/792809) -->
<style name="ListMenuItemStyle">
<item name="android:paddingLeft">?android:attr/listPreferredItemPaddingLeft</item>
<item name="android:paddingRight">?android:attr/listPreferredItemPaddingRight</item>
</style>
</resources>
......@@ -774,4 +774,10 @@
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
</style>
<!-- ListMenuButton -->
<style name="ListMenuItemStyle">
<item name="android:paddingStart">?android:attr/listPreferredItemPaddingStart</item>
<item name="android:paddingEnd">?android:attr/listPreferredItemPaddingEnd</item>
</style>
</resources>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment