@@ -12,9 +12,6 @@ AlertDialog for Android, a beautiful and material alert dialog to use in your an
1212
1313` Latest version of this library is migrated to androidx `
1414
15- ## Download My Kinda App. A new way to debate on the topic
16- [ ![ ] ( https://github.com/TutorialsAndroid/Spoti/blob/master/art/google-play-badge.png )] ( https://bit.ly/kindadownload )
17-
1815## ScreenShot
1916![ ] ( https://github.com/TutorialsAndroid/KAlertDialog/blob/master/art/device-2019-03-23-132617.png )
2017
@@ -35,7 +32,7 @@ Add it in your root build.gradle at the end of repositories:
3532Step 2. Add the dependency
3633
3734 dependencies {
38- implementation 'com.github.TutorialsAndroid:KAlertDialog:v6 .0.19'
35+ implementation 'com.github.TutorialsAndroid:KAlertDialog:v7 .0.19'
3936 }
4037
4138## Usage
@@ -147,6 +144,24 @@ Customizing the alert dialog
147144
148145 .confirmButtonColor(R.color.colorPrimary) // you can change the color of confirm button
149146 .cancelButtonColor(R.color.colorAccent) // you can change the color of cancel button
147+ .setContentTextSize(50) // you can change the content text size
148+
149+ //This is how you can set dark theme to alert dialog box
150+ @Override
151+ protected void onCreate(Bundle savedInstanceState) {
152+
153+ //sets the theme for app
154+ SharedPreferences sharedPreferences = this
155+ .getSharedPreferences("theme", Context.MODE_PRIVATE);
156+ final boolean dark = sharedPreferences.getBoolean("dark", false);
157+ setTheme(dark ? R.style.AppThemeDark : R.style.AppTheme);
158+
159+ DARK_STYLE = dark; //this will apply dark theme to KAlertDialog Box
160+
161+ super.onCreate(savedInstanceState);
162+ setContentView(R.layout.main_ui);
163+ }
164+
150165
151166And if you want to change the button corners with color create a drawable file
152167
0 commit comments