-
Notifications
You must be signed in to change notification settings - Fork 895
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2201 from quran/fix_rtl_back_button
- Loading branch information
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
...e/src/main/java/com/quran/labs/androidquran/common/ui/core/modifier/AutoMirrorModifier.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.quran.labs.androidquran.common.ui.core.modifier | ||
|
||
import androidx.compose.runtime.Stable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.composed | ||
import androidx.compose.ui.draw.scale | ||
import androidx.compose.ui.platform.LocalLayoutDirection | ||
import androidx.compose.ui.unit.LayoutDirection | ||
|
||
// via https://stackoverflow.com/questions/69849631/auto-mirroring-in-jetpack-compose-icons | ||
@Stable | ||
fun Modifier.autoMirror(): Modifier = composed { | ||
if (LocalLayoutDirection.current == LayoutDirection.Rtl) { | ||
this.scale(scaleX = -1f, scaleY = 1f) | ||
} else { this } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters