Skip to content
This repository has been archived by the owner on Dec 31, 2024. It is now read-only.

Commit

Permalink
Android 8未満で。TYPE_SYSTEM_OVERLAY だとタッチイベントを受け取れない。あとFLAG_WATCH_OUTSID…
Browse files Browse the repository at this point in the history
…E_TOUCHは不要なのでFLAG_NOT_TOUCH_MODAL に置き換える。
  • Loading branch information
tateisu committed Dec 24, 2019
1 parent ede52aa commit 1e27752
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/src/main/java/jp/juggler/screenshotbutton/MyService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,17 @@ class MyService : Service(), CoroutineScope, View.OnClickListener, View.OnTouchL
btnCamera.setOnTouchListener(this)

layoutParam = WindowManager.LayoutParams(
0, // 後で上書きされる
0, // 後で上書きする。 loadButtonPosition()
0,
if (Build.VERSION.SDK_INT >= API_APPLICATION_OVERLAY) {
WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY
} else {
@Suppress("DEPRECATION")
WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY
WindowManager.LayoutParams.TYPE_SYSTEM_ALERT
},
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or
WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH or
// WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH or
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL or
WindowManager.LayoutParams.FLAG_FULLSCREEN,
PixelFormat.TRANSLUCENT
).apply {
Expand Down

0 comments on commit 1e27752

Please sign in to comment.