Skip to content

Commit

Permalink
fix: update dates icons + minor code refactoring (openedx#212)
Browse files Browse the repository at this point in the history
fix: update dates icons + minor code refactoring

- Update icons for some dateTypes
- update textStyle for dates
- corrected some strings keys according to module
  • Loading branch information
omerhabib26 authored Jan 30, 2024
1 parent 17400df commit 10ae954
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 62 deletions.
6 changes: 3 additions & 3 deletions core/src/main/res/drawable/core_ic_certificate.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:height="17dp"
android:viewportWidth="16"
android:viewportHeight="16">
android:viewportHeight="17">
<path
android:fillColor="#19212F"
android:pathData="M13.333,4.667H10V2.667C10,1.934 9.4,1.334 8.666,1.334H7.333C6.6,1.334 6,1.934 6,2.667V4.667H2.666C1.933,4.667 1.333,5.267 1.333,6.001V13.334C1.333,14.067 1.933,14.667 2.666,14.667H13.333C14.066,14.667 14.666,14.067 14.666,13.334V6.001C14.666,5.267 14.066,4.667 13.333,4.667ZM6,8.001C6.553,8.001 7,8.447 7,9.001C7,9.554 6.553,10.001 6,10.001C5.446,10.001 5,9.554 5,9.001C5,8.447 5.446,8.001 6,8.001ZM8,12.001H4V11.714C4,11.314 4.24,10.947 4.613,10.787C5.04,10.601 5.506,10.501 6,10.501C6.493,10.501 6.96,10.601 7.386,10.787C7.753,10.947 8,11.307 8,11.714V12.001ZM8.666,6.001H7.333V2.667H8.666V6.001ZM11.5,11.001H9.833C9.56,11.001 9.333,10.774 9.333,10.501C9.333,10.227 9.56,10.001 9.833,10.001H11.5C11.773,10.001 12,10.227 12,10.501C12,10.774 11.773,11.001 11.5,11.001ZM11.5,9.001H9.833C9.56,9.001 9.333,8.774 9.333,8.501C9.333,8.227 9.56,8.001 9.833,8.001H11.5C11.773,8.001 12,8.227 12,8.501C12,8.774 11.773,9.001 11.5,9.001Z" />
android:pathData="M15.334,8.578L13.707,6.718L13.934,4.258L11.527,3.711L10.267,1.578L8,2.551L5.734,1.578L4.474,3.705L2.067,4.245L2.294,6.711L0.667,8.578L2.294,10.438L2.067,12.905L4.474,13.451L5.734,15.578L8,14.598L10.267,15.571L11.527,13.445L13.934,12.898L13.707,10.438L15.334,8.578ZM6.254,11.252L4.667,9.651C4.407,9.391 4.407,8.971 4.667,8.711L4.714,8.665C4.974,8.405 5.4,8.405 5.66,8.665L6.734,9.745L10.167,6.305C10.427,6.045 10.854,6.045 11.114,6.305L11.16,6.351C11.42,6.611 11.42,7.031 11.16,7.291L7.214,11.252C6.94,11.512 6.52,11.512 6.254,11.252Z" />
</vector>
13 changes: 5 additions & 8 deletions core/src/main/res/drawable/core_ic_start_end.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="17dp"
android:width="16dp"
android:height="17dp"
android:viewportWidth="17"
android:viewportWidth="16"
android:viewportHeight="17">
<group>
<clip-path android:pathData="M0.854,0.803h16v16h-16z" />
<path
android:fillColor="#19212F"
android:pathData="M8.854,14.803L4.187,12.269V8.269L1.521,6.803L8.854,2.803L16.187,6.803V12.136H14.854V7.536L13.521,8.269V12.269L8.854,14.803ZM8.854,9.269L13.42,6.803L8.854,4.336L4.287,6.803L8.854,9.269ZM8.854,13.286L12.187,11.486V8.969L8.854,10.803L5.521,8.969V11.486L8.854,13.286Z" />
</group>
<path
android:fillColor="#19212F"
android:pathData="M2.97,9.362V11.235C2.97,11.722 3.236,12.175 3.663,12.408L6.996,14.228C7.396,14.448 7.876,14.448 8.276,14.228L11.61,12.408C12.036,12.175 12.303,11.722 12.303,11.235V9.362L8.276,11.562C7.876,11.782 7.396,11.782 6.996,11.562L2.97,9.362ZM6.996,2.922L1.376,5.988C0.916,6.242 0.916,6.908 1.376,7.162L6.996,10.228C7.396,10.448 7.876,10.448 8.276,10.228L13.636,7.302V11.242C13.636,11.608 13.936,11.908 14.303,11.908C14.67,11.908 14.97,11.608 14.97,11.242V6.968C14.97,6.722 14.836,6.502 14.623,6.382L8.276,2.922C7.876,2.708 7.396,2.708 6.996,2.922Z" />
</vector>
4 changes: 2 additions & 2 deletions core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
<string name="core_continue" tools:ignore="MissingTranslation">Continue</string>
<string name="core_leaving_the_app" tools:ignore="MissingTranslation">Leaving the app</string>
<string name="core_leaving_the_app_message" tools:ignore="MissingTranslation">You are now leaving the %s app and opening a browser.</string>
<string name="course_enrollment_error" tools:ignore="MissingTranslation">Enrollment Error</string>
<string name="course_enrollment_error_message" tools:ignore="MissingTranslation">We are unable to enroll you in this course at this time using the %s mobile application. Please try again on your web browser.</string>
<string name="core_enrollment_error" tools:ignore="MissingTranslation">Enrollment Error</string>
<string name="core_enrollment_error_message" tools:ignore="MissingTranslation">We are unable to enroll you in this course at this time using the %s mobile application. Please try again on your web browser.</string>


<!-- region: Course Date Sections -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,12 @@ import androidx.compose.ui.platform.ViewCompositionStrategy
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.pluralStringResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Devices
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.core.os.bundleOf
import androidx.fragment.app.Fragment
import org.koin.android.ext.android.inject
Expand Down Expand Up @@ -380,13 +377,8 @@ fun ExpandableView(
) {
Text(
text = stringResource(id = sectionKey.stringResId),
style = TextStyle(
fontSize = 16.sp,
lineHeight = 24.sp,
fontWeight = FontWeight.SemiBold,
color = MaterialTheme.appColors.textDark,
letterSpacing = 0.15.sp,
),
style = MaterialTheme.appTypography.titleMedium,
color = MaterialTheme.appColors.textDark,
modifier = Modifier.fillMaxWidth()
)

Expand All @@ -397,13 +389,8 @@ fun ExpandableView(
count = sectionDates.size,
formatArgs = arrayOf(sectionDates.size)
),
style = TextStyle(
fontSize = 12.sp,
lineHeight = 16.sp,
fontWeight = FontWeight.Normal,
color = MaterialTheme.appColors.textDark,
letterSpacing = 0.5.sp,
),
style = MaterialTheme.appTypography.labelMedium,
color = MaterialTheme.appColors.textDark,
modifier = Modifier
.fillMaxWidth()
)
Expand Down Expand Up @@ -454,13 +441,8 @@ private fun CourseDateBlockSection(
.fillMaxWidth()
.padding(top = 16.dp, bottom = 4.dp),
text = stringResource(id = sectionKey.stringResId),
style = TextStyle(
fontSize = 16.sp,
lineHeight = 24.sp,
fontWeight = FontWeight.SemiBold,
color = MaterialTheme.appColors.textDark,
letterSpacing = 0.15.sp,
)
color = MaterialTheme.appColors.textDark,
style = MaterialTheme.appTypography.titleMedium,
)
}
Row(
Expand Down Expand Up @@ -546,13 +528,8 @@ private fun CourseDateItem(
}
Text(
text = timeTitle,
style = TextStyle(
fontSize = 12.sp,
lineHeight = 16.sp,
fontWeight = FontWeight.Normal,
color = MaterialTheme.appColors.textDark,
letterSpacing = 0.5.sp,
),
style = MaterialTheme.appTypography.labelMedium,
color = MaterialTheme.appColors.textDark,
maxLines = 1,
)
}
Expand Down Expand Up @@ -583,13 +560,8 @@ private fun CourseDateItem(
} else {
dateBlock.title
},
style = TextStyle(
fontSize = 16.sp,
lineHeight = 24.sp,
fontWeight = FontWeight.SemiBold,
color = MaterialTheme.appColors.textDark,
letterSpacing = 0.15.sp,
),
style = MaterialTheme.appTypography.titleMedium,
color = MaterialTheme.appColors.textDark,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
Expand All @@ -612,13 +584,7 @@ private fun CourseDateItem(
.fillMaxWidth()
.padding(top = 4.dp),
text = dateBlock.description,
style = TextStyle(
fontSize = 11.sp,
lineHeight = 16.sp,
fontWeight = FontWeight.Normal,
color = MaterialTheme.appColors.textPrimaryVariant,
letterSpacing = 0.5.sp,
),
style = MaterialTheme.appTypography.labelMedium,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ class CourseInfoFragment : Fragment() {
LaunchedEffect(showAlert) {
if (showAlert) {
InfoDialogFragment.newInstance(
title = context.getString(CoreR.string.course_enrollment_error),
title = context.getString(CoreR.string.core_enrollment_error),
message = context.getString(
CoreR.string.course_enrollment_error_message,
CoreR.string.core_enrollment_error_message,
getString(CoreR.string.platform_name)
)
).show(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ class ProgramFragment(private val myPrograms: Boolean = false) : Fragment() {
context.toastMessage(getString(R.string.dashboard_enrolled_successfully))
} else {
InfoDialogFragment.newInstance(
title = getString(coreR.string.course_enrollment_error),
message = getString(coreR.string.course_enrollment_error_message)
title = getString(coreR.string.core_enrollment_error),
message = getString(coreR.string.core_enrollment_error_message)
).show(
requireActivity().supportFragmentManager,
InfoDialogFragment::class.simpleName
Expand Down

0 comments on commit 10ae954

Please sign in to comment.