优化LogActivity分屏模式支持Android 11适配
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Sat Apr 25 10:20:05 CST 2026
|
||||
#Mon Apr 27 18:32:35 CST 2026
|
||||
stageCount=20
|
||||
libraryProject=libappbase
|
||||
baseVersion=15.15
|
||||
publishVersion=15.15.19
|
||||
buildCount=2
|
||||
buildCount=17
|
||||
baseBetaVersion=15.15.20
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Sat Apr 25 10:20:05 CST 2026
|
||||
#Mon Apr 27 18:32:35 CST 2026
|
||||
stageCount=20
|
||||
libraryProject=libappbase
|
||||
baseVersion=15.15
|
||||
publishVersion=15.15.19
|
||||
buildCount=2
|
||||
buildCount=17
|
||||
baseBetaVersion=15.15.20
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package cc.winboll.studio.libappbase;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityOptions;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import cc.winboll.studio.libappbase.LogView;
|
||||
import cc.winboll.studio.libappbase.R;
|
||||
@@ -58,16 +61,28 @@ public class LogActivity extends Activity {
|
||||
Intent intent = new Intent(context, LogActivity.class);
|
||||
|
||||
if (newTask) {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
context.startActivity(intent);
|
||||
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
Rect bounds = new Rect();
|
||||
if (context instanceof Activity) {
|
||||
Activity activity = (Activity) context;
|
||||
activity.getWindow().getDecorView().getDisplay().getRectSize(bounds);
|
||||
bounds.set(0, bounds.height() / 2, bounds.width(), bounds.height());
|
||||
}
|
||||
ActivityOptions options = ActivityOptions.makeBasic();
|
||||
options.setLaunchBounds(bounds);
|
||||
context.startActivity(intent, options.toBundle());
|
||||
} else {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
context.startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user