From 981174a4904d81d929c44556b72126f18594a157 Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Sat, 9 Jun 2018 01:01:13 +0530 Subject: [PATCH 1/4] Fixed bug #640. --- .../java/org/schabi/newpipe/player/PopupVideoPlayer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java index 8107345a1..1a690dcfe 100644 --- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java @@ -662,7 +662,8 @@ public final class PopupVideoPlayer extends Service { videoPlayPause.setBackgroundResource(R.drawable.ic_pause_white); lockManager.acquireWifiAndCpu(); - hideControls(DEFAULT_CONTROLS_DURATION, DEFAULT_CONTROLS_HIDE_TIME); + windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON; + windowManager.updateViewLayout(playerImpl.getRootView(), windowLayoutParams); } @Override @@ -677,6 +678,9 @@ public final class PopupVideoPlayer extends Service { updateNotification(R.drawable.ic_play_arrow_white); videoPlayPause.setBackgroundResource(R.drawable.ic_play_arrow_white); lockManager.releaseWifiAndCpu(); + + windowLayoutParams.flags = 0; + windowManager.updateViewLayout(playerImpl.getRootView(), windowLayoutParams); } @Override From 429dddc6c970b7b583e051e5e1227a1b5cb9119e Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Sat, 9 Jun 2018 01:13:37 +0530 Subject: [PATCH 2/4] reintroduced hideControls method. --- app/src/debug/gen/org/schabi/newpipe/BuildConfig.java | 8 ++++++++ app/src/debug/gen/org/schabi/newpipe/Manifest.java | 7 +++++++ app/src/debug/gen/org/schabi/newpipe/R.java | 7 +++++++ app/src/main/gen/org/schabi/newpipe/BuildConfig.java | 8 ++++++++ app/src/main/gen/org/schabi/newpipe/Manifest.java | 7 +++++++ app/src/main/gen/org/schabi/newpipe/R.java | 7 +++++++ .../java/org/schabi/newpipe/player/PopupVideoPlayer.java | 2 ++ 7 files changed, 46 insertions(+) create mode 100644 app/src/debug/gen/org/schabi/newpipe/BuildConfig.java create mode 100644 app/src/debug/gen/org/schabi/newpipe/Manifest.java create mode 100644 app/src/debug/gen/org/schabi/newpipe/R.java create mode 100644 app/src/main/gen/org/schabi/newpipe/BuildConfig.java create mode 100644 app/src/main/gen/org/schabi/newpipe/Manifest.java create mode 100644 app/src/main/gen/org/schabi/newpipe/R.java diff --git a/app/src/debug/gen/org/schabi/newpipe/BuildConfig.java b/app/src/debug/gen/org/schabi/newpipe/BuildConfig.java new file mode 100644 index 000000000..575afb9cb --- /dev/null +++ b/app/src/debug/gen/org/schabi/newpipe/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package org.schabi.newpipe; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/app/src/debug/gen/org/schabi/newpipe/Manifest.java b/app/src/debug/gen/org/schabi/newpipe/Manifest.java new file mode 100644 index 000000000..10e45a45a --- /dev/null +++ b/app/src/debug/gen/org/schabi/newpipe/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package org.schabi.newpipe; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/app/src/debug/gen/org/schabi/newpipe/R.java b/app/src/debug/gen/org/schabi/newpipe/R.java new file mode 100644 index 000000000..088bdfb0d --- /dev/null +++ b/app/src/debug/gen/org/schabi/newpipe/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package org.schabi.newpipe; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/app/src/main/gen/org/schabi/newpipe/BuildConfig.java b/app/src/main/gen/org/schabi/newpipe/BuildConfig.java new file mode 100644 index 000000000..575afb9cb --- /dev/null +++ b/app/src/main/gen/org/schabi/newpipe/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package org.schabi.newpipe; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/app/src/main/gen/org/schabi/newpipe/Manifest.java b/app/src/main/gen/org/schabi/newpipe/Manifest.java new file mode 100644 index 000000000..10e45a45a --- /dev/null +++ b/app/src/main/gen/org/schabi/newpipe/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package org.schabi.newpipe; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/app/src/main/gen/org/schabi/newpipe/R.java b/app/src/main/gen/org/schabi/newpipe/R.java new file mode 100644 index 000000000..088bdfb0d --- /dev/null +++ b/app/src/main/gen/org/schabi/newpipe/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package org.schabi.newpipe; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java index 1a690dcfe..6eb339ffe 100644 --- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java @@ -662,6 +662,8 @@ public final class PopupVideoPlayer extends Service { videoPlayPause.setBackgroundResource(R.drawable.ic_pause_white); lockManager.acquireWifiAndCpu(); + hideControls(DEFAULT_CONTROLS_DURATION, DEFAULT_CONTROLS_HIDE_TIME); + windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON; windowManager.updateViewLayout(playerImpl.getRootView(), windowLayoutParams); } From 89e3219e06adb7266d15a6824a0d9b781cc27446 Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Sat, 9 Jun 2018 01:38:57 +0530 Subject: [PATCH 3/4] Further fixes wrt FLAG_NOT_FOCUSABLE. --- .../java/org/schabi/newpipe/player/PopupVideoPlayer.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java index 6eb339ffe..3aa8d68f3 100644 --- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java @@ -664,7 +664,8 @@ public final class PopupVideoPlayer extends Service { hideControls(DEFAULT_CONTROLS_DURATION, DEFAULT_CONTROLS_HIDE_TIME); - windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON; + windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON + | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; windowManager.updateViewLayout(playerImpl.getRootView(), windowLayoutParams); } @@ -681,7 +682,7 @@ public final class PopupVideoPlayer extends Service { videoPlayPause.setBackgroundResource(R.drawable.ic_play_arrow_white); lockManager.releaseWifiAndCpu(); - windowLayoutParams.flags = 0; + windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; windowManager.updateViewLayout(playerImpl.getRootView(), windowLayoutParams); } @@ -698,6 +699,9 @@ public final class PopupVideoPlayer extends Service { updateNotification(R.drawable.ic_replay_white); videoPlayPause.setBackgroundResource(R.drawable.ic_replay_white); lockManager.releaseWifiAndCpu(); + + windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; + windowManager.updateViewLayout(playerImpl.getRootView(), windowLayoutParams); } @Override From 8e96b675fa3d7b6705c30c9ccc80b340962f6ed4 Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Tue, 26 Jun 2018 01:13:21 +0530 Subject: [PATCH 4/4] Removed unwanted files. --- app/src/debug/gen/org/schabi/newpipe/BuildConfig.java | 8 -------- app/src/debug/gen/org/schabi/newpipe/Manifest.java | 7 ------- app/src/debug/gen/org/schabi/newpipe/R.java | 7 ------- app/src/main/gen/org/schabi/newpipe/BuildConfig.java | 8 -------- app/src/main/gen/org/schabi/newpipe/Manifest.java | 7 ------- app/src/main/gen/org/schabi/newpipe/R.java | 7 ------- 6 files changed, 44 deletions(-) delete mode 100644 app/src/debug/gen/org/schabi/newpipe/BuildConfig.java delete mode 100644 app/src/debug/gen/org/schabi/newpipe/Manifest.java delete mode 100644 app/src/debug/gen/org/schabi/newpipe/R.java delete mode 100644 app/src/main/gen/org/schabi/newpipe/BuildConfig.java delete mode 100644 app/src/main/gen/org/schabi/newpipe/Manifest.java delete mode 100644 app/src/main/gen/org/schabi/newpipe/R.java diff --git a/app/src/debug/gen/org/schabi/newpipe/BuildConfig.java b/app/src/debug/gen/org/schabi/newpipe/BuildConfig.java deleted file mode 100644 index 575afb9cb..000000000 --- a/app/src/debug/gen/org/schabi/newpipe/BuildConfig.java +++ /dev/null @@ -1,8 +0,0 @@ -/*___Generated_by_IDEA___*/ - -package org.schabi.newpipe; - -/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ -public final class BuildConfig { - public final static boolean DEBUG = Boolean.parseBoolean(null); -} \ No newline at end of file diff --git a/app/src/debug/gen/org/schabi/newpipe/Manifest.java b/app/src/debug/gen/org/schabi/newpipe/Manifest.java deleted file mode 100644 index 10e45a45a..000000000 --- a/app/src/debug/gen/org/schabi/newpipe/Manifest.java +++ /dev/null @@ -1,7 +0,0 @@ -/*___Generated_by_IDEA___*/ - -package org.schabi.newpipe; - -/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ -public final class Manifest { -} \ No newline at end of file diff --git a/app/src/debug/gen/org/schabi/newpipe/R.java b/app/src/debug/gen/org/schabi/newpipe/R.java deleted file mode 100644 index 088bdfb0d..000000000 --- a/app/src/debug/gen/org/schabi/newpipe/R.java +++ /dev/null @@ -1,7 +0,0 @@ -/*___Generated_by_IDEA___*/ - -package org.schabi.newpipe; - -/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ -public final class R { -} \ No newline at end of file diff --git a/app/src/main/gen/org/schabi/newpipe/BuildConfig.java b/app/src/main/gen/org/schabi/newpipe/BuildConfig.java deleted file mode 100644 index 575afb9cb..000000000 --- a/app/src/main/gen/org/schabi/newpipe/BuildConfig.java +++ /dev/null @@ -1,8 +0,0 @@ -/*___Generated_by_IDEA___*/ - -package org.schabi.newpipe; - -/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ -public final class BuildConfig { - public final static boolean DEBUG = Boolean.parseBoolean(null); -} \ No newline at end of file diff --git a/app/src/main/gen/org/schabi/newpipe/Manifest.java b/app/src/main/gen/org/schabi/newpipe/Manifest.java deleted file mode 100644 index 10e45a45a..000000000 --- a/app/src/main/gen/org/schabi/newpipe/Manifest.java +++ /dev/null @@ -1,7 +0,0 @@ -/*___Generated_by_IDEA___*/ - -package org.schabi.newpipe; - -/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ -public final class Manifest { -} \ No newline at end of file diff --git a/app/src/main/gen/org/schabi/newpipe/R.java b/app/src/main/gen/org/schabi/newpipe/R.java deleted file mode 100644 index 088bdfb0d..000000000 --- a/app/src/main/gen/org/schabi/newpipe/R.java +++ /dev/null @@ -1,7 +0,0 @@ -/*___Generated_by_IDEA___*/ - -package org.schabi.newpipe; - -/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ -public final class R { -} \ No newline at end of file