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


Java Configuration.UI_MODE_TYPE_TELEVISION属性代码示例

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


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

示例1: getDeviceType

/**
 * Returns true when running Android TV
 *
 * @param c Context to detect UI Mode.
 * @return true when device is running in tv mode, false otherwise.
 */
public static String getDeviceType(Context c) {
    UiModeManager uiModeManager = (UiModeManager) c.getSystemService(Context.UI_MODE_SERVICE);
    int modeType = uiModeManager.getCurrentModeType();
    switch (modeType){
        case Configuration.UI_MODE_TYPE_TELEVISION:
            return "TELEVISION";
        case Configuration.UI_MODE_TYPE_WATCH:
            return "WATCH";
        case Configuration.UI_MODE_TYPE_NORMAL:
            String type = isTablet(c) ? "TABLET" : "PHONE";
            return type;
        case Configuration.UI_MODE_TYPE_UNDEFINED:
            return "UNKOWN";
        default:
            return "";
    }
}
 
开发者ID:medalionk,项目名称:simple-share-android,代码行数:23,代码来源:Utils.java

示例2: onSearchRequested

/**
 * @see #onSearchRequested(SearchEvent)
 */
public boolean onSearchRequested() {
    if ((getResources().getConfiguration().uiMode&Configuration.UI_MODE_TYPE_MASK)
            != Configuration.UI_MODE_TYPE_TELEVISION) {
        startSearch(null, false, null, false);
        return true;
    } else {
        return false;
    }
}
 
开发者ID:JessYanCoding,项目名称:ProgressManager,代码行数:12,代码来源:a.java

示例3: isRunningOnOUYA

public boolean isRunningOnOUYA() {
    try {
        PackageInfo packageInfo = getPackageManager().getPackageInfo("tv.ouya", 0);
        return true;
    } catch (PackageManager.NameNotFoundException e) {
    }
    UiModeManager uiModeManager = (UiModeManager) getSystemService(UI_MODE_SERVICE);
    return (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) || Globals.OuyaEmulation;
}
 
开发者ID:NeoTerm,项目名称:NeoTerm,代码行数:9,代码来源:MainActivity.java

示例4: isTelevision

public static boolean isTelevision(Context context) {
    UiModeManager uiModeManager = (UiModeManager) context.getSystemService(Context.UI_MODE_SERVICE);
    return uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION;
}
 
开发者ID:gigabytedevelopers,项目名称:FireFiles,代码行数:4,代码来源:Utils.java

示例5: isAndroidTV

public static boolean isAndroidTV(Context ct) {
    UiModeManager uiModeManager = (UiModeManager) ct.getSystemService(Context.UI_MODE_SERVICE);
    return uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION;
}
 
开发者ID:archos-sa,项目名称:aos-FileCoreLibrary,代码行数:4,代码来源:ArchosFeatures.java

示例6: isTv

public static boolean isTv(Context context) {
    return ((UiModeManager) context.getSystemService(Context.UI_MODE_SERVICE))
            .getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION;
}
 
开发者ID:morogoku,项目名称:MTweaks-KernelAdiutorMOD,代码行数:4,代码来源:Utils.java

示例7: runningOnAndroidTV

private boolean runningOnAndroidTV() {
    UiModeManager uiModeManager = (UiModeManager) getSystemService(UI_MODE_SERVICE);
    return uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION;
}
 
开发者ID:akashdeepsingh9988,项目名称:Cybernet-VPN,代码行数:4,代码来源:OpenVPNService.java


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