mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-05-28 20:40:13 +02:00
fix(core): material resources hook
This commit is contained in:
parent
f9f7042c1e
commit
d239655f04
@ -326,13 +326,8 @@ class SnapEnhance {
|
||||
|
||||
Resources::class.java.getMethod("getString", Int::class.javaPrimitiveType).hook(HookStage.BEFORE) { param ->
|
||||
val key = param.arg<Int>(0)
|
||||
val name = stringResources[key] ?: return@hook
|
||||
// FIXME: prevent blank string in translations
|
||||
if (name == "date_range_input_title") {
|
||||
param.setResult("")
|
||||
return@hook
|
||||
}
|
||||
param.setResult(appContext.translation.getOrNull("material3_strings.$name") ?: return@hook)
|
||||
val name = stringResources[key]?.replaceFirst("m3c_", "") ?: return@hook
|
||||
param.setResult(appContext.translation.getOrNull("material3_strings.${name}") ?: "")
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user