public static void dialogColor(AlertDialog dialog) {
    try {
      Resources resources = dialog.getContext().getResources();
      int color = resources.getColor(R.color.orange); // your color here

      int alertTitleId = resources.getIdentifier("alertTitle", "id", "android");
      TextView alertTitle = (TextView) dialog.getWindow().getDecorView().findViewById(alertTitleId);
      alertTitle.setTextColor(color); // change title text color

      int titleDividerId = resources.getIdentifier("titleDivider", "id", "android");
      View titleDivider = dialog.getWindow().getDecorView().findViewById(titleDividerId);
      titleDivider.setBackgroundColor(color); // change divider color
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
Esempio n. 2
0
 @Override
 public void run() {
   Toast.makeText(mDialog.getContext(), R.string.something_went_wrong_request, Toast.LENGTH_LONG)
       .show();
   mDialog.dismiss();
 }
 @Override
 public Context getContext() {
   return dialog.getContext();
 }