diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b00e56d71..796be4754 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -122,6 +122,10 @@ android:name=".activities.PhotoVideoActivity" android:configChanges="orientation|keyboardHidden|screenSize"/> + + + val isFullscreen = visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0 + mFragment?.fullscreenToggled(isFullscreen) + } + } + + override fun onCreateOptionsMenu(menu: Menu): Boolean { + menuInflater.inflate(R.menu.menu_video_player, menu) + return true + } + + override fun onOptionsItemSelected(item: MenuItem): Boolean { + if (mMedium == null || mUri == null) { + return true + } + + when (item.itemId) { + R.id.menu_force_portrait -> forceOrientation(true) + R.id.menu_force_landscape -> forceOrientation(false) + else -> return super.onOptionsItemSelected(item) + } + return true + } + + private fun forceOrientation(portrait: Boolean) { + + } + + override fun fragmentClicked() { + mIsFullScreen = !mIsFullScreen + if (mIsFullScreen) { + hideSystemUI(true) + } else { + showSystemUI(true) + } + + val newAlpha = if (mIsFullScreen) 0f else 1f + top_shadow.animate().alpha(newAlpha).start() + } + + override fun videoEnded() = false + + override fun goToPrevItem() {} + + override fun goToNextItem() {} +} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt index 9c96ec30e..882a086cf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt @@ -129,10 +129,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View setupRotation() invalidateOptionsMenu() - if (config.blackBackground) { - updateStatusbarColor(Color.BLACK) - } - supportActionBar?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT)) window.statusBarColor = Color.TRANSPARENT } diff --git a/app/src/main/res/layout/activity_video_player.xml b/app/src/main/res/layout/activity_video_player.xml new file mode 100644 index 000000000..8b5d7507e --- /dev/null +++ b/app/src/main/res/layout/activity_video_player.xml @@ -0,0 +1,19 @@ + + + + + + + + diff --git a/app/src/main/res/menu/menu_video_player.xml b/app/src/main/res/menu/menu_video_player.xml new file mode 100644 index 000000000..38daa699e --- /dev/null +++ b/app/src/main/res/menu/menu_video_player.xml @@ -0,0 +1,23 @@ + + + + + + +