Adapt the style of the image activity to the rest of the application

This commit is contained in:
davidoskky 2023-01-25 01:54:35 +01:00
parent ae927ebc57
commit cef3b2e593
4 changed files with 9 additions and 7 deletions

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>