Skip to content

Commit 899c829

Browse files
committed
Support Android 8.0
1 parent 6e2f988 commit 899c829

4 files changed

Lines changed: 17 additions & 13 deletions

File tree

activitytaskview/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ publish {
2121
}
2222

2323
android {
24-
compileSdkVersion 25
25-
buildToolsVersion "26.0.2"
24+
compileSdkVersion 28
25+
buildToolsVersion "26.0.3"
2626

2727
defaultConfig {
28-
minSdkVersion 14
28+
minSdkVersion 15
2929
versionCode 10
3030
versionName "3.8.0"
3131

@@ -38,5 +38,5 @@ android {
3838
}
3939

4040
dependencies {
41-
implementation 'com.android.support:appcompat-v7:25.2.0'
41+
implementation 'com.android.support:appcompat-v7:28.0.0'
4242
}

activitytaskview/src/main/java/cc/rome753/activitytask/ActivityTask.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ static void start(Application app) {
101101
private static void addViewToWindow(Application app, View view){
102102
WindowManager windowManager = (WindowManager) app.getSystemService(Context.WINDOW_SERVICE);
103103
WindowManager.LayoutParams params = new WindowManager.LayoutParams();
104-
params.type = WindowManager.LayoutParams.TYPE_PHONE;
104+
if (Build.VERSION.SDK_INT >= 26) {// Android 8.0
105+
params.type= WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
106+
}else {
107+
params.type = WindowManager.LayoutParams.TYPE_PHONE;
108+
}
105109
params.format = PixelFormat.RGBA_8888;
106110
params.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
107111
params.width = WindowManager.LayoutParams.WRAP_CONTENT;

app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 25
5-
buildToolsVersion "26.0.2"
4+
compileSdkVersion 28
5+
buildToolsVersion "26.0.3"
66
defaultConfig {
77
applicationId "cc.rome753.activitytask"
88
minSdkVersion 15
9-
targetSdkVersion 25
9+
targetSdkVersion 28
1010
versionCode 1
1111
versionName "1.0"
1212
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -27,7 +27,7 @@ dependencies {
2727
androidTestApi('com.android.support.test.espresso:espresso-core:2.2.2', {
2828
exclude group: 'com.android.support', module: 'support-annotations'
2929
})
30-
api 'com.android.support:appcompat-v7:25.2.0'
30+
api 'com.android.support:appcompat-v7:28.0.0'
3131
testApi 'junit:junit:4.12'
3232
api project(':activitytaskview')
3333
// api 'cc.rome753:activitytaskview:3.8.0'

singleinstancedemo/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 25
5-
buildToolsVersion "26.0.2"
4+
compileSdkVersion 28
5+
buildToolsVersion "26.0.3"
66
defaultConfig {
77
applicationId "cc.rome753.singleinstancedemo"
88
minSdkVersion 15
9-
targetSdkVersion 25
9+
targetSdkVersion 28
1010
versionCode 1
1111
versionName "1.0"
1212
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -27,7 +27,7 @@ dependencies {
2727
androidTestApi('com.android.support.test.espresso:espresso-core:2.2.2', {
2828
exclude group: 'com.android.support', module: 'support-annotations'
2929
})
30-
api 'com.android.support:appcompat-v7:25.2.0'
30+
api 'com.android.support:appcompat-v7:28.0.0'
3131
testApi 'junit:junit:4.12'
3232
api project(':activitytaskview')
3333
}

0 commit comments

Comments
 (0)