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();
}
Aggregations