当前位置: 首页>>代码示例>>Java>>正文


Java ThemeUtil.getText方法代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:michael-rapp,项目名称:ChromeLikeTabSwitcher,代码行数:26,代码来源:ThemeHelper.java

示例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);
}
 
开发者ID:michael-rapp,项目名称:AndroidPreferenceActivity,代码行数:16,代码来源:PreferenceFragment.java

示例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);
}
 
开发者ID:michael-rapp,项目名称:AndroidPreferenceActivity,代码行数:15,代码来源:PreferenceActivity.java

示例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);
}
 
开发者ID:michael-rapp,项目名称:AndroidPreferenceActivity,代码行数:15,代码来源:PreferenceActivity.java

示例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);
}
 
开发者ID:michael-rapp,项目名称:AndroidPreferenceActivity,代码行数:15,代码来源:PreferenceActivity.java


注:本文中的de.mrapp.android.util.ThemeUtil.getText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。