fix reversed portrait not working

This commit is contained in:
Bnyro 2022-06-06 18:15:54 +02:00
parent f7f29c5f64
commit 60ea36c0db
3 changed files with 7 additions and 7 deletions

View File

@ -35,7 +35,7 @@
android:supportsPictureInPicture="true"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
android:hardwareAccelerated="true"
android:screenOrientation="portrait"
android:screenOrientation="userPortrait"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />

View File

@ -87,7 +87,7 @@ class MainActivity : AppCompatActivity() {
}
} else {
setContentView(R.layout.activity_main)
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
bottomNavigationView = findViewById(R.id.bottomNav)
navController = findNavController(R.id.fragment)
@ -266,7 +266,7 @@ class MainActivity : AppCompatActivity() {
findViewById<ConstraintLayout>(R.id.main_container).isClickable = false
val motionLayout = findViewById<MotionLayout>(R.id.playerMotionLayout)
motionLayout.transitionToEnd()
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
with(motionLayout) {
getConstraintSet(R.id.start).constrainHeight(R.id.player, 0)
enableTransition(R.id.yt_transition, true)

View File

@ -209,7 +209,7 @@ class PlayerFragment : Fragment() {
view.findViewById<ImageView>(R.id.close_imageView).setOnClickListener {
motionLayout.transitionToEnd()
val mainActivity = activity as MainActivity
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
mainActivity.supportFragmentManager.beginTransaction()
.remove(this)
.commit()
@ -217,7 +217,7 @@ class PlayerFragment : Fragment() {
view.findViewById<ImageButton>(R.id.close_imageButton).setOnClickListener {
motionLayout.transitionToEnd()
val mainActivity = activity as MainActivity
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
mainActivity.supportFragmentManager.beginTransaction()
.remove(this)
.commit()
@ -289,7 +289,7 @@ class PlayerFragment : Fragment() {
view.findViewById<ConstraintLayout>(R.id.main_container).isClickable = false
view.findViewById<LinearLayout>(R.id.linLayout).visibility = View.VISIBLE
val mainActivity = activity as MainActivity
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
isFullScreen = false
}
}
@ -983,7 +983,7 @@ class PlayerFragment : Fragment() {
view?.findViewById<LinearLayout>(R.id.linLayout)?.visibility = View.GONE
view?.findViewById<FrameLayout>(R.id.top_bar)?.visibility = View.GONE
val mainActivity = activity as MainActivity
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
isFullScreen = false
} else {
with(motionLayout) {