本文整理汇总了Java中de.mrapp.android.util.ThemeUtil.getText方法的典型用法代码示例。如果您正苦于以下问题:Java ThemeUtil.getText方法的具体用法?Java ThemeUtil.getText怎么用?Java ThemeUtil.getText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类de.mrapp.android.util.ThemeUtil
的用法示例。
在下文中一共展示了ThemeUtil.getText方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getText
import de.mrapp.android.util.ThemeUtil; //导入方法依赖的package包/类
/**
* Returns the text, which corresponds to a specific theme attribute, regarding the theme, which
* is used when using a specific layout.
*
* @param layout
* The layout as a value of the enum {@link Layout}. The layout may not be null
* @param resourceId
* The resource id of the theme attribute, the text should be obtained from, as an
* {@link Integer} value. The resource id must correspond to a valid theme attribute
* @return The text, which has been obtained, as an instance of the type {@link CharSequence}
*/
public CharSequence getText(@NonNull final Layout layout, @AttrRes final int resourceId) {
try {
return ThemeUtil.getText(context, resourceId);
} catch (NotFoundException e1) {
int themeResourceId = getThemeResourceId(layout);
try {
return ThemeUtil.getText(context, themeResourceId, resourceId);
} catch (NotFoundException e) {
themeResourceId = obtainThemeFromThemeAttributes(layout, themeResourceId);
return ThemeUtil.getText(context, themeResourceId, resourceId);
}
}
}
示例2: obtainRestoreDefaultsButtonText
import de.mrapp.android.util.ThemeUtil; //导入方法依赖的package包/类
/**
* Obtains the text of the button, which allows to restore the preferences' default values, from
* the activity's current theme.
*/
private void obtainRestoreDefaultsButtonText() {
CharSequence text;
try {
text = ThemeUtil.getText(getActivity(), R.attr.restoreDefaultsButtonText);
} catch (NotFoundException e) {
text = getText(R.string.restore_defaults_button_text);
}
setRestoreDefaultsButtonText(text);
}
示例3: obtainNextButtonText
import de.mrapp.android.util.ThemeUtil; //导入方法依赖的package包/类
/**
* Obtains the text of the next button from the activity's theme.
*/
private void obtainNextButtonText() {
CharSequence text;
try {
text = ThemeUtil.getText(this, R.attr.nextButtonText);
} catch (NotFoundException e) {
text = getText(R.string.next_button_text);
}
setNextButtonText(text);
}
示例4: obtainBackButtonText
import de.mrapp.android.util.ThemeUtil; //导入方法依赖的package包/类
/**
* Obtains the text of the back button from the activity's theme.
*/
private void obtainBackButtonText() {
CharSequence text;
try {
text = ThemeUtil.getText(this, R.attr.backButtonText);
} catch (NotFoundException e) {
text = getText(R.string.back_button_text);
}
setBackButtonText(text);
}
示例5: obtainFinishButtonText
import de.mrapp.android.util.ThemeUtil; //导入方法依赖的package包/类
/**
* Obtains the text of the finish button from the activity's theme.
*/
private void obtainFinishButtonText() {
CharSequence text;
try {
text = ThemeUtil.getText(this, R.attr.finishButtonText);
} catch (NotFoundException e) {
text = getText(R.string.finish_button_text);
}
setFinishButtonText(text);
}