husonet | Tarih: 28.09.2015
Android AlertDialog BackGround renklendirme
Android AlertDialog BackGround renklendirme işlemleri nasıl yapılır
public static void cancelDialog(Context con, String message){
final AlertDialog.Builder alert = new AlertDialog.Builder(con, R.style.MyTheme);
// alert.set getWindow().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#E04A48")));
alert.setMessage(message);
alert.setPositiveButton(con.getResources().getString(R.string.tamam), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
alert.show();
}
Kullanılacak Style
<style name="MyTheme" parent="@android:style/Theme.Dialog">
<item name="android:alertDialogStyle">@style/CustomAlertDialogStyle</item>
<item name="android:windowBackground">@color/PinkP</item>
<item name="android:textColorPrimary">#000000</item>
</style>
<style name="CustomAlertDialogStyle">
<item name="android:bottomBright">@color/PinkP</item>
<item name="android:bottomDark">@color/PinkP</item>
<item name="android:bottomMedium">@color/PinkP</item>
<item name="android:centerBright">@color/PinkP</item>
<item name="android:centerDark">@color/PinkP</item>
<item name="android:centerMedium">@color/PinkP</item>
<item name="android:fullBright">@color/PinkP</item>
<item name="android:fullDark">@color/PinkP</item>
<item name="android:topBright">@color/PinkP</item>
<item name="android:topDark">@color/PinkP</item>
</style>