launchApp(context, () -> {
Intent intent = new Intent(context, DummyActivity.class);
intent.putExtra("device_admin", true);
- intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION);
context.startActivity(intent, getActivityOptionsBundle(context, ApplicationType.APPLICATION));
-
- if(context instanceof Activity)
- ((Activity) context).overridePendingTransition(0, 0);
});
}
}
launchApp(context, () -> {
Intent intent = new Intent(context, DummyActivity.class);
intent.putExtra("accessibility", true);
- intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION);
context.startActivity(intent, getActivityOptionsBundle(context, ApplicationType.APPLICATION));
-
- if(context instanceof Activity)
- ((Activity) context).overridePendingTransition(0, 0);
});
}
}
final boolean openInNewWindow,
final ShortcutInfo shortcut) {
launchApp(context, launchedFromTaskbar, () -> continueLaunchingApp(context, packageName, componentName, userId,
- windowSize, launchedFromTaskbar, openInNewWindow, shortcut));
+ windowSize, openInNewWindow, shortcut));
}
public static void launchApp(Context context, Runnable runnable) {
&& pref.getBoolean("freeform_hack", false)
&& (!helper.isInFreeformWorkspace() || specialLaunch)) {
new Handler().postDelayed(() -> {
- startFreeformHack(context, true, launchedFromTaskbar);
+ startFreeformHack(context, true);
new Handler().postDelayed(runnable, helper.isFreeformHackActive() ? 0 : 100);
}, launchedFromTaskbar ? 0 : 100);
runnable.run();
}
- @SuppressWarnings("deprecation")
+ public static void startFreeformHack(Context context) {
+ startFreeformHack(context, false);
+ }
+
@TargetApi(Build.VERSION_CODES.N)
- public static void startFreeformHack(Context context, boolean checkMultiWindow, boolean launchedFromTaskbar) {
+ public static void startFreeformHack(Context context, boolean checkMultiWindow) {
Intent freeformHackIntent = new Intent(context, InvisibleActivityFreeform.class);
- freeformHackIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT);
+ freeformHackIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
+ | Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT
+ | Intent.FLAG_ACTIVITY_NO_ANIMATION);
if(checkMultiWindow)
freeformHackIntent.putExtra("check_multiwindow", true);
- if(launchedFromTaskbar) {
- SharedPreferences pref = getSharedPreferences(context);
- if(pref.getBoolean("disable_animations", false))
- freeformHackIntent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
- }
-
if(canDrawOverlays(context))
startActivityLowerRight(context, freeformHackIntent);
}
String componentName,
long userId,
String windowSize,
- boolean launchedFromTaskbar,
boolean openInNewWindow,
ShortcutInfo shortcut) {
SharedPreferences pref = getSharedPreferences(context);
&& Build.VERSION.SDK_INT <= Build.VERSION_CODES.N_MR1)
intent.addFlags(Intent.FLAG_ACTIVITY_TASK_ON_HOME);
- if(launchedFromTaskbar) {
- if(pref.getBoolean("disable_animations", false))
- intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
- }
+ if(pref.getBoolean("disable_animations", false))
+ intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
if(openInNewWindow || pref.getBoolean("force_new_window", false)) {
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);