mirror of
https://github.com/gkd-kit/gkd.git
synced 2024-11-15 19:22:26 +08:00
perf: safe R
This commit is contained in:
parent
efa1829a39
commit
b1ae97f211
|
@ -1,14 +1,12 @@
|
|||
package li.songe.gkd.notif
|
||||
|
||||
import li.songe.gkd.R
|
||||
import li.songe.gkd.app
|
||||
import li.songe.gkd.util.SafeR
|
||||
|
||||
data class Notif(
|
||||
val id: Int,
|
||||
@Suppress("UNRESOLVED_REFERENCE")
|
||||
val smallIcon: Int = R.drawable.ic_status,
|
||||
@Suppress("UNRESOLVED_REFERENCE")
|
||||
val title: String = app.resources.getString(R.string.app_name),
|
||||
val smallIcon: Int = SafeR.ic_status,
|
||||
val title: String = app.getString(SafeR.app_name),
|
||||
val text: String,
|
||||
val ongoing: Boolean,
|
||||
val autoCancel: Boolean,
|
||||
|
|
12
app/src/main/kotlin/li/songe/gkd/util/SafeR.kt
Normal file
12
app/src/main/kotlin/li/songe/gkd/util/SafeR.kt
Normal file
|
@ -0,0 +1,12 @@
|
|||
package li.songe.gkd.util
|
||||
|
||||
import li.songe.gkd.R
|
||||
|
||||
/**
|
||||
* ![image](https://github.com/gkd-kit/gkd/assets/38517192/c9325110-d90f-4041-a01d-404d14c5d34d)
|
||||
*/
|
||||
@Suppress("UNRESOLVED_REFERENCE")
|
||||
object SafeR {
|
||||
val app_name: Int = R.string.app_name
|
||||
val ic_status: Int = R.drawable.ic_status
|
||||
}
|
Loading…
Reference in New Issue
Block a user