NotificationsActivity: display channel name in toolbar
All checks were successful
/ build-debug (push) Successful in 4m29s
/ release (push) Successful in 4m37s

This commit is contained in:
Peter Cai 2024-07-21 08:38:31 -04:00
parent c84b114de0
commit b55df25650
3 changed files with 15 additions and 2 deletions

View file

@ -146,7 +146,7 @@ open class MainActivity : BaseEuiccAccessActivity(), OpenEuiccContextMarker {
// If USB readers exist, add them at the very last
// We use a wrapper fragment to handle logic specific to USB readers
usbDevice?.let {
pages.add(Page(it.productName ?: "USB") { UsbCcidReaderFragment() })
pages.add(Page(it.productName ?: getString(R.string.usb)) { UsbCcidReaderFragment() })
}
viewPager.visibility = View.VISIBLE

View file

@ -20,6 +20,7 @@ import androidx.recyclerview.widget.RecyclerView
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import im.angry.openeuicc.common.R
import im.angry.openeuicc.core.EuiccChannel
import im.angry.openeuicc.core.EuiccChannelManager
import im.angry.openeuicc.util.*
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
@ -53,6 +54,16 @@ class NotificationsActivity: BaseEuiccAccessActivity(), OpenEuiccContextMarker {
notificationList.adapter = notificationAdapter
registerForContextMenu(notificationList)
// This is slightly different from the MainActivity logic
// due to the length (we don't want to display the full USB product name)
val channelTitle = if (euiccChannel.logicalSlotId == EuiccChannelManager.USB_CHANNEL_ID) {
getString(R.string.usb)
} else {
getString(R.string.channel_name_format, euiccChannel.logicalSlotId)
}
title = getString(R.string.profile_notifications_detailed_format, channelTitle)
swipeRefresh.setOnRefreshListener {
refresh()
}

View file

@ -7,6 +7,7 @@
<string name="reload">Reload Slots</string>
<string name="channel_name_format">Logical Slot %d</string>
<string name="usb">USB</string>
<string name="enabled">Enabled</string>
<string name="disabled">Disabled</string>
@ -48,7 +49,8 @@
<string name="profile_delete_confirm">Are you sure you want to delete the profile %s? This operation is irreversible.</string>
<string name="profile_delete_confirm_input">Type \'%s\' here to confirm deletion</string>
<string name="profile_notifications">Profile Notifications</string>
<string name="profile_notifications">Notifications</string>
<string name="profile_notifications_detailed_format">Notifications (%s)</string>
<string name="profile_notifications_show">Manage Notifications</string>
<string name="profile_notifications_help">eSIM profiles can send notifications to the carrier when they are downloaded, deleted, enabled, or disabled. The queue of these notifications to be sent is listed here.\n\nIn Settings, you can specify whether to send each type of notification automatically. Note that even if a notification has been sent, it will not be deleted automatically from the record, unless the queue runs out of space.\n\nHere, you can manually send or delete each pending notification.</string>
<string name="profile_notification_operation_download">Downloaded</string>