Android TV 选中高亮显示
1、开发Android TV APP, 使用遥控器选中按钮或者选着其它菜单
如果没有高亮显示,就看不出选中哪个按钮或者菜单
2、在drawable 添加 border_red.xml 设置选中高亮
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="2dp"/>
<stroke
android:color="#FF0000"
android:width="3dp" />
<solid android:color="#00FF0000" />
</shape>
3、在 layout 添加页面xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:focusable="false"
android:gravity="center"
android:layout_gravity="center"
android:clipToPadding="false"
android:clipChildren="false"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="wrap_content"> <Button
android:id="@+id/button_id_1"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:background="#303F9F"
android:focusableInTouchMode="true"
android:textColor="#FFF"
android:layout_marginTop="10dp"
android:layout_marginLeft="0dp"
android:text="按钮"
android:textSize="60dp"
/> <Button
android:id="@+id/button_id_2"
android:layout_below="@id/button_id_1"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:background="#303F9F"
android:focusableInTouchMode="true"
android:textColor="#FFF"
android:text="按钮"
android:layout_marginTop="30dp"
android:textSize="60dp"
/> <Button
android:id="@+id/button_id_3"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:background="#303F9F"
android:layout_below="@id/button_id_2"
android:focusableInTouchMode="true"
android:textColor="#FFF"
android:text="按钮"
android:layout_marginTop="30dp"
android:textSize="60dp"
/> </RelativeLayout>
</LinearLayout>
4、添加选中高亮显示,设置焦点控制
BorderView border = new BorderView(this);
border.setBackgroundResource(R.drawable.border_red); main = (RelativeLayout) findViewById(R.id.main);
border.attachTo(main);
Android TV 选中高亮显示的更多相关文章
- android TV选中时高亮凸显效果
链接: http://pan.baidu.com/s/1pLjAFQ7 密码: xb8g <ignore_js_op> 360手机助手截图0410_18_02_01.png (335.64 ...
- Android TV上的焦点切换效果
转载:http://blog.csdn.net/wzlas111/article/details/39741091 Android TV上的焦点凸显特效相信大家都看到过,那么我们就来实现它吧,首先上张 ...
- 联发科发布全球首款搭载Android TV的智能电视系统芯片MT5595
联发科发布全球首款搭载Android TV的智能电视系统芯片MT5595 admin 资讯 01-07 1 1月7日消息,联发科宣布与Google共同开发出全世界第一个搭载Android TV操作系统 ...
- Android Tv 中的按键事件 KeyEvent 分发处理流程
这次打算来梳理一下 Android Tv 中的按键点击事件 KeyEvent 的分发处理流程.一谈到点击事件机制,网上资料已经非常齐全了,像什么分发.拦截.处理三大流程啊:或者 dispatchTou ...
- Android TV 电视调试和遥控器事件监听
Android TV 真机调试 要进行Android TV开发免不了要进行真机调试. 1.确定电视盒子和开发机器在同一局域网中 2.打开电视盒子的adb允许调试开关 3.进入adb所在文件夹进行adb ...
- Android TV开发总结(六)构建一个TV app的直播节目实例
请尊重分享成果,转载请注明出处:http://blog.csdn.net/hejjunlin/article/details/52966319 近年来,Android TV的迅速发展,传统的有线电视受 ...
- Android TV开发总结(五)TV上屏幕适配总结
前言:前面几篇总结一些TV上的小Sample,开源到GitHub:https://github.com/hejunlin2013/TVSample, 点击链接,可以持续关注.今天总结下TV上屏幕适配. ...
- Android TV开发总结(三)构建一个TV app的焦点控制及遇到的坑
转载请把头部出处链接和尾部二维码一起转载,本文出自逆流的鱼yuiop:http://blog.csdn.net/hejjunlin/article/details/52835829 前言:上篇中,&l ...
- Android TV开发总结(二)构建一个TV Metro界面(仿泰捷视频TV版)
前言:上篇是介绍构建TV app前要知道的一些事儿,开发Android TV和手机本质上没有太大的区别,屏大,焦点处理,按键处理,是有别于有手机和Pad的实质区别.今天来介绍TV中Metro UI风格 ...
随机推荐
- vue轮播插件vue-awesome-swiper
https://surmon-china.github.io/vue-awesome-swiper/ 第一步安装 npm install vue-awesome-swiper --save 第二部在m ...
- 【codeforces 515B】Drazil and His Happy Friends
[题目链接]:http://codeforces.com/contest/515/problem/B [题意] 第i天选择第i%n个男生,第i%m个女生,让他们一起去吃饭; 只要这一对中有一个人是开心 ...
- ZooKeeper学习总结(1)——ZooKeeper入门介绍
1. 概述 Zookeeper是Hadoop的一个子项目,它是分布式系统中的协调系统,可提供的服务主要有:配置服务.名字服务.分布式同步.组服务等. 它有如下的一些特点: 简单 Zookeeper的核 ...
- [Bzoj4196] [NOI2015] 软件包管理器 [树链剖分,线段树]
题解摘要:树链剖分后用线段树区间查询修改,对于安装软件,将改点到根的路径全部变为1,对于卸载软件,将子树清空.注意边界,编号是从0开始的,容易漏掉树根. 第一次写树剖- #include <io ...
- 知新之--12-factors
作为总的原则,在程序设计上很有高度... 参考URL:http://12factor.net/zh_cn/ ========================================== 12- ...
- 洛谷——P1505 苹果摘陶陶
题目背景 根据2005年的Noip普及组第一题衍生出的一题. 但是有一点点的恶搞成分在里面..... 题目描述 话说去年苹果们被陶陶摘下来后都很生气,于是就用最先进的克隆技术把陶陶克隆了好多份> ...
- Linux vim 入门 配置 及 使用初步
网上能够找到的,关于VI的教程,更是多为能吓死人的上百页说明.事实上, 从我个人的实践看,全然不须要如此夸张.要完毕最主要的编辑.仅仅要熟悉几个命令,就是把VIM用得非常好. 这里就列举一下: Esc ...
- 架构师速成5.1-小学gtd进阶
人生没有理想,那和咸鱼有什么差别. 有了理想怎样去实现.这就是gtd须要解决的问题.简单说一下gtd怎么做? 确定你的目标.假设不能确定长期目标,至少须要一个2年到3年的目标. 目标必须是能够衡量的, ...
- hive学习路线
hive学习路线图:
- SpringMVC + MyBatis 配置文件
web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="htt ...