mirror of
https://github.com/yuliskov/SmartTube.git
synced 2025-05-17 03:15:56 +08:00
screensaver fixes
This commit is contained in:
Submodule MediaServiceCore updated: f619b8b707...d584663f2b
Submodule SharedModules updated: 4d372f4a4b...acfbfd9b41
@ -49,6 +49,8 @@ allprojects {
|
||||
resolutionStrategy.force 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:' + kotlinVersion
|
||||
resolutionStrategy.force 'org.jetbrains.kotlin:kotlin-stdlib:' + kotlinVersion
|
||||
resolutionStrategy.force 'org.jetbrains.kotlinx:kotlinx-coroutines-android:' + kotlinxVersion
|
||||
resolutionStrategy.force 'androidx.core:core-ktx:' + kotlinCoreVersion
|
||||
resolutionStrategy.force 'androidx.core:core:' + coreXLibraryVersion
|
||||
resolutionStrategy.force 'androidx.annotation:annotation:' + annotationXLibraryVersion
|
||||
// Downgrade Cronet version for cronet-okhttp
|
||||
resolutionStrategy.force 'org.chromium.net:cronet-api:' + cronetApiVersion
|
||||
|
@ -26,10 +26,12 @@ public class ScreensaverManager {
|
||||
private static final int MODE_SCREENSAVER = 0;
|
||||
private static final int MODE_SCREEN_OFF = 1;
|
||||
private static final WeakHashSet<ScreensaverManager> sInstances = new WeakHashSet<>();
|
||||
private static boolean sLockInstance;
|
||||
private WeakReference<Activity> mActivity;
|
||||
private final WeakReference<View> mDimContainer;
|
||||
private final Runnable mDimScreen = this::dimScreen;
|
||||
private final Runnable mUndimScreen = this::undimScreen;
|
||||
private final Runnable mUnlockInstance = () -> sLockInstance = false;
|
||||
private final GeneralData mGeneralData;
|
||||
private PlayerTweaksData mTweaksData;
|
||||
private int mMode = MODE_SCREENSAVER;
|
||||
@ -217,7 +219,7 @@ public class ScreensaverManager {
|
||||
hidePlayerOverlay();
|
||||
}
|
||||
|
||||
notifyRegistry(show);
|
||||
notifyRegistry();
|
||||
}
|
||||
|
||||
private void showHideScreensaver(boolean show) {
|
||||
@ -292,15 +294,19 @@ public class ScreensaverManager {
|
||||
sInstances.add(this);
|
||||
}
|
||||
|
||||
private void notifyRegistry(boolean show) {
|
||||
if (!show) {
|
||||
private void notifyRegistry() {
|
||||
if (sLockInstance) {
|
||||
return;
|
||||
}
|
||||
|
||||
sLockInstance = true;
|
||||
|
||||
sInstances.forEach(item -> {
|
||||
if (item != this) {
|
||||
item.disableChecked();
|
||||
}
|
||||
});
|
||||
|
||||
Utils.postDelayed(mUnlockInstance, 0);
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ dependencies {
|
||||
|
||||
api 'androidx.activity:activity:' + leanbackXLibraryVersion // used inside other app modules
|
||||
implementation 'androidx.annotation:annotation:' + annotationXLibraryVersion
|
||||
implementation 'androidx.core:core:' + kotlinCoreVersion
|
||||
implementation 'androidx.core:core:' + coreXLibraryVersion
|
||||
implementation 'androidx.viewpager:viewpager:' + leanbackXLibraryVersion
|
||||
implementation 'androidx.loader:loader:' + leanbackXLibraryVersion
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
implementation 'androidx.annotation:annotation:' + annotationXLibraryVersion
|
||||
implementation 'androidx.core:core:' + kotlinCoreVersion
|
||||
implementation 'androidx.core:core:' + coreXLibraryVersion
|
||||
implementation 'androidx.recyclerview:recyclerview:' + recyclerviewXLibraryVersion
|
||||
implementation 'androidx.fragment:fragment:' + annotationXLibraryVersion
|
||||
implementation 'androidx.media:media:' + mediaXLibraryVersion
|
||||
|
@ -60,8 +60,8 @@ android {
|
||||
applicationId "com.liskovsoft.smarttubetv"
|
||||
minSdkVersion project.properties.minSdkVersion
|
||||
targetSdkVersion project.properties.targetSdkVersion
|
||||
versionCode 1384
|
||||
versionName "21.94"
|
||||
versionCode 1386
|
||||
versionName "21.96"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L"
|
||||
|
||||
|
Reference in New Issue
Block a user