diff --git a/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/reader/ReaderFragment.kt b/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/reader/ReaderFragment.kt
index aff1491e0..e544774a3 100644
--- a/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/reader/ReaderFragment.kt
+++ b/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/reader/ReaderFragment.kt
@@ -24,6 +24,7 @@ import android.os.Bundle
import android.util.Log
import android.view.Menu
import android.view.MenuInflater
+import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import androidx.core.net.toFile
import androidx.core.net.toUri
@@ -73,6 +74,15 @@ class ReaderFragment : CoreReaderFragment() {
}
}
+ override fun onPause() {
+ super.onPause()
+ // ScrollingViewWithBottomNavigationBehavior changes the margin to the size of the nav bar,
+ // this resets the margin to zero, before fragment navigation.
+ val params = parentFragment?.view?.layoutParams as ViewGroup.MarginLayoutParams?
+ params?.bottomMargin = 0
+ parentFragment?.view?.requestLayout()
+ }
+
override fun onCreateOptionsMenu(menu: Menu, menuInflater: MenuInflater) {
super.onCreateOptionsMenu(menu, menuInflater)
menu.findItem(R.id.menu_new_navigation)?.isVisible = false
diff --git a/app/src/main/res/layout/activity_new_navigation.xml b/app/src/main/res/layout/activity_new_navigation.xml
index 13fd44600..05089530f 100644
--- a/app/src/main/res/layout/activity_new_navigation.xml
+++ b/app/src/main/res/layout/activity_new_navigation.xml
@@ -33,10 +33,8 @@
android:name="org.kiwix.kiwixmobile.main.NavigationHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_gravity="bottom"
app:defaultNavHost="true"
app:layout_behavior=".nav.helper.ScrollingViewWithBottomNavigationBehavior"
- app:layout_dodgeInsetEdges="bottom"
app:navGraph="@navigation/kiwix_nav_graph"
tools:ignore="FragmentTagUsage" />
@@ -46,6 +44,7 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:layout_behavior="@string/hide_bottom_view_on_scroll_behavior"
+ app:layout_scrollFlags="scroll|enterAlways"
app:menu="@menu/menu_bottom_nav" />
diff --git a/app/src/main/res/layout/fragment_destination_download.xml b/app/src/main/res/layout/fragment_destination_download.xml
index ba33eae7e..bc2ae79f3 100644
--- a/app/src/main/res/layout/fragment_destination_download.xml
+++ b/app/src/main/res/layout/fragment_destination_download.xml
@@ -16,32 +16,31 @@
~
-->
-
+ android:layout_height="match_parent">
-
-
-
+ android:layout_height="match_parent"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent">
-
+
+
+
+
+ app:layout_behavior="@string/appbar_scrolling_view_behavior">
-
+
-
+
+
+
+
+
diff --git a/app/src/main/res/layout/fragment_destination_library.xml b/app/src/main/res/layout/fragment_destination_library.xml
index 8e15f2bc0..e30da2a82 100644
--- a/app/src/main/res/layout/fragment_destination_library.xml
+++ b/app/src/main/res/layout/fragment_destination_library.xml
@@ -16,52 +16,61 @@
~
-->
-
+ android:layout_height="match_parent">
-
-
-
+ android:layout_height="match_parent"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent">
+
-
+
+
-
+ android:layout_height="match_parent"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior">
+ android:layout_height="match_parent" />
+
-
-
+
+
+
+
+
+
diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreReaderFragment.java b/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreReaderFragment.java
index 55d0e3d96..9d5eef4f7 100644
--- a/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreReaderFragment.java
+++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreReaderFragment.java
@@ -871,7 +871,7 @@ public abstract class CoreReaderFragment extends BaseFragment
}
tabsAdapter.notifyItemRemoved(index);
tabsAdapter.notifyDataSetChanged();
- Snackbar.make(tabSwitcherRoot, R.string.tab_closed, Snackbar.LENGTH_LONG)
+ Snackbar.make(snackbarRoot, R.string.tab_closed, Snackbar.LENGTH_LONG)
.setAction(R.string.undo, v -> {
webViewList.add(index, tempForUndo);
tabsAdapter.notifyItemInserted(index);
diff --git a/core/src/main/res/layout/layout_scrolling_toolbar.xml b/core/src/main/res/layout/layout_scrolling_toolbar.xml
new file mode 100644
index 000000000..c512b1e3b
--- /dev/null
+++ b/core/src/main/res/layout/layout_scrolling_toolbar.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
diff --git a/core/src/main/res/layout/main_fragment_content.xml b/core/src/main/res/layout/main_fragment_content.xml
index e61e9a20f..9b0221395 100644
--- a/core/src/main/res/layout/main_fragment_content.xml
+++ b/core/src/main/res/layout/main_fragment_content.xml
@@ -34,13 +34,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
-
+
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toStartOf="parent"
+ app:layout_constraintStart_toStartOf="parent" />