ns-usbloader-mobile/app/src/main/java/com/blogspot/developersu/ns_usbloader/ApplicationTheme.java
Dmitry Isaenko 8bd76fdff6 Update cancel button icon
Update notification priority: no sound on modern devices when notification icon appears (in case it's not fixed for end user - application should bre re-installed)
Update games pattern image to be even more awesome
Make application theme to be applied based on user's choice when application starts.
Made disable buttons looks disable again!
2020-10-11 16:14:47 +03:00

28 lines
985 B
Java

package com.blogspot.developersu.ns_usbloader;
import androidx.appcompat.app.AppCompatDelegate;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES;
public class ApplicationTheme {
private static final int SYSTEM_DEFAULT = 0;
private static final int DAY_THEME = 1;
private static final int NIGHT_THEME = 2;
private ApplicationTheme(){}
public static void setApplicationTheme(int itemId){
switch (itemId){
case SYSTEM_DEFAULT:
AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_FOLLOW_SYSTEM);
break;
case DAY_THEME:
AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_NO);
break;
case NIGHT_THEME:
AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_YES);
}
}
}