Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save markus2120/82b6ea2d135ddd9f639cc559a8ef3ae4 to your computer and use it in GitHub Desktop.
Save markus2120/82b6ea2d135ddd9f639cc559a8ef3ae4 to your computer and use it in GitHub Desktop.
https://github.com/TeamNewPipe/NewPipe/ This patch disabled immersive mode and messing with brightness for newpipe
diff --git a/app/build.gradle b/app/build.gradle
index b507fd8..ec743ee 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -6,7 +6,7 @@ android {
defaultConfig {
applicationId "org.schabi.newpipe"
- minSdkVersion 15
+ minSdkVersion 21
targetSdkVersion 28
versionCode 69
versionName "0.14.2"
diff --git a/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java
index 07a9ac7..d89ac07 100644
--- a/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java
+++ b/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java
@@ -294,24 +294,13 @@ public final class MainVideoPlayer extends AppCompatActivity
}
getWindow().getDecorView().setSystemUiVisibility(visibility);
- getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
private void hideSystemUi() {
if (DEBUG) Log.d(TAG, "hideSystemUi() called");
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
- int visibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
- | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
- | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
- | View.SYSTEM_UI_FLAG_FULLSCREEN
- | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
- visibility |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
- }
- getWindow().getDecorView().setSystemUiVisibility(visibility);
- }
- getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
- WindowManager.LayoutParams.FLAG_FULLSCREEN);
+
+
+
}
private void toggleOrientation() {
@@ -499,7 +488,6 @@ public final class MainVideoPlayer extends AppCompatActivity
if (DEBUG) Log.d(TAG, "maxGestureLength = " + maxGestureLength);
volumeProgressBar.setMax(maxGestureLength);
- brightnessProgressBar.setMax(maxGestureLength);
setInitialGestureValues();
}
@@ -1065,31 +1053,6 @@ public final class MainVideoPlayer extends AppCompatActivity
if (playerImpl.getBrightnessRelativeLayout().getVisibility() == View.VISIBLE) {
playerImpl.getBrightnessRelativeLayout().setVisibility(View.GONE);
}
- } else if (isBrightnessGestureEnabled && acceptBrightnessArea) {
- playerImpl.getBrightnessProgressBar().incrementProgressBy((int) distanceY);
- float currentProgressPercent =
- (float) playerImpl.getBrightnessProgressBar().getProgress() / playerImpl.getMaxGestureLength();
- WindowManager.LayoutParams layoutParams = getWindow().getAttributes();
- layoutParams.screenBrightness = currentProgressPercent;
- getWindow().setAttributes(layoutParams);
-
- if (DEBUG) Log.d(TAG, "onScroll().brightnessControl, currentBrightness = " + currentProgressPercent);
-
- final int resId =
- currentProgressPercent < 0.25 ? R.drawable.ic_brightness_low_white_72dp
- : currentProgressPercent < 0.75 ? R.drawable.ic_brightness_medium_white_72dp
- : R.drawable.ic_brightness_high_white_72dp;
-
- playerImpl.getBrightnessImageView().setImageDrawable(
- AppCompatResources.getDrawable(getApplicationContext(), resId)
- );
-
- if (playerImpl.getBrightnessRelativeLayout().getVisibility() != View.VISIBLE) {
- animateView(playerImpl.getBrightnessRelativeLayout(), SCALE_AND_ALPHA, true, 200);
- }
- if (playerImpl.getVolumeRelativeLayout().getVisibility() == View.VISIBLE) {
- playerImpl.getVolumeRelativeLayout().setVisibility(View.GONE);
- }
}
return true;
}
diff --git a/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java b/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java
index 16dffc3..2fd3d1c 100644
--- a/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java
+++ b/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java
@@ -294,7 +294,8 @@ public class PlayerHelper {
}
public static void setScreenBrightness(@NonNull final Context context, final float setScreenBrightness) {
- setScreenBrightness(context, setScreenBrightness, System.currentTimeMillis());
+ // setScreenBrightness(context, setScreenBrightness, System.currentTimeMillis());
+ return;
}
////////////////////////////////////////////////////////////////////////////
diff --git a/app/src/main/java/org/schabi/newpipe/player/old/PlayVideoActivity.java b/app/src/main/java/org/schabi/newpipe/player/old/PlayVideoActivity.java
index 092f82a..978e776 100644
--- a/app/src/main/java/org/schabi/newpipe/player/old/PlayVideoActivity.java
+++ b/app/src/main/java/org/schabi/newpipe/player/old/PlayVideoActivity.java
@@ -289,8 +289,6 @@ public class PlayVideoActivity extends AppCompatActivity {
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
}
- getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
- WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
private void adjustMediaControlMetrics() {
diff --git a/build.gradle b/build.gradle
index a95f6dc..d8f9937 100644
--- a/build.gradle
+++ b/build.gradle
@@ -4,9 +4,10 @@ buildscript {
repositories {
jcenter()
google()
+
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.2.0'
+ classpath 'com.android.tools.build:gradle:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment