Remove freeform launch part

This commit is contained in:
SerpentSpirale 2021-08-13 12:38:04 +02:00
parent 35a0b66ec1
commit cf0db09ea9

View File

@ -353,17 +353,8 @@ public class MinecraftDownloaderTask extends AsyncTask<String, String, Throwable
// mainIntent.addFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT);
mainIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
mainIntent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
if (LauncherPreferences.PREF_FREEFORM) {
DisplayMetrics dm = new DisplayMetrics();
mActivity.getWindowManager().getDefaultDisplay().getMetrics(dm);
mActivity.startActivity(mainIntent);
ActivityOptions options = (ActivityOptions) ActivityOptions.class.getMethod("makeBasic").invoke(null);
Rect freeformRect = new Rect(0, 0, dm.widthPixels / 2, dm.heightPixels / 2);
options.getClass().getDeclaredMethod("setLaunchBounds", Rect.class).invoke(options, freeformRect);
mActivity.startActivity(mainIntent, options.toBundle());
} else {
mActivity.startActivity(mainIntent);
}
}
catch (Throwable e) {
Tools.showError(mActivity, e);