File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
textoverlay/src/main/java/saschpe/android/textoverlay/service Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -92,10 +92,17 @@ public void onCreate() {
92
92
textView .setTextColor (ContextCompat .getColor (this , colorId ));
93
93
textView .setText (lastUsedOverlayText );
94
94
95
+ int type ;
96
+ if (android .os .Build .VERSION .SDK_INT >= android .os .Build .VERSION_CODES .O ) {
97
+ type = WindowManager .LayoutParams .TYPE_APPLICATION_OVERLAY ;
98
+ } else {
99
+ type = WindowManager .LayoutParams .TYPE_SYSTEM_OVERLAY ;
100
+ }
101
+
95
102
WindowManager .LayoutParams params = new WindowManager .LayoutParams (
96
103
WindowManager .LayoutParams .WRAP_CONTENT ,
97
104
WindowManager .LayoutParams .WRAP_CONTENT ,
98
- WindowManager . LayoutParams . TYPE_SYSTEM_OVERLAY ,
105
+ type ,
99
106
WindowManager .LayoutParams .FLAG_NOT_FOCUSABLE |
100
107
WindowManager .LayoutParams .FLAG_NOT_TOUCHABLE ,
101
108
PixelFormat .TRANSLUCENT );
You can’t perform that action at this time.
0 commit comments