Skip to content

Commit

Permalink
fix: rtl support
Browse files Browse the repository at this point in the history
  • Loading branch information
PavloNetrebchuk committed Feb 13, 2025
1 parent 861e426 commit db04327
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 94 deletions.
4 changes: 2 additions & 2 deletions auth/src/main/java/org/openedx/auth/presentation/ui/AuthUI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import androidx.compose.material.OutlinedTextField
import androidx.compose.material.Text
import androidx.compose.material.TextFieldDefaults
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ChevronRight
import androidx.compose.material.icons.automirrored.filled.KeyboardArrowRight
import androidx.compose.material.icons.filled.ExpandMore
import androidx.compose.material.icons.filled.Visibility
import androidx.compose.material.icons.filled.VisibilityOff
Expand Down Expand Up @@ -524,7 +524,7 @@ fun ExpandableText(
} else {
stringResource(id = R.string.auth_show_optional_fields)
}
val icon = Icons.Filled.ChevronRight
val icon = Icons.AutoMirrored.Filled.KeyboardArrowRight

Row(
modifier = modifier
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/java/org/openedx/core/ui/ComposeCommon.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import androidx.compose.material.ScaffoldState
import androidx.compose.material.Text
import androidx.compose.material.TextFieldDefaults
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.filled.AccountCircle
import androidx.compose.material.icons.filled.Close
import androidx.compose.material.icons.filled.Info
Expand Down Expand Up @@ -1163,7 +1164,7 @@ fun BackBtn(
}
) {
Icon(
painter = painterResource(id = R.drawable.core_ic_back),
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = stringResource(id = R.string.core_accessibility_btn_back),
tint = tint
)
Expand Down
31 changes: 0 additions & 31 deletions core/src/main/res/drawable/core_ic_back.xml

This file was deleted.

31 changes: 0 additions & 31 deletions core/src/main/res/drawable/core_ic_forward.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ import androidx.compose.material.IconButton
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowForward
import androidx.compose.material.icons.filled.ArrowDownward
import androidx.compose.material.icons.filled.Close
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.rotate
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.ViewCompositionStrategy
Expand Down Expand Up @@ -153,6 +154,11 @@ private fun ChapterEndDialogScreen(
onProceedButtonClick: () -> Unit,
onCancelButtonClick: () -> Unit
) {
val nextSectionButtonIcon = if (isVerticalNavigation) {
Icons.Default.ArrowDownward
} else {
Icons.AutoMirrored.Filled.ArrowForward
}
Card(
modifier = Modifier
.fillMaxWidth(fraction = 0.95f)
Expand Down Expand Up @@ -208,10 +214,9 @@ private fun ChapterEndDialogScreen(
content = {
TextIcon(
text = stringResource(id = R.string.course_next_section),
painter = painterResource(org.openedx.core.R.drawable.core_ic_forward),
icon = nextSectionButtonIcon,
color = MaterialTheme.appColors.primaryButtonText,
textStyle = MaterialTheme.appTypography.labelLarge,
iconModifier = Modifier.rotate(if (isVerticalNavigation) 90f else 0f)
)
},
onClick = onProceedButtonClick
Expand Down Expand Up @@ -324,7 +329,7 @@ private fun ChapterEndDialogScreenLandscape(
content = {
TextIcon(
text = stringResource(id = R.string.course_next_section),
painter = painterResource(org.openedx.core.R.drawable.core_ic_forward),
icon = Icons.AutoMirrored.Filled.ArrowForward,
color = MaterialTheme.appColors.primaryButtonText,
textStyle = MaterialTheme.appTypography.labelLarge
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import androidx.compose.material.MaterialTheme
import androidx.compose.material.Scaffold
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowForward
import androidx.compose.material.rememberScaffoldState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
Expand Down Expand Up @@ -75,7 +77,6 @@ import org.openedx.foundation.presentation.WindowSize
import org.openedx.foundation.presentation.WindowType
import org.openedx.foundation.presentation.windowSizeValue
import java.util.Date
import org.openedx.core.R as CoreR

@Composable
fun CourseOutlineScreen(
Expand Down Expand Up @@ -397,7 +398,7 @@ private fun ResumeCourse(
content = {
TextIcon(
text = stringResource(id = R.string.course_resume),
painter = painterResource(id = CoreR.drawable.core_ic_forward),
icon = Icons.AutoMirrored.Filled.ArrowForward,
color = MaterialTheme.appColors.primaryButtonText,
textStyle = MaterialTheme.appTypography.labelLarge
)
Expand Down Expand Up @@ -456,7 +457,7 @@ private fun ResumeCourseTablet(
content = {
TextIcon(
text = stringResource(id = R.string.course_resume),
painter = painterResource(id = CoreR.drawable.core_ic_forward),
icon = Icons.AutoMirrored.Filled.ArrowForward,
color = MaterialTheme.appColors.primaryButtonText,
textStyle = MaterialTheme.appTypography.labelLarge
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import androidx.compose.material.Snackbar
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ChevronRight
import androidx.compose.material.icons.automirrored.filled.KeyboardArrowRight
import androidx.compose.material.icons.filled.Close
import androidx.compose.material.icons.filled.CloudDone
import androidx.compose.material.icons.outlined.CloudDownload
Expand Down Expand Up @@ -305,7 +305,7 @@ fun CardArrow(
degrees: Float,
) {
Icon(
imageVector = Icons.Filled.ChevronRight,
imageVector = Icons.AutoMirrored.Filled.KeyboardArrowRight,
tint = MaterialTheme.appColors.textDark,
contentDescription = "Expandable Arrow",
modifier = Modifier.rotate(degrees),
Expand Down Expand Up @@ -822,7 +822,7 @@ fun CourseSubSectionItem(
Spacer(modifier = Modifier.width(16.dp))
if (isAssignmentEnable) {
Icon(
imageVector = Icons.Filled.ChevronRight,
imageVector = Icons.AutoMirrored.Filled.KeyboardArrowRight,
tint = MaterialTheme.appColors.onSurface,
contentDescription = null
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import androidx.compose.material.SwitchDefaults
import androidx.compose.material.Text
import androidx.compose.material.TextButton
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ChevronRight
import androidx.compose.material.icons.automirrored.filled.KeyboardArrowRight
import androidx.compose.material.icons.outlined.Settings
import androidx.compose.material.icons.outlined.Videocam
import androidx.compose.material.rememberScaffoldState
Expand Down Expand Up @@ -598,7 +598,7 @@ private fun AllVideosDownloadItem(
Icon(
modifier = Modifier
.padding(end = 16.dp),
imageVector = Icons.Filled.ChevronRight,
imageVector = Icons.AutoMirrored.Filled.KeyboardArrowRight,
tint = MaterialTheme.appColors.onSurface,
contentDescription = "Expandable Arrow"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ import androidx.compose.material.Scaffold
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowForwardIos
import androidx.compose.material.icons.filled.ChevronRight
import androidx.compose.material.icons.automirrored.filled.KeyboardArrowRight
import androidx.compose.material.icons.filled.School
import androidx.compose.material.icons.filled.Warning
import androidx.compose.material.pullrefresh.PullRefreshIndicator
Expand Down Expand Up @@ -347,7 +346,7 @@ private fun SecondaryCourses(
modifier = Modifier.padding(horizontal = 18.dp),
text = stringResource(R.string.dashboard_view_all_with_count, courses.size + 1),
textStyle = MaterialTheme.appTypography.titleSmall,
icon = Icons.Default.ChevronRight,
icon = Icons.AutoMirrored.Filled.KeyboardArrowRight,
color = MaterialTheme.appColors.textDark,
iconModifier = Modifier.size(22.dp),
onClick = onViewAllClick
Expand Down Expand Up @@ -512,8 +511,8 @@ private fun AssignmentItem(
}
}
Icon(
modifier = Modifier.size(16.dp),
imageVector = Icons.AutoMirrored.Filled.ArrowForwardIos,
modifier = Modifier.size(22.dp),
imageVector = Icons.AutoMirrored.Filled.KeyboardArrowRight,
tint = MaterialTheme.appColors.textDark,
contentDescription = null
)
Expand Down Expand Up @@ -690,8 +689,8 @@ private fun ResumeButton(
}
}
Icon(
modifier = Modifier.size(16.dp),
imageVector = Icons.AutoMirrored.Filled.ArrowForwardIos,
modifier = Modifier.size(22.dp),
imageVector = Icons.AutoMirrored.Filled.KeyboardArrowRight,
tint = MaterialTheme.appColors.primaryButtonText,
contentDescription = null
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.KeyboardArrowRight
import androidx.compose.material.icons.automirrored.outlined.HelpOutline
import androidx.compose.material.icons.filled.ChevronRight
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
Expand Down Expand Up @@ -661,7 +661,7 @@ fun TopicItem(
color = MaterialTheme.appColors.textPrimary
)
Icon(
imageVector = Icons.Filled.ChevronRight,
imageVector = Icons.AutoMirrored.Filled.KeyboardArrowRight,
tint = MaterialTheme.appColors.primary,
contentDescription = "Expandable Arrow"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowForwardIos
import androidx.compose.material.icons.automirrored.filled.KeyboardArrowRight
import androidx.compose.material.icons.automirrored.filled.OpenInNew
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
Expand All @@ -32,7 +32,7 @@ fun SettingsItem(
val icon = if (external) {
Icons.AutoMirrored.Filled.OpenInNew
} else {
Icons.AutoMirrored.Filled.ArrowForwardIos
Icons.AutoMirrored.Filled.KeyboardArrowRight
}
Row(
Modifier
Expand All @@ -57,7 +57,7 @@ fun SettingsItem(
color = MaterialTheme.appColors.textPrimary
)
Icon(
modifier = Modifier.size(16.dp),
modifier = Modifier.size(22.dp),
imageVector = icon,
contentDescription = null
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import androidx.compose.material.Switch
import androidx.compose.material.SwitchDefaults
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ChevronRight
import androidx.compose.material.icons.automirrored.filled.KeyboardArrowRight
import androidx.compose.material.rememberScaffoldState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
Expand Down Expand Up @@ -253,7 +253,7 @@ private fun VideoSettingsScreen(
)
}
Icon(
imageVector = Icons.Filled.ChevronRight,
imageVector = Icons.AutoMirrored.Filled.KeyboardArrowRight,
tint = MaterialTheme.appColors.onSurface,
contentDescription = stringResource(CoreR.string.core_accessibility_expandable_arrow)
)
Expand Down Expand Up @@ -284,7 +284,7 @@ private fun VideoSettingsScreen(
)
}
Icon(
imageVector = Icons.Filled.ChevronRight,
imageVector = Icons.AutoMirrored.Filled.KeyboardArrowRight,
tint = MaterialTheme.appColors.onSurface,
contentDescription = stringResource(CoreR.string.core_accessibility_expandable_arrow)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
import androidx.compose.material.OutlinedButton
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.automirrored.filled.ArrowForward
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
Expand Down Expand Up @@ -185,7 +188,7 @@ fun PrevButton(
horizontalArrangement = Arrangement.Center
) {
Icon(
painter = painterResource(id = org.openedx.core.R.drawable.core_ic_back),
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = null,
tint = MaterialTheme.appColors.primary
)
Expand Down Expand Up @@ -235,7 +238,7 @@ fun NextFinishButton(
)
Spacer(Modifier.width(8.dp))
Icon(
painter = painterResource(id = org.openedx.core.R.drawable.core_ic_forward),
imageVector = Icons.AutoMirrored.Filled.ArrowForward,
contentDescription = null,
tint = MaterialTheme.appColors.primaryButtonText
)
Expand Down

0 comments on commit db04327

Please sign in to comment.