mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 07:50:31 +05:30
Fixed #2723 : Activity is recreated when entered from media notification.
This commit is contained in:
parent
9a926238c7
commit
015b414596
@ -72,6 +72,7 @@
|
||||
android:name=".ui.activities.MainActivity"
|
||||
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="user"
|
||||
android:supportsPictureInPicture="true"
|
||||
android:windowSoftInputMode="adjustPan">
|
||||
|
@ -189,16 +189,16 @@ class MainActivity : BaseActivity() {
|
||||
if (viewGroup == null || viewGroup.childCount == 0) return
|
||||
|
||||
viewGroup.children.forEach {
|
||||
(it as? ScrollView)?.let {
|
||||
it.smoothScrollTo(0, 0)
|
||||
(it as? ScrollView)?.let { scrollView ->
|
||||
scrollView.smoothScrollTo(0, 0)
|
||||
return
|
||||
}
|
||||
(it as? NestedScrollView)?.let {
|
||||
it.smoothScrollTo(0, 0)
|
||||
(it as? NestedScrollView)?.let { scrollView ->
|
||||
scrollView.smoothScrollTo(0, 0)
|
||||
return
|
||||
}
|
||||
(it as? RecyclerView)?.let {
|
||||
it.smoothScrollToPosition(0)
|
||||
(it as? RecyclerView)?.let { recyclerView ->
|
||||
recyclerView.smoothScrollToPosition(0)
|
||||
return
|
||||
}
|
||||
tryScrollToTop(it as? ViewGroup)
|
||||
@ -373,9 +373,9 @@ class MainActivity : BaseActivity() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N &&
|
||||
isInPictureInPictureMode
|
||||
) {
|
||||
moveTaskToBack(true)
|
||||
intent?.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT)
|
||||
startActivity(intent)
|
||||
val nIntent = Intent(this, MainActivity::class.java)
|
||||
nIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||
startActivity(nIntent)
|
||||
}
|
||||
|
||||
if (intent?.getBooleanExtra(IntentData.openAudioPlayer, false) == true) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user