Search in sources :

Example 1 with LauncherHelper

use of com.farmerbb.taskbar.util.LauncherHelper in project Taskbar by farmerbb.

the class HomeActivity method onStart.

@Override
protected void onStart() {
    super.onStart();
    LocalBroadcastManager.getInstance(this).sendBroadcast(new Intent("com.farmerbb.taskbar.HIDE_START_MENU"));
    if (U.canDrawOverlays(this)) {
        if (!bootToFreeform()) {
            final LauncherHelper helper = LauncherHelper.getInstance();
            helper.setOnHomeScreen(true);
            if (forceTaskbarStart) {
                forceTaskbarStart = false;
                new Handler().postDelayed(() -> {
                    helper.setOnHomeScreen(true);
                    startTaskbar();
                }, 250);
            } else
                startTaskbar();
        } else if (U.launcherIsDefault(this))
            startFreeformHack();
    } else
        dialog = U.showPermissionDialog(U.wrapContext(this), () -> dialog = U.showErrorDialog(U.wrapContext(this), "SYSTEM_ALERT_WINDOW"), null);
}
Also used : Handler(android.os.Handler) Intent(android.content.Intent) LauncherHelper(com.farmerbb.taskbar.util.LauncherHelper)

Aggregations

Intent (android.content.Intent)1 Handler (android.os.Handler)1 LauncherHelper (com.farmerbb.taskbar.util.LauncherHelper)1