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


Java TvInputInfo.loadLabel方法代码示例

本文整理汇总了Java中android.media.tv.TvInputInfo.loadLabel方法的典型用法代码示例。如果您正苦于以下问题:Java TvInputInfo.loadLabel方法的具体用法?Java TvInputInfo.loadLabel怎么用?Java TvInputInfo.loadLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.media.tv.TvInputInfo的用法示例。


在下文中一共展示了TvInputInfo.loadLabel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateLabel

import android.media.tv.TvInputInfo; //导入方法依赖的package包/类
public void updateLabel() {
    MainActivity mainActivity = (MainActivity) getContext();
    Channel channel = mainActivity.getCurrentChannel();
    if (channel == null || !channel.isPassthrough()) {
        return;
    }
    TvInputInfo input = mainActivity.getTvInputManagerHelper().getTvInputInfo(
            channel.getInputId());
    CharSequence customLabel = input.loadCustomLabel(getContext());
    CharSequence label = input.loadLabel(getContext());
    if (TextUtils.isEmpty(customLabel) || customLabel.equals(label)) {
        mInputLabelTextView.setText(label);
        mSecondaryInputLabelTextView.setVisibility(View.GONE);
    } else {
        mInputLabelTextView.setText(customLabel);
        mSecondaryInputLabelTextView.setText(label);
        mSecondaryInputLabelTextView.setVisibility(View.VISIBLE);
    }
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:20,代码来源:InputBannerView.java

示例2: setItemViewText

import android.media.tv.TvInputInfo; //导入方法依赖的package包/类
private void setItemViewText(View v, TvInputInfo input) {
    TextView inputLabelView = (TextView) v.findViewById(R.id.input_label);
    TextView secondaryInputLabelView = (TextView) v.findViewById(R.id.secondary_input_label);
    CharSequence customLabel = input.loadCustomLabel(getContext());
    CharSequence label = input.loadLabel(getContext());
    if (TextUtils.isEmpty(customLabel) || customLabel.equals(label)) {
        inputLabelView.setText(label);
        secondaryInputLabelView.setVisibility(View.GONE);
    } else {
        inputLabelView.setText(customLabel);
        secondaryInputLabelView.setText(label);
        secondaryInputLabelView.setVisibility(View.VISIBLE);
    }
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:15,代码来源:SelectInputView.java

示例3: compare

import android.media.tv.TvInputInfo; //导入方法依赖的package包/类
@Override
public int compare(TvInputInfo lhs, TvInputInfo rhs) {
    if (lhs == null) {
        return (rhs == null) ? 0 : 1;
    }
    if (rhs == null) {
        return -1;
    }

    boolean enabledL = isInputEnabled(lhs);
    boolean enabledR = isInputEnabled(rhs);
    if (enabledL != enabledR) {
        return enabledL ? -1 : 1;
    }

    int priorityL = getPriority(lhs);
    int priorityR = getPriority(rhs);
    if (priorityL != priorityR) {
        return priorityR - priorityL;
    }

    String customLabelL = (String) lhs.loadCustomLabel(getContext());
    String customLabelR = (String) rhs.loadCustomLabel(getContext());
    if (!TextUtils.equals(customLabelL, customLabelR)) {
        customLabelL = customLabelL == null ? "" : customLabelL;
        customLabelR = customLabelR == null ? "" : customLabelR;
        return customLabelL.compareToIgnoreCase(customLabelR);
    }

    String labelL = (String) lhs.loadLabel(getContext());
    String labelR = (String) rhs.loadLabel(getContext());
    labelL = labelL == null ? "" : labelL;
    labelR = labelR == null ? "" : labelR;
    return labelL.compareToIgnoreCase(labelR);
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:36,代码来源:SelectInputView.java


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