我想从注释中生成字符串资源。
@StringKey("style1")
void applyStyle1(){...}
编译项目后:
<resources>
<!-- Automatically generated file. DO NOT MODIFY -->
<!-- Values from product flavor: prod -->
<string name="style1" translatable="false">style1</string>
</resources>
价值无关紧要
答案 0 :(得分:2)
你想要实现这样的目标吗?
@ViewById
EditText myEditText;
@ViewById(R.id.myTextView)
TextView textView;
@StringRes(R.string.hello)
String helloFormat; //helloFormat will have the value of R.string.hello at runtime
@ColorRes
int androidColor;
@BooleanRes
boolean someBoolean;
@SystemService
NotificationManager notificationManager;
@SystemService
WindowManager windowManager;