Loading core/java/com/android/internal/app/AlertController.java +37 −9 Original line number Diff line number Diff line Loading @@ -516,9 +516,15 @@ public class AlertController { } // Only show the divider if we have a title. final View divider; View divider = null; if (mMessage != null || mListView != null || hasCustomPanel) { if (!hasCustomPanel) { divider = topPanel.findViewById(R.id.titleDividerNoCustom); } if (divider == null) { divider = topPanel.findViewById(R.id.titleDivider); } } else { divider = topPanel.findViewById(R.id.titleDividerTop); } Loading @@ -526,6 +532,17 @@ public class AlertController { if (divider != null) { divider.setVisibility(View.VISIBLE); } } else { if (contentPanel != null) { final View spacer = contentPanel.findViewById(R.id.textSpacerNoTitle); if (spacer != null) { spacer.setVisibility(View.VISIBLE); } } } if (mListView instanceof RecycleListView) { ((RecycleListView) mListView).setHasDecor(hasTopPanel, hasButtonPanel); } // Update scroll indicators as needed. Loading Loading @@ -861,23 +878,34 @@ public class AlertController { } public static class RecycleListView extends ListView { private final int mPaddingTopNoTitle; private final int mPaddingBottomNoButtons; boolean mRecycleOnMeasure = true; public RecycleListView(Context context) { super(context); this(context, null); } public RecycleListView(Context context, AttributeSet attrs) { super(context, attrs); } public RecycleListView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); final TypedArray ta = context.obtainStyledAttributes( attrs, R.styleable.RecycleListView); mPaddingBottomNoButtons = ta.getDimensionPixelOffset( R.styleable.RecycleListView_paddingBottomNoButtons, -1); mPaddingTopNoTitle = ta.getDimensionPixelOffset( R.styleable.RecycleListView_paddingTopNoTitle, -1); } public RecycleListView( Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); public void setHasDecor(boolean hasTitle, boolean hasButtons) { if (!hasButtons || !hasTitle) { final int paddingLeft = getPaddingLeft(); final int paddingTop = hasTitle ? getPaddingTop() : mPaddingTopNoTitle; final int paddingRight = getPaddingRight(); final int paddingBottom = hasButtons ? getPaddingBottom() : mPaddingBottomNoButtons; setPadding(paddingLeft, paddingTop, paddingRight, paddingBottom); } } @Override Loading core/res/res/layout/alert_dialog_material.xml +7 −2 Original line number Diff line number Diff line Loading @@ -34,7 +34,6 @@ android:id="@+id/scrollView" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="@dimen/dialog_padding_top_material" android:clipToPadding="false"> <LinearLayout Loading @@ -42,6 +41,12 @@ android:layout_height="wrap_content" android:orientation="vertical"> <Space android:id="@+id/textSpacerNoTitle" android:visibility="gone" android:layout_width="match_parent" android:layout_height="@dimen/dialog_padding_top_material" /> <TextView android:id="@+id/message" android:layout_width="match_parent" Loading @@ -53,7 +58,7 @@ <Space android:id="@+id/textSpacerNoButtons" android:visibility="gone" android:layout_width="0dp" android:layout_width="match_parent" android:layout_height="@dimen/dialog_padding_top_material" /> </LinearLayout> </ScrollView> Loading core/res/res/layout/alert_dialog_title_material.xml +7 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ android:layout_height="wrap_content" android:orientation="vertical"> <!-- If the client uses a customTitle, it will be added here. --> <LinearLayout android:id="@+id/title_template" android:layout_width="match_parent" Loading Loading @@ -49,5 +51,9 @@ style="?attr/windowTitleStyle" /> </LinearLayout> <!-- If the client uses a customTitle, it will be added here. --> <Space android:id="@+id/titleDividerNoCustom" android:visibility="gone" android:layout_width="match_parent" android:layout_height="@dimen/dialog_title_divider_material" /> </LinearLayout> core/res/res/layout/app_anr_dialog.xml +1 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ android:layout_height="wrap_content" android:orientation="vertical" android:paddingTop="@dimen/aerr_padding_list_top" android:paddingBottom="@dimen/dialog_list_padding_vertical_material"> android:paddingBottom="@dimen/aerr_padding_list_bottom"> <Button android:id="@+id/aerr_close" Loading core/res/res/layout/app_error_dialog.xml +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ android:layout_height="wrap_content" android:orientation="vertical" android:paddingTop="@dimen/aerr_padding_list_top" android:paddingBottom="@dimen/dialog_list_padding_vertical_material"> android:paddingBottom="@dimen/aerr_padding_list_bottom"> <Button Loading Loading
core/java/com/android/internal/app/AlertController.java +37 −9 Original line number Diff line number Diff line Loading @@ -516,9 +516,15 @@ public class AlertController { } // Only show the divider if we have a title. final View divider; View divider = null; if (mMessage != null || mListView != null || hasCustomPanel) { if (!hasCustomPanel) { divider = topPanel.findViewById(R.id.titleDividerNoCustom); } if (divider == null) { divider = topPanel.findViewById(R.id.titleDivider); } } else { divider = topPanel.findViewById(R.id.titleDividerTop); } Loading @@ -526,6 +532,17 @@ public class AlertController { if (divider != null) { divider.setVisibility(View.VISIBLE); } } else { if (contentPanel != null) { final View spacer = contentPanel.findViewById(R.id.textSpacerNoTitle); if (spacer != null) { spacer.setVisibility(View.VISIBLE); } } } if (mListView instanceof RecycleListView) { ((RecycleListView) mListView).setHasDecor(hasTopPanel, hasButtonPanel); } // Update scroll indicators as needed. Loading Loading @@ -861,23 +878,34 @@ public class AlertController { } public static class RecycleListView extends ListView { private final int mPaddingTopNoTitle; private final int mPaddingBottomNoButtons; boolean mRecycleOnMeasure = true; public RecycleListView(Context context) { super(context); this(context, null); } public RecycleListView(Context context, AttributeSet attrs) { super(context, attrs); } public RecycleListView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); final TypedArray ta = context.obtainStyledAttributes( attrs, R.styleable.RecycleListView); mPaddingBottomNoButtons = ta.getDimensionPixelOffset( R.styleable.RecycleListView_paddingBottomNoButtons, -1); mPaddingTopNoTitle = ta.getDimensionPixelOffset( R.styleable.RecycleListView_paddingTopNoTitle, -1); } public RecycleListView( Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); public void setHasDecor(boolean hasTitle, boolean hasButtons) { if (!hasButtons || !hasTitle) { final int paddingLeft = getPaddingLeft(); final int paddingTop = hasTitle ? getPaddingTop() : mPaddingTopNoTitle; final int paddingRight = getPaddingRight(); final int paddingBottom = hasButtons ? getPaddingBottom() : mPaddingBottomNoButtons; setPadding(paddingLeft, paddingTop, paddingRight, paddingBottom); } } @Override Loading
core/res/res/layout/alert_dialog_material.xml +7 −2 Original line number Diff line number Diff line Loading @@ -34,7 +34,6 @@ android:id="@+id/scrollView" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="@dimen/dialog_padding_top_material" android:clipToPadding="false"> <LinearLayout Loading @@ -42,6 +41,12 @@ android:layout_height="wrap_content" android:orientation="vertical"> <Space android:id="@+id/textSpacerNoTitle" android:visibility="gone" android:layout_width="match_parent" android:layout_height="@dimen/dialog_padding_top_material" /> <TextView android:id="@+id/message" android:layout_width="match_parent" Loading @@ -53,7 +58,7 @@ <Space android:id="@+id/textSpacerNoButtons" android:visibility="gone" android:layout_width="0dp" android:layout_width="match_parent" android:layout_height="@dimen/dialog_padding_top_material" /> </LinearLayout> </ScrollView> Loading
core/res/res/layout/alert_dialog_title_material.xml +7 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ android:layout_height="wrap_content" android:orientation="vertical"> <!-- If the client uses a customTitle, it will be added here. --> <LinearLayout android:id="@+id/title_template" android:layout_width="match_parent" Loading Loading @@ -49,5 +51,9 @@ style="?attr/windowTitleStyle" /> </LinearLayout> <!-- If the client uses a customTitle, it will be added here. --> <Space android:id="@+id/titleDividerNoCustom" android:visibility="gone" android:layout_width="match_parent" android:layout_height="@dimen/dialog_title_divider_material" /> </LinearLayout>
core/res/res/layout/app_anr_dialog.xml +1 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ android:layout_height="wrap_content" android:orientation="vertical" android:paddingTop="@dimen/aerr_padding_list_top" android:paddingBottom="@dimen/dialog_list_padding_vertical_material"> android:paddingBottom="@dimen/aerr_padding_list_bottom"> <Button android:id="@+id/aerr_close" Loading
core/res/res/layout/app_error_dialog.xml +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ android:layout_height="wrap_content" android:orientation="vertical" android:paddingTop="@dimen/aerr_padding_list_top" android:paddingBottom="@dimen/dialog_list_padding_vertical_material"> android:paddingBottom="@dimen/aerr_padding_list_bottom"> <Button Loading