Skip to content

Commit 10ae954

Browse files
authored
fix: update dates icons + minor code refactoring (#212)
fix: update dates icons + minor code refactoring - Update icons for some dateTypes - update textStyle for dates - corrected some strings keys according to module
1 parent 17400df commit 10ae954

File tree

6 files changed

+25
-62
lines changed

6 files changed

+25
-62
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<vector xmlns:android="http://schemas.android.com/apk/res/android"
22
android:width="16dp"
3-
android:height="16dp"
3+
android:height="17dp"
44
android:viewportWidth="16"
5-
android:viewportHeight="16">
5+
android:viewportHeight="17">
66
<path
77
android:fillColor="#19212F"
8-
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" />
8+
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" />
99
</vector>
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2-
android:width="17dp"
2+
android:width="16dp"
33
android:height="17dp"
4-
android:viewportWidth="17"
4+
android:viewportWidth="16"
55
android:viewportHeight="17">
6-
<group>
7-
<clip-path android:pathData="M0.854,0.803h16v16h-16z" />
8-
<path
9-
android:fillColor="#19212F"
10-
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" />
11-
</group>
6+
<path
7+
android:fillColor="#19212F"
8+
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" />
129
</vector>

core/src/main/res/values/strings.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@
7272
<string name="core_continue" tools:ignore="MissingTranslation">Continue</string>
7373
<string name="core_leaving_the_app" tools:ignore="MissingTranslation">Leaving the app</string>
7474
<string name="core_leaving_the_app_message" tools:ignore="MissingTranslation">You are now leaving the %s app and opening a browser.</string>
75-
<string name="course_enrollment_error" tools:ignore="MissingTranslation">Enrollment Error</string>
76-
<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>
75+
<string name="core_enrollment_error" tools:ignore="MissingTranslation">Enrollment Error</string>
76+
<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>
7777

7878

7979
<!-- region: Course Date Sections -->

course/src/main/java/org/openedx/course/presentation/dates/CourseDatesFragment.kt

Lines changed: 11 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,12 @@ import androidx.compose.ui.platform.ViewCompositionStrategy
6363
import androidx.compose.ui.res.painterResource
6464
import androidx.compose.ui.res.pluralStringResource
6565
import androidx.compose.ui.res.stringResource
66-
import androidx.compose.ui.text.TextStyle
67-
import androidx.compose.ui.text.font.FontWeight
6866
import androidx.compose.ui.text.style.TextAlign
6967
import androidx.compose.ui.text.style.TextOverflow
7068
import androidx.compose.ui.tooling.preview.Devices
7169
import androidx.compose.ui.tooling.preview.Preview
7270
import androidx.compose.ui.unit.Dp
7371
import androidx.compose.ui.unit.dp
74-
import androidx.compose.ui.unit.sp
7572
import androidx.core.os.bundleOf
7673
import androidx.fragment.app.Fragment
7774
import org.koin.android.ext.android.inject
@@ -380,13 +377,8 @@ fun ExpandableView(
380377
) {
381378
Text(
382379
text = stringResource(id = sectionKey.stringResId),
383-
style = TextStyle(
384-
fontSize = 16.sp,
385-
lineHeight = 24.sp,
386-
fontWeight = FontWeight.SemiBold,
387-
color = MaterialTheme.appColors.textDark,
388-
letterSpacing = 0.15.sp,
389-
),
380+
style = MaterialTheme.appTypography.titleMedium,
381+
color = MaterialTheme.appColors.textDark,
390382
modifier = Modifier.fillMaxWidth()
391383
)
392384

@@ -397,13 +389,8 @@ fun ExpandableView(
397389
count = sectionDates.size,
398390
formatArgs = arrayOf(sectionDates.size)
399391
),
400-
style = TextStyle(
401-
fontSize = 12.sp,
402-
lineHeight = 16.sp,
403-
fontWeight = FontWeight.Normal,
404-
color = MaterialTheme.appColors.textDark,
405-
letterSpacing = 0.5.sp,
406-
),
392+
style = MaterialTheme.appTypography.labelMedium,
393+
color = MaterialTheme.appColors.textDark,
407394
modifier = Modifier
408395
.fillMaxWidth()
409396
)
@@ -454,13 +441,8 @@ private fun CourseDateBlockSection(
454441
.fillMaxWidth()
455442
.padding(top = 16.dp, bottom = 4.dp),
456443
text = stringResource(id = sectionKey.stringResId),
457-
style = TextStyle(
458-
fontSize = 16.sp,
459-
lineHeight = 24.sp,
460-
fontWeight = FontWeight.SemiBold,
461-
color = MaterialTheme.appColors.textDark,
462-
letterSpacing = 0.15.sp,
463-
)
444+
color = MaterialTheme.appColors.textDark,
445+
style = MaterialTheme.appTypography.titleMedium,
464446
)
465447
}
466448
Row(
@@ -546,13 +528,8 @@ private fun CourseDateItem(
546528
}
547529
Text(
548530
text = timeTitle,
549-
style = TextStyle(
550-
fontSize = 12.sp,
551-
lineHeight = 16.sp,
552-
fontWeight = FontWeight.Normal,
553-
color = MaterialTheme.appColors.textDark,
554-
letterSpacing = 0.5.sp,
555-
),
531+
style = MaterialTheme.appTypography.labelMedium,
532+
color = MaterialTheme.appColors.textDark,
556533
maxLines = 1,
557534
)
558535
}
@@ -583,13 +560,8 @@ private fun CourseDateItem(
583560
} else {
584561
dateBlock.title
585562
},
586-
style = TextStyle(
587-
fontSize = 16.sp,
588-
lineHeight = 24.sp,
589-
fontWeight = FontWeight.SemiBold,
590-
color = MaterialTheme.appColors.textDark,
591-
letterSpacing = 0.15.sp,
592-
),
563+
style = MaterialTheme.appTypography.titleMedium,
564+
color = MaterialTheme.appColors.textDark,
593565
maxLines = 1,
594566
overflow = TextOverflow.Ellipsis,
595567
)
@@ -612,13 +584,7 @@ private fun CourseDateItem(
612584
.fillMaxWidth()
613585
.padding(top = 4.dp),
614586
text = dateBlock.description,
615-
style = TextStyle(
616-
fontSize = 11.sp,
617-
lineHeight = 16.sp,
618-
fontWeight = FontWeight.Normal,
619-
color = MaterialTheme.appColors.textPrimaryVariant,
620-
letterSpacing = 0.5.sp,
621-
),
587+
style = MaterialTheme.appTypography.labelMedium,
622588
)
623589
}
624590
}

course/src/main/java/org/openedx/course/presentation/info/CourseInfoFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ class CourseInfoFragment : Fragment() {
8282
LaunchedEffect(showAlert) {
8383
if (showAlert) {
8484
InfoDialogFragment.newInstance(
85-
title = context.getString(CoreR.string.course_enrollment_error),
85+
title = context.getString(CoreR.string.core_enrollment_error),
8686
message = context.getString(
87-
CoreR.string.course_enrollment_error_message,
87+
CoreR.string.core_enrollment_error_message,
8888
getString(CoreR.string.platform_name)
8989
)
9090
).show(

dashboard/src/main/java/org/openedx/dashboard/presentation/program/ProgramFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ class ProgramFragment(private val myPrograms: Boolean = false) : Fragment() {
9999
context.toastMessage(getString(R.string.dashboard_enrolled_successfully))
100100
} else {
101101
InfoDialogFragment.newInstance(
102-
title = getString(coreR.string.course_enrollment_error),
103-
message = getString(coreR.string.course_enrollment_error_message)
102+
title = getString(coreR.string.core_enrollment_error),
103+
message = getString(coreR.string.core_enrollment_error_message)
104104
).show(
105105
requireActivity().supportFragmentManager,
106106
InfoDialogFragment::class.simpleName

0 commit comments

Comments
 (0)