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