Skip to content

Commit

Permalink
Fix incorrect toolbar position
Browse files Browse the repository at this point in the history
This patch fixes a regression introduced during the migration to support
edge to edge in 8d7f9f7. This isn't an
ideal fix, but it's the same as the code has been before. In the future,
we should remove the forced LTR on the root RelativeLayout and the
corresponding switch back to RTL of the toolbar.

Note that the marker isn't ideal for some ayat, but this was also the
case before the update, so it should be fixed separately in sha' Allah.

Fixes #2985.
  • Loading branch information
ahmedre committed Dec 3, 2024
1 parent 763d9b7 commit 3502fe3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,10 @@ class PagerActivity : AppCompatActivity(), AudioBarListener, OnBookmarkTagsUpdat
}

val toolbar = findViewById<Toolbar>(R.id.toolbar)
if (quranSettings.isArabicNames || QuranUtils.isRtl()) {
// remove when we remove LTR from quran_page_activity's root
ViewCompat.setLayoutDirection(toolbar, ViewCompat.LAYOUT_DIRECTION_RTL)
}
setSupportActionBar(toolbar)

supportActionBar?.setDisplayShowHomeEnabled(true)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/quran_page_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
android:layoutDirection="ltr"
>

<androidx.viewpager.widget.NonRestoringViewPager
Expand Down

0 comments on commit 3502fe3

Please sign in to comment.