Search in sources :

Example 1 with SecondaryHomeActivity

use of com.farmerbb.taskbar.activity.SecondaryHomeActivity in project Taskbar by farmerbb.

the class UIController method init.

protected void init(Context context, UIHost host, Runnable runnable) {
    SharedPreferences pref = U.getSharedPreferences(context);
    LauncherHelper helper = LauncherHelper.getInstance();
    boolean shouldProceed;
    if (helper.isOnSecondaryHomeScreen(context))
        shouldProceed = host instanceof SecondaryHomeActivity;
    else
        shouldProceed = true;
    if (shouldProceed && (pref.getBoolean(PREF_TASKBAR_ACTIVE, false) || helper.isOnHomeScreen(context))) {
        if (U.canDrawOverlays(context))
            runnable.run();
        else {
            pref.edit().putBoolean(PREF_TASKBAR_ACTIVE, false).apply();
            host.terminate();
        }
    } else
        host.terminate();
}
Also used : SharedPreferences(android.content.SharedPreferences) LauncherHelper(com.farmerbb.taskbar.helper.LauncherHelper) SecondaryHomeActivity(com.farmerbb.taskbar.activity.SecondaryHomeActivity)

Aggregations

SharedPreferences (android.content.SharedPreferences)1 SecondaryHomeActivity (com.farmerbb.taskbar.activity.SecondaryHomeActivity)1 LauncherHelper (com.farmerbb.taskbar.helper.LauncherHelper)1