Restyle USSD AlertDialog.
+ Fix text color.
+ Tweak padding by adding FrameLayout and applying padding.
+ Change button colors to dialer blue.
Bug: 19015785
Change-Id: I2f5ace88897db728dd677786f2be744d91cdadf7
diff --git a/src/com/android/phone/PhoneUtils.java b/src/com/android/phone/PhoneUtils.java
index 502a379..6b34208 100644
--- a/src/com/android/phone/PhoneUtils.java
+++ b/src/com/android/phone/PhoneUtils.java
@@ -38,6 +38,7 @@
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.util.Log;
+import android.view.ContextThemeWrapper;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
@@ -1017,7 +1018,9 @@
// time that a USSD should be canceled.
// inflate the layout with the scrolling text area for the dialog.
- LayoutInflater inflater = (LayoutInflater) context.getSystemService(
+ ContextThemeWrapper contextThemeWrapper =
+ new ContextThemeWrapper(context, R.style.DialerAlertDialogTheme);
+ LayoutInflater inflater = (LayoutInflater) contextThemeWrapper.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
View dialogView = inflater.inflate(R.layout.dialog_ussd_response, null);
@@ -1056,7 +1059,7 @@
};
// build the dialog
- final AlertDialog newDialog = new AlertDialog.Builder(context, THEME)
+ final AlertDialog newDialog = new AlertDialog.Builder(contextThemeWrapper)
.setMessage(text)
.setView(dialogView)
.setPositiveButton(R.string.send_button, mUSSDDialogListener)
@@ -1092,6 +1095,11 @@
// now show the dialog!
newDialog.show();
+
+ newDialog.getButton(DialogInterface.BUTTON_POSITIVE)
+ .setTextColor(context.getResources().getColor(R.color.dialer_theme_color));
+ newDialog.getButton(DialogInterface.BUTTON_NEGATIVE)
+ .setTextColor(context.getResources().getColor(R.color.dialer_theme_color));
}
}
}