Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import io.redlink.more.app.android.R
import io.redlink.more.app.android.extensions.getStringResource
import io.redlink.more.app.android.extensions.getStringResourceByName
import io.redlink.more.app.android.extensions.observationTypeToResource
import io.redlink.more.app.android.extensions.stringResource
import io.redlink.more.app.android.shared_composables.HeaderDescription
import io.redlink.more.app.android.shared_composables.HeaderTitle
Expand Down Expand Up @@ -140,7 +142,7 @@ fun DashboardFilterView(coreScheduleViewModel: CoreScheduleViewModel) {
.padding(4.dp)
) {
HeaderDescription(
description = item.key,
description = getStringResourceByName(item.key.observationTypeToResource()),
color = if (item.value) MoreColors.Primary else MoreColors.Secondary
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import io.redlink.more.app.android.activities.tasks.ObservationActionButton
import io.redlink.more.app.android.extensions.getStringResource
import io.redlink.more.app.android.extensions.getStringResourceByName
import io.redlink.more.app.android.extensions.jvmLocalDateTime
import io.redlink.more.app.android.extensions.observationTypeToResource
import io.redlink.more.app.android.shared_composables.BasicText
import io.redlink.more.app.android.shared_composables.SmallTitle
import io.redlink.more.app.android.shared_composables.TimeframeHours
Expand Down Expand Up @@ -82,7 +83,7 @@ fun ScheduleListItem(
modifier = Modifier.fillMaxWidth()
) {
BasicText(
text = getStringResourceByName(scheduleModel().observationType.replace("-", "_")),
text = getStringResourceByName(scheduleModel().observationType.observationTypeToResource()),
color = MoreColors.Secondary
)
Row(horizontalArrangement = Arrangement.End) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import io.redlink.more.app.android.R
import io.redlink.more.app.android.extensions.formatNotificationFilterString
import io.redlink.more.app.android.extensions.getStringResource
import io.redlink.more.app.android.extensions.stringResource
import io.redlink.more.app.android.shared_composables.HeaderDescription
Expand Down Expand Up @@ -70,7 +71,7 @@ fun NotificationFilterView(coreViewModel: CoreNotificationFilterViewModel) {
.padding(4.dp)
) {
HeaderDescription(
description = entry.key.type,
description = entry.key.toString().formatNotificationFilterString(),
color = MoreColors.Secondary
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
*/
package io.redlink.more.app.android.extensions

import io.redlink.more.SharedRes
import io.redlink.more.app.android.R
import io.redlink.more.models.DateFilterModel
import io.redlink.more.models.NotificationFilterTypeModel

fun String.formatDateFilterString(): String {
return when (this) {
Expand All @@ -22,3 +24,11 @@ fun String.formatDateFilterString(): String {
}

}

fun String.formatNotificationFilterString(): String {
return when (this) {
NotificationFilterTypeModel.UNREAD.toString() -> sharedResource(SharedRes.strings.more_filter_notification_unread)
NotificationFilterTypeModel.IMPORTANT.toString() -> sharedResource(SharedRes.strings.more_filter_notification_important)
else -> sharedResource(SharedRes.strings.more_filter_notification_all)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ fun String.toAnnotatedString(): AnnotatedString {

return builder.toAnnotatedString()
}

// app-usage -> app_usage
fun String.observationTypeToResource(): String = this.replace("-", "_")
3 changes: 0 additions & 3 deletions androidApp/src/main/res/values-de/filter-strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,5 @@
<string name="more_filter_set_type">Typ auswählen</string>

<string name="more_select_filter">Filter auswählen</string>

<string name="more_filter_notification_all">Alle Nachrichten</string>
<string name="more_filter_notification_unread">Nicht gelesene Nachrichten anzeigen</string>
<string name="more_filter_notification_important">Wichtige Nachrichten anzeigen</string>
</resources>
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="more_notification_view_empty">Es gibt keine Nachrichten</string>

<string name="more_notification_view_table_header">Nachrichten</string>
<string name="more_notification_view_read_notifications">Gelesene Nachrichten</string>
<string name="more_notification_view_unread_notification">Ungelesene Nachrichten</string>

<string name="more_notification_view_show_unread">Ungelesene Nachrichten anzeigen</string>
<string name="current_filter">Alle Nachrichten</string>
<string name="more_logo">More Logo</string>
<string name="notification">Nchrichten</string>
<string name="no_notifications_yet">Die Nachrichtenliste ist derzeit leer!</string>
</resources>
3 changes: 0 additions & 3 deletions androidApp/src/main/res/values/filter-strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,5 @@
<string name="more_filter_set_type">Select Type</string>

<string name="more_select_filter">Select Filter</string>

<string name="more_filter_notification_all">All Notifications</string>
<string name="more_filter_notification_unread">Unread</string>
<string name="more_filter_notification_important">Important</string>
</resources>
7 changes: 0 additions & 7 deletions androidApp/src/main/res/values/notification-view-strings.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="more_notification_view_empty">No notifications to show</string>

<string name="more_notification_view_table_header">Notifications</string>
<string name="more_notification_view_read_notifications">Read Notifications</string>
<string name="more_notification_view_unread_notification">Unread Notification</string>

<string name="more_notification_view_show_unread">Show only unread notifications</string>
<string name="current_filter">All Notifications</string>
<string name="more_logo">More Logo</string>
<string name="notification">Notification</string>
<string name="no_notifications_yet">The notification list is currently empty!</string>
</resources>
Loading