在 MVP 模式中,我有动态值 % 的字符串
例子:
<string name="hello">%s hello</string>
我需要在我的文本视图上用“我的名字”设置这个文本,我将如何在没有引用的情况下在我的演示者层上直接引用 R.String。
public void onItemClicked(String name) {
if (mainView != null) {
//HOW use R.string.hello from Strings here? [presenter layer]
mainView.showMessage(String.format("%s hello", name));
}
}
在 MVP 模式中,我无法在演示者层中引用 Android 类,我在此类中没有任何上下文,但我需要使用 R.string.hello,因为翻译,我怎么能在没有这方面破坏这个 MVP 模式