diff --git a/core/java/com/android/internal/app/AlertController.java b/core/java/com/android/internal/app/AlertController.java index 2a40aeb9111ea..2b25b3fef9cca 100644 --- a/core/java/com/android/internal/app/AlertController.java +++ b/core/java/com/android/internal/app/AlertController.java @@ -618,7 +618,7 @@ public class AlertController { } } - private void setupTitle(ViewGroup topPanel) { + protected void setupTitle(ViewGroup topPanel) { if (mCustomTitleView != null && mShowTitle) { // Add the custom title view directly to the topPanel layout final LayoutParams lp = new LayoutParams( @@ -701,7 +701,7 @@ public class AlertController { } } - private void setupButtons(ViewGroup buttonPanel) { + protected void setupButtons(ViewGroup buttonPanel) { int BIT_BUTTON_POSITIVE = 1; int BIT_BUTTON_NEGATIVE = 2; int BIT_BUTTON_NEUTRAL = 4; diff --git a/core/java/com/android/internal/app/MicroAlertController.java b/core/java/com/android/internal/app/MicroAlertController.java index 085b2265dfee0..00fcd6f42a53a 100644 --- a/core/java/com/android/internal/app/MicroAlertController.java +++ b/core/java/com/android/internal/app/MicroAlertController.java @@ -82,4 +82,20 @@ public class MicroAlertController extends AlertController { } } } + + @Override + protected void setupTitle(ViewGroup topPanel) { + super.setupTitle(topPanel); + if (topPanel.getVisibility() == View.GONE) { + topPanel.setVisibility(View.INVISIBLE); + } + } + + @Override + protected void setupButtons(ViewGroup buttonPanel) { + super.setupButtons(buttonPanel); + if (buttonPanel.getVisibility() == View.GONE) { + buttonPanel.setVisibility(View.INVISIBLE); + } + } } diff --git a/core/res/res/layout-watch/alert_dialog_material.xml b/core/res/res/layout-watch/alert_dialog_material.xml index e627d42b5fb48..a8bb204a51ffb 100644 --- a/core/res/res/layout-watch/alert_dialog_material.xml +++ b/core/res/res/layout-watch/alert_dialog_material.xml @@ -21,6 +21,7 @@ android:layout_height="match_parent"> + android:id="@+id/topPanel" + android:minHeight="@dimen/dialog_list_padding_top_no_title">