Swipe down to close images #122

Merged
AmineB merged 10 commits from davidoskky/ReaderForSelfoss-multiplatform:swipe_down into master 2023-01-26 10:42:16 +00:00
4 changed files with 9 additions and 7 deletions
Showing only changes of commit cef3b2e593 - Show all commits

View File

@ -69,7 +69,8 @@
android:name=".ReaderActivity">
</activity>
<activity
android:name=".ImageActivity">
android:name=".ImageActivity"
android:theme="@style/Theme.AppCompat.Translucent">
</activity>
<meta-data android:name="android.webkit.WebView.MetricsOptOut"

View File

@ -24,7 +24,6 @@ class ImageActivity : AppCompatActivity() {
setContentView(view)
setSupportActionBar(binding.toolBar)
supportActionBar?.setDisplayShowTitleEnabled(false)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
allImages = intent.getStringArrayListExtra("allImages") as ArrayList<String>
@ -48,6 +47,7 @@ class ImageActivity : AppCompatActivity() {
override fun onTransitionCompleted(motionLayout: MotionLayout?, currentId: Int) {
if (motionLayout?.currentState == binding.root.endState) {
onBackPressedDispatcher.onBackPressed()
overridePendingTransition(0, 0)
}
}

View File

@ -9,12 +9,9 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
android:layout_height="wrap_content">
<androidx.appcompat.widget.Toolbar
<androidx.appcompat.widget.Toolbar android:theme="@style/ToolBarStyle"
android:id="@+id/toolBar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"

View File

@ -26,4 +26,8 @@
<item name="android:textColorSecondary">@color/white</item>
<item name="actionMenuTextColor">@color/white</item>
</style>
<style name="Theme.AppCompat.Translucent" parent="NoBar">
<item name="android:windowBackground">@android:color/transparent</item>
</style>
</resources>