mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-05-02 07:34:25 +02:00
Properly implemented all add and clear flags for staying awake.
This commit is contained in:
parent
bc83f9b274
commit
4517e3dde8
@ -176,8 +176,7 @@ class AutoUpdateDialog(context: Context?) : AlertDialog(context) {
|
|||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
onReceiveResult("Failed to download update.");
|
onReceiveResult("Failed to download update.");
|
||||||
}
|
}
|
||||||
}
|
} finally {
|
||||||
finally {
|
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
window?.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
window?.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||||
}
|
}
|
||||||
|
@ -200,6 +200,8 @@ class ImportDialog : AlertDialog {
|
|||||||
_uiResultBot.visibility = View.VISIBLE;
|
_uiResultBot.visibility = View.VISIBLE;
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
Logger.e(TAG, "Failed to update import UI.", e)
|
Logger.e(TAG, "Failed to update import UI.", e)
|
||||||
|
} finally {
|
||||||
|
window?.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
|
@ -213,6 +213,8 @@ class MigrateDialog : AlertDialog {
|
|||||||
_uiResultBot.visibility = View.VISIBLE;
|
_uiResultBot.visibility = View.VISIBLE;
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
Logger.e(TAG, "Failed to update import UI.", e)
|
Logger.e(TAG, "Failed to update import UI.", e)
|
||||||
|
} finally {
|
||||||
|
window?.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
|
@ -142,7 +142,6 @@ class VideoDetailFragment : MainFragment {
|
|||||||
}
|
}
|
||||||
override fun onHide() {
|
override fun onHide() {
|
||||||
super.onHide();
|
super.onHide();
|
||||||
activity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun preventPictureInPicture() {
|
fun preventPictureInPicture() {
|
||||||
@ -175,6 +174,7 @@ class VideoDetailFragment : MainFragment {
|
|||||||
_viewDetail?.onStop();
|
_viewDetail?.onStop();
|
||||||
close();
|
close();
|
||||||
|
|
||||||
|
activity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||||
StatePlayer.instance.clearQueue();
|
StatePlayer.instance.clearQueue();
|
||||||
StatePlayer.instance.setPlayerClosed();
|
StatePlayer.instance.setPlayerClosed();
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ import android.view.MotionEvent
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup.LayoutParams.MATCH_PARENT
|
import android.view.ViewGroup.LayoutParams.MATCH_PARENT
|
||||||
import android.view.ViewGroup.LayoutParams.WRAP_CONTENT
|
import android.view.ViewGroup.LayoutParams.WRAP_CONTENT
|
||||||
|
import android.view.WindowManager
|
||||||
import android.widget.*
|
import android.widget.*
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
Loading…
x
Reference in New Issue
Block a user