bug fixes

This commit is contained in:
Bnyro 2022-09-09 16:49:00 +02:00
parent 462d247bd9
commit a4daa35d53
4 changed files with 14 additions and 5 deletions

View File

@ -33,7 +33,7 @@ class NoInternetActivity : BaseActivity() {
binding.downloads.setOnClickListener {
supportFragmentManager.beginTransaction()
.add(R.id.noInternet_container, DownloadsFragment())
.replace(R.id.noInternet_container, DownloadsFragment())
.addToBackStack(null)
.commit()
}
@ -44,6 +44,14 @@ class NoInternetActivity : BaseActivity() {
this,
object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() {
supportFragmentManager.fragments.forEach {
if (it is DownloadsFragment) {
supportFragmentManager.beginTransaction()
.remove(it)
.commit()
return
}
}
finishAffinity()
}
}

View File

@ -2,8 +2,7 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/colorBackground">
android:layout_height="match_parent">
<ImageView
android:id="@+id/noInternet_settingsImageView"
@ -16,6 +15,7 @@
android:src="@drawable/ic_settings" />
<LinearLayout
android:id="@+id/middle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
@ -61,7 +61,6 @@
android:id="@+id/noInternet_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:elevation="20dp"
android:paddingTop="10dp" />

View File

@ -2,6 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:orientation="horizontal"
android:paddingHorizontal="10dp"
android:paddingVertical="8dp">

View File

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="match_parent"
android:background="?android:attr/colorBackground">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/downloads"