Add offset to round screens when an AlertDialog list item is shown.
Bug: 30950051 Change-Id: I4546c2381fef68bc9e2d080c6b50f5df17810044
This commit is contained in:
@@ -888,7 +888,8 @@ public class AlertController {
|
||||
final int checkedItem = mCheckedItem;
|
||||
if (checkedItem > -1) {
|
||||
listView.setItemChecked(checkedItem, true);
|
||||
listView.setSelection(checkedItem);
|
||||
listView.setSelectionFromTop(checkedItem,
|
||||
a.getDimensionPixelSize(R.styleable.AlertDialog_selectionScrollOffset, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,4 +22,7 @@
|
||||
|
||||
<!-- Gravity that should be used for dialog text styles. Equivalent to: Gravity.CENTER_HORIZONTAL | Gravity.TOP -->
|
||||
<integer name="config_dialogTextGravity">0x00000031</integer>
|
||||
|
||||
<!-- The amount to offset when scrolling to a selection in an AlertDialog -->
|
||||
<dimen name="config_alertDialogSelectionScrollOffset">@dimen/screen_percentage_15</dimen>
|
||||
</resources>
|
||||
|
||||
@@ -2057,6 +2057,8 @@ i
|
||||
<!-- Controller for micro specific layout. -->
|
||||
<enum name="micro" value="1" />
|
||||
</attr>
|
||||
<!-- @hide Offset when scrolling to a selection. -->
|
||||
<attr name="selectionScrollOffset" format="dimension" />
|
||||
</declare-styleable>
|
||||
|
||||
<!-- @hide -->
|
||||
|
||||
@@ -34,4 +34,7 @@
|
||||
|
||||
<!-- True if preference fragment should clip to padding. -->
|
||||
<bool name="config_preferenceFragmentClipToPadding">true</bool>
|
||||
|
||||
<!-- The amount to offset when scrolling to a selection in an AlertDialog -->
|
||||
<dimen name="config_alertDialogSelectionScrollOffset">0dp</dimen>
|
||||
</resources>
|
||||
|
||||
@@ -1213,6 +1213,7 @@ please see styles_device_defaults.xml.
|
||||
<item name="multiChoiceItemLayout">@layout/select_dialog_multichoice_material</item>
|
||||
<item name="singleChoiceItemLayout">@layout/select_dialog_singlechoice_material</item>
|
||||
<item name="controllerType">@integer/config_alertDialogController</item>
|
||||
<item name="selectionScrollOffset">@dimen/config_alertDialogSelectionScrollOffset</item>
|
||||
</style>
|
||||
|
||||
<style name="AlertDialog.Material.Light" />
|
||||
|
||||
Reference in New Issue
Block a user