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"> + - + + -