File tree Expand file tree Collapse file tree 5 files changed +18
-6
lines changed
Examples/OneSignalDemo/app
src/main/java/com/onesignal/sdktest/activity
onesignal/src/main/java/com/onesignal Expand file tree Collapse file tree 5 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
2
2
apply plugin : ' com.android.application'
3
3
4
4
android {
5
- compileSdkVersion 28
5
+ compileSdkVersion 30
6
6
defaultConfig {
7
7
minSdkVersion 16
8
- targetSdkVersion 28
8
+ targetSdkVersion 30
9
9
versionCode 1
10
10
versionName " 1.0"
11
11
multiDexEnabled true
Original file line number Diff line number Diff line change 1
1
package com .onesignal .sdktest .activity ;
2
2
3
+ import android .os .Build ;
3
4
import android .os .Bundle ;
5
+ import android .view .WindowManager ;
4
6
5
7
import androidx .appcompat .app .AppCompatActivity ;
6
8
@@ -16,6 +18,10 @@ public class MainActivity extends AppCompatActivity {
16
18
protected void onCreate (Bundle savedInstanceState ) {
17
19
super .onCreate (savedInstanceState );
18
20
setContentView (R .layout .main_activity_layout );
21
+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .P ) {
22
+ //getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
23
+ getWindow ().getAttributes ().layoutInDisplayCutoutMode = WindowManager .LayoutParams .LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES ;
24
+ }
19
25
20
26
viewModel = new MainActivityViewModel ();
21
27
OneSignal .addPermissionObserver (viewModel );
Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ buildscript {
4
4
5
5
ext {
6
6
buildVersions = [
7
- compileSdkVersion : 29 ,
8
- targetSdkVersion : 28
7
+ compileSdkVersion : 30 ,
8
+ targetSdkVersion : 30
9
9
]
10
10
androidGradlePluginVersion = ' 3.6.2'
11
11
androidConcurrentFutures = ' 1.1.0'
Original file line number Diff line number Diff line change @@ -76,6 +76,9 @@ void available(@NonNull Activity currentActivity) {
76
76
}
77
77
78
78
static int [] getWindowInsets (@ NonNull Activity activity ) {
79
+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .P ) {
80
+
81
+ }
79
82
Rect frame = getWindowVisibleDisplayFrame (activity );
80
83
View contentView = activity .getWindow ().findViewById (Window .ID_ANDROID_CONTENT );
81
84
int topInset = frame .top - contentView .getTop ();
@@ -88,11 +91,12 @@ static int[] getWindowInsets(@NonNull Activity activity) {
88
91
Not using this method for now because the bottom value is not correct (we don't cover the bottom buttons)
89
92
*/
90
93
// Requirement: Ensure DecorView is ready by using OSViewUtils.decorViewReady
91
- @ TargetApi (Build .VERSION_CODES .M )
92
- private static int [] getWindowInsetsAPI23Plus (@ NonNull Activity activity ) {
94
+ @ TargetApi (Build .VERSION_CODES .P )
95
+ private static int [] getWindowInsetsAPI28Plus (@ NonNull Activity activity ) {
93
96
View decorView = activity .getWindow ().getDecorView ();
94
97
// Use use stable heights as SystemWindowInset subtracts the keyboard
95
98
WindowInsets windowInsets = decorView .getRootWindowInsets ();
99
+ //if windowInsets.getDisplayCutout().
96
100
return new int [] {windowInsets .getStableInsetTop (), windowInsets .getStableInsetBottom (),
97
101
windowInsets .getStableInsetRight (), windowInsets .getStableInsetLeft ()};
98
102
}
Original file line number Diff line number Diff line change 12
12
import android .util .Base64 ;
13
13
import android .view .View ;
14
14
import android .view .Window ;
15
+ import android .view .WindowInsets ;
16
+ import android .view .WindowManager ;
15
17
import android .webkit .JavascriptInterface ;
16
18
import android .webkit .ValueCallback ;
17
19
import android .webkit .WebView ;
You can’t perform that action at this time.
0 commit comments