diff --git a/app-common/src/main/java/im/angry/openeuicc/ui/NotificationsActivity.kt b/app-common/src/main/java/im/angry/openeuicc/ui/NotificationsActivity.kt index 31b7d7e..c2a1a0f 100644 --- a/app-common/src/main/java/im/angry/openeuicc/ui/NotificationsActivity.kt +++ b/app-common/src/main/java/im/angry/openeuicc/ui/NotificationsActivity.kt @@ -117,11 +117,14 @@ class NotificationsActivity: BaseEuiccAccessActivity(), OpenEuiccContextMarker { launchTask { notificationAdapter.notifications = euiccChannelManager.withEuiccChannel(logicalSlotId) { channel -> - val profiles = channel.lpa.profiles + val nameMap = buildMap { + for (profile in channel.lpa.profiles) { + put(profile.iccid, profile.displayName) + } + } channel.lpa.notifications.map { - val profile = profiles.find { p -> p.iccid == it.iccid } - LocalProfileNotificationWrapper(it, profile?.displayName ?: "???") + LocalProfileNotificationWrapper(it, nameMap[it.iccid] ?: "???") } } } @@ -136,6 +139,8 @@ class NotificationsActivity: BaseEuiccAccessActivity(), OpenEuiccContextMarker { inner class NotificationViewHolder(private val root: View): RecyclerView.ViewHolder(root), View.OnCreateContextMenuListener, OnMenuItemClickListener { private val address: TextView = root.requireViewById(R.id.notification_address) + private val sequenceNumber: TextView = + root.requireViewById(R.id.notification_sequence_number) private val profileName: TextView = root.requireViewById(R.id.notification_profile_name) private lateinit var notification: LocalProfileNotificationWrapper @@ -157,6 +162,7 @@ class NotificationsActivity: BaseEuiccAccessActivity(), OpenEuiccContextMarker { } } + private fun operationToLocalizedText(operation: LocalProfileNotification.Operation) = root.context.getText( when (operation) { @@ -170,6 +176,10 @@ class NotificationsActivity: BaseEuiccAccessActivity(), OpenEuiccContextMarker { notification = value address.text = value.inner.notificationAddress + sequenceNumber.text = root.context.getString( + R.string.profile_notification_sequence_number_format, + value.inner.seqNumber + ) profileName.text = Html.fromHtml( root.context.getString(R.string.profile_notification_name_format, operationToLocalizedText(value.inner.profileManagementOperation), diff --git a/app-common/src/main/res/layout/notification_item.xml b/app-common/src/main/res/layout/notification_item.xml index 6b7253c..5d56b3a 100644 --- a/app-common/src/main/res/layout/notification_item.xml +++ b/app-common/src/main/res/layout/notification_item.xml @@ -15,6 +15,15 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> + + 削除しました 有効化しました 無効化しました - <b>%1$s</b> %2$s (%3$s) 処理 削除 eUICC 情報 diff --git a/app-common/src/main/res/values/strings.xml b/app-common/src/main/res/values/strings.xml index d0813d2..bd89b25 100644 --- a/app-common/src/main/res/values/strings.xml +++ b/app-common/src/main/res/values/strings.xml @@ -103,7 +103,8 @@ Deleted Enabled Disabled - <b>%1$s</b> %2$s (%3$s) + <b>%1$s</b> %2$s (%3$s) + #%d Process Delete