How to apply light theme for the activity and keep the dark theme for the dialogs at the same time?
Tag : android , By : Richard Laksana
Date : March 29 2020, 07:55 AM
it fixes the issue I solved it by changing the activity theme to light and then I set programmatically the theme of the alert dialog to the one of the dark, built in android styles: this.setTheme(android.R.style.Theme_Holo_Dialog);
builder = new AlertDialog.Builder(new ContextThemeWrapper(this, android.R.style.Theme_DeviceDefault_Dialog))
|
Modifying jquery mobile theme for iOS, android and windows phone 8 native look
Date : March 29 2020, 07:55 AM
it fixes the issue Yes, you will be able to switch between different css during html loading via simple javascript code. Other recommendations {
"name": "MyApp",
"js": ["platformspecific.js", "platformspecific.2js"],
"css": ["platformspecific.css", "platformspecific2.css"],
"settings": {
"isOption1Enabled": true,
"isOption2Enabled": false
}
}
|
Android v21 Theme.Appcompat color accent is ignored, no padding on dialogs
Date : March 29 2020, 07:55 AM
will be helpful for those in need About the accent color. You are using a AppCompat theme so you should remove Android from the namespace inside your theme. <style name="AppTheme_Light" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/abc1</item>
<item name="colorPrimaryDark">@color/abc2</item>
<item name="colorAccent">@color/abc3</item>
</style>
<style name="Theme" parent="FrameworkRoot.Theme">
<item name="android:alertDialogTheme">@style/Theme.AlertDialog</item>
</style>
<style name="Theme.AlertDialog" parent="android:Theme.Material.Light.Dialog.Alert">
<item name="android:colorPrimary">@color/demo_primary_color</item>
<item name="android:colorPrimaryDark">@color/demo_colorPrimaryDark</item>
<item name="android:colorAccent">@color/theme_accent_1</item>
</style>
import android.support.v7.app.AlertDialog
AlertDialog.Builder builder =
new AlertDialog.Builder(this, R.style.AppCompatAlertDialogStyle);
builder.setTitle("Dialog");
builder.setMessage("Lorem ipsum dolor ....");
builder.setPositiveButton("OK", null);
builder.setNegativeButton("Cancel", null);
builder.show();
<style name="AppCompatAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="colorAccent">#FFCC00</item>
<item name="android:textColorPrimary">#FFFFFF</item>
<item name="android:background">#5fa3d0</item>
</style>
<style name="AppTheme" parent="Theme.AppCompat.Light">
<!-- your style -->
<item name="alertDialogTheme">@style/AppCompatAlertDialogStyle</item>
</style>
import android.support.v7.app.AlertDialog
AlertDialog.Builder builder =
new AlertDialog.Builder(this);
|
java Android - two dialogs, prevent first dialog from closing after second one exits
Tag : java , By : jedameron
Date : March 29 2020, 07:55 AM
should help you out I eventually managed to solve this problem by creating two separate functions to generate each dialog box, and when one closes it calls the function to create the other one, kinda like recycling (or maybe closer to looping functions). Although, I'm not entirely sure how performance heavy this is, but it seems to do the job without any issues from what I'm testing. If anyone would like to chime in on how this could be an issue, then I'm open to hearing what others have to say about the negative points of using alert dialog boxes this way.
|
Android: Why doesn't custom button theme apply to dialogs?
Date : March 29 2020, 07:55 AM
|