Java Code Examples for com.kabouzeid.appthemehelper.ThemeStore#isConfigured()

The following examples show how to use com.kabouzeid.appthemehelper.ThemeStore#isConfigured() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: App.java    From Music-Player with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    app = this;

    // default theme
    if (!ThemeStore.isConfigured(this, 1)) {
        ThemeStore.editTheme(this)
                .primaryColorRes(R.color.primary_color)
                .accentColorRes(R.color.accent_color)
                .commit();
    }

    // Set up dynamic shortcuts
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
        new DynamicShortcutManager(this).initDynamicShortcuts();
    }
}
 
Example 2
Source File: AbsThemeActivity.java    From RetroMusicPlayer with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    // default theme
    if (!ThemeStore.isConfigured(this, 1)) {
        ThemeStore.editTheme(this)
                .activityTheme(R.style.Theme_RetroMusic_Light)
                .accentColorRes(R.color.md_green_A200)
                .commit();
    }
    getSharedPreferences("[[kabouzeid_app-theme-helper]]", 0)
            .edit()
            .putInt("activity_theme", PreferenceUtil.getInstance(this).getGeneralTheme())
            .apply(); // TEMPORARY FIX

    super.onCreate(savedInstanceState);

    MaterialDialogsUtil.updateMaterialDialogsThemeSingleton(this);

    changeBackgroundShape();

    mDecorView = getWindow().getDecorView();

    //ActivityUtils.toggleFullscreen(this, PreferenceUtil.getInstance(this).getFullScreenMode());
}
 
Example 3
Source File: App.java    From VinylMusicPlayer with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    app = this;

    context = getApplicationContext();

    // default theme
    if (!ThemeStore.isConfigured(this, 1)) {
        ThemeStore.editTheme(this)
                .primaryColorRes(R.color.md_indigo_500)
                .accentColorRes(R.color.md_pink_A400)
                .commit();
    }

    // Set up dynamic shortcuts
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
        new DynamicShortcutManager(this).initDynamicShortcuts();
    }
}
 
Example 4
Source File: AbsThemeActivity.java    From Orin with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    // default theme
    if (!ThemeStore.isConfigured(this, 1)) {
        ThemeStore.editTheme(this)
                .activityTheme(R.style.Theme_Phonograph)
                .primaryColorRes(R.color.md_pink_200)
                .accentColorRes(R.color.md_purple_A100)
                .commit();
    }

    getSharedPreferences("[[kabouzeid_app-theme-helper]]", 0).edit().putInt("activity_theme", PreferenceUtil.getInstance(this).getGeneralTheme()).commit(); // TEMPORARY FIX
    super.onCreate(savedInstanceState);
    MaterialDialogsUtil.updateMaterialDialogsThemeSingleton(this);
}
 
Example 5
Source File: App.java    From Phonograph with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    app = this;

    // default theme
    if (!ThemeStore.isConfigured(this, 1)) {
        ThemeStore.editTheme(this)
                .primaryColorRes(R.color.md_indigo_500)
                .accentColorRes(R.color.md_pink_A400)
                .commit();
    }

    // Set up dynamic shortcuts
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
        new DynamicShortcutManager(this).initDynamicShortcuts();
    }

    // automatically restores purchases
    billingProcessor = new BillingProcessor(this, App.GOOGLE_PLAY_LICENSE_KEY, new BillingProcessor.IBillingHandler() {
        @Override
        public void onProductPurchased(@NonNull String productId, TransactionDetails details) {
        }

        @Override
        public void onPurchaseHistoryRestored() {
            if (App.isProVersion()) {
                App.notifyProVersionChanged();
            }
        }

        @Override
        public void onBillingError(int errorCode, Throwable error) {
        }

        @Override
        public void onBillingInitialized() {
            App.loadPurchases(); // runs in background
        }
    });
}