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