validationtools中按键测试选项光标移除
最近处理一个问题,设备有方向键盘,做cit中的按键测试,发现按方向键第一次按键不能触发该键值,而是让屏幕第一个按钮获取焦点,然后再次按键,则其他正常。问题:进入界面第一次按键就要响应对应按键逻辑,不需要焦点。该问题查找了很久,最后找到了答案!
布局中的按键测试布局中按钮是button或imagebutton。这布局进入时,初次会相应方向键(原理未知),解决方案:设置所有按钮clickable=false(防止触屏幕激发),主要的是将所有按钮设置
enable=false(imagebutton在xml中设置无效,需要在代码中设置)
修改如下
Date: Wed Aug 28 18:38:33 2024 +0800处理按键测试按钮获取焦点问题Change-Id: I6f317fec43c213761573fb793bc057fd14da71aediff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 8e8eb03..23abed9 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -87,7 +87,7 @@<dataandroid:host="83789"android:scheme="unisoc_secret_code" />
- </intent-filter>
+ </intent-filter> </receiver><receiverandroid:name="com.sprd.validationtools.PhaseCheckBroadcastReceiver"
diff --git a/res/layout/key_test.xml b/res/layout/key_test.xml
index 53eba2e..16f2164 100644
--- a/res/layout/key_test.xml
+++ b/res/layout/key_test.xml
@@ -3,12 +3,6 @@android:layout_width="fill_parent"android:layout_height="fill_parent"android:orientation="vertical" >
- <Button
- android:id="@+id/focus_button"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:clickable="false" >
- </Button><LinearLayoutandroid:layout_width="fill_parent"
@@ -21,6 +15,7 @@android:layout_height="wrap_content"android:layout_weight="1" android:clickable="false"
+ android:enabled="false" android:src="@drawable/voice_up" /> <ImageButton
@@ -28,6 +23,7 @@ android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="1"
+ android:enabled="false" android:clickable="false" android:src="@drawable/voice_down" /> <ImageButton
@@ -36,6 +32,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:clickable="false"
+ android:enabled="false" android:src="@drawable/power_off" /> </LinearLayout>
@@ -69,6 +66,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:clickable="false"
+ android:enabled="false" android:gravity="center" android:text="CALL" /> @@ -78,6 +76,8 @@ android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center"
+ android:enabled="false"
+ android:clickable="false" android:src="@drawable/menu" android:visibility="visible" /> @@ -87,6 +87,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:clickable="false"
+ android:enabled="false" android:src="@drawable/camera" /> <ImageButton android:id="@+id/home_button"
@@ -95,6 +96,7 @@ android:layout_weight="1" android:clickable="false" android:gravity="center"
+ android:enabled="false" android:src="@drawable/home" /> </LinearLayout>
@@ -110,6 +112,9 @@ android:layout_height="wrap_content" android:layout_weight="1" android:clickable="false"
+ android:enabled="false"
+
+ android:text="PTT" /> <Button
@@ -118,6 +123,8 @@ android:layout_height="wrap_content" android:layout_weight="1" android:clickable="false"
+ android:enabled="false"
+ android:text="SOS" /> <ImageButton android:id="@+id/back_button"
@@ -125,6 +132,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:clickable="false"
+ android:enabled="false" android:gravity="center" android:src="@drawable/back" android:visibility="visible" />
@@ -134,6 +142,7 @@ android:layout_weight="1" android:layout_height="wrap_content" android:clickable="false"
+ android:enabled="false" android:gravity="center" android:text="Fn" android:visibility="visible" />
@@ -150,6 +159,9 @@ android:layout_height="wrap_content" android:layout_weight="1" android:clickable="false"
+ android:enabled="false"
+
+ android:text="VIDEO" /> <Button
@@ -158,6 +170,8 @@ android:layout_height="wrap_content" android:layout_weight="1" android:clickable="false"
+ android:enabled="false"
+ android:text="LIGHT" /> </LinearLayout>
@@ -181,6 +195,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="false"
+ android:focusable="false"
+ android:enabled="false"
+ android:focusableInTouchMode="false" android:src="@drawable/up" /> <LinearLayout
@@ -199,6 +216,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="false"
+ android:enabled="false"
+ android:focusable="false"
+ android:focusableInTouchMode="false" android:src="@drawable/left" /> <ImageButton
@@ -206,6 +226,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="false"
+ android:focusable="false"
+ android:enabled="false"
+ android:focusableInTouchMode="false" android:src="@drawable/center" /> <ImageButton
@@ -213,6 +236,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="false"
+ android:focusable="false"
+ android:enabled="false"
+ android:focusableInTouchMode="false" android:src="@drawable/right" /> </LinearLayout> @@ -227,6 +253,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="false"
+ android:focusable="false"
+ android:enabled="false"
+ android:focusableInTouchMode="false" android:src="@drawable/down" /> </LinearLayout> </LinearLayout>
@@ -249,6 +278,7 @@ android:layout_width="180dip" android:layout_height="wrap_content" android:clickable="false"
+ android:enabled="false" android:text="@string/ai_key_test" /> </LinearLayout> </LinearLayout>
diff --git a/src/com/sprd/validationtools/itemstest/audio/PhoneLoopBackTest.java b/src/com/sprd/validationtools/itemstest/audio/PhoneLoopBackTest.java
index d45d9b8..7b8696c 100644
--- a/src/com/sprd/validationtools/itemstest/audio/PhoneLoopBackTest.java
+++ b/src/com/sprd/validationtools/itemstest/audio/PhoneLoopBackTest.java
@@ -83,17 +83,21 @@ public class PhoneLoopBackTest extends BaseActivity { mRadioSpeaker.setOnClickListener(new View.OnClickListener() { public void onClick(View v) {
+ Log.d(TAG, "mRadioSpeaker click---");
+ switchLoopback(LOOPBACK_SPEAKER); } }); mRadioReceiver.setOnClickListener(new View.OnClickListener() { public void onClick(View v) {
+ Log.d(TAG, "mRadioReceiver click---"); switchLoopback(LOOPBACK_RECEIVER); } }); mRadioEarpiece.setOnClickListener(new View.OnClickListener() { public void onClick(View v) {
+ Log.d(TAG, "mRadioEarpiece click---"); switchLoopback(LOOPBACK_MIC_EARPIECE); } });
diff --git a/src/com/sprd/validationtools/itemstest/keypad/KeyTestActivity.java b/src/com/sprd/validationtools/itemstest/keypad/KeyTestActivity.java
index 0139c4e..06f5bd1 100644
--- a/src/com/sprd/validationtools/itemstest/keypad/KeyTestActivity.java
+++ b/src/com/sprd/validationtools/itemstest/keypad/KeyTestActivity.java
@@ -19,6 +19,7 @@ import android.widget.Button; import android.widget.GridLayout; import android.widget.ImageButton; import android.widget.Toast;
+import android.view.WindowManager; import com.sprd.validationtools.BaseActivity; import com.sprd.validationtools.Const;
@@ -118,13 +119,20 @@ public class KeyTestActivity extends BaseActivity { setContentView(R.layout.key_test); setTitle(R.string.key_test); mHomeButton = (ImageButton) findViewById(R.id.home_button);
+ mHomeButton.setEnabled(false); // mMenuButton = (ImageButton) findViewById(R.id.menu_button); mCallButton = (Button) findViewById(R.id.call_button); mVolumeUpButton = (ImageButton) findViewById(R.id.volume_up_button); mVolumeDownButton = (ImageButton) findViewById(R.id.volume_down_button); mCameraButton = (ImageButton) findViewById(R.id.camera_button);
+ mVolumeUpButton.setEnabled(false);
+ mVolumeDownButton.setEnabled(false);
+ mCameraButton.setEnabled(false);
+ mPowerButton = (ImageButton) findViewById(R.id.power_button);
+ mPowerButton.setEnabled(false);
+ mPTTButton = (Button)findViewById(R.id.ptt_button); mSOSButton = (Button)findViewById(R.id.sos_button); @@ -154,10 +162,9 @@ public class KeyTestActivity extends BaseActivity { mVideoButton.setVisibility(View.GONE); mCallButton.setVisibility(View.GONE); - findViewById(R.id.focus_button).requestFocus();
- mFnButton = (Button)findViewById(R.id.fn_button); mMenuButton = (ImageButton)findViewById(R.id.menu_button);
+ mMenuButton.setEnabled(false); mUpButton = (ImageButton)findViewById(R.id.up_button); mDownButton = (ImageButton)findViewById(R.id.down_button);
@@ -165,7 +172,14 @@ public class KeyTestActivity extends BaseActivity { mRightButton = (ImageButton)findViewById(R.id.right_button); mCenterButton = (ImageButton)findViewById(R.id.center_button); mBackButton = (ImageButton)findViewById(R.id.back_button);
-
+ mUpButton.setEnabled(false);
+ mDownButton.setEnabled(false);
+ mLeftButton.setEnabled(false);
+ mRightButton.setEnabled(false);
+ mCenterButton.setEnabled(false);
+ mBackButton.setEnabled(false);
+
+ // mVolumeUpButton.requestFocus(); initSupport(); } }
over~
相关文章:
validationtools中按键测试选项光标移除
最近处理一个问题,设备有方向键盘,做cit中的按键测试,发现按方向键第一次按键不能触发该键值,而是让屏幕第一个按钮获取焦点,然后再次按键,则其他正常。问题:进入界面第一次按键就要响应对应按键…...
【Hot100算法刷题集】哈希-02-字母异位词分组(含排序构造键、自定义键、自定义哈希函数法)
🏠关于专栏:专栏用于记录LeetCode中Hot100专题的所有题目 🎯每日努力一点点,技术变化看得见 题目转载 题目描述 🔒link->题目跳转链接 给你一个字符串数组,请你将 字母异位词 组合在一起。可以按任意顺…...
用华为智驾,开启MPV的下半场
作者 |老缅 编辑 |德新 8月28日,岚图正式对外公布了全球首款搭载华为乾崑智驾和鸿蒙座舱的MPV——全新岚图梦想家。 新车定位「全景豪华科技旗舰MPV」,全系标配四驱,分为四驱鲲鹏版和四驱乾崑版。 其中岚图逍遥座舱和鲲鹏智驾构成的鲲鹏版…...
发烧时眼睛胀痛的多种原因
发烧时眼睛胀痛的多种原因 发烧时眼睛胀痛可能由多种原因引起,主要包括以下几个方面: 上呼吸道感染: 发烧通常由上呼吸道感染引起,如感冒等。这些疾病多由病毒或细菌感染导致,如流感病毒、副流感病毒、腺病毒等。当机…...
用ACF和PACF计算出一堆数据的周期个数以及周期时长,数据分析python
具体步骤 1使用ACF和PACF:可以通过查看ACF图中的周期性峰值,找到数据中的周期性。如果ACF图在某个滞后期处出现显著的正相关峰值,并且这种模式在多个滞后周期中重复出现,这就是周期性信号的特征。而PACF则可以帮助确定延迟的直接影…...
生活方式对人健康影响非常大 第三篇
身体健康因素中 生活方式占到60% 赶紧去调整自己哪错了 上游的生活方式管理 是药三分毒 药物会影响身体肝肾功能,代谢 所以你要去找上游到底是我哪错了 短板越多 个健康状态越差 饮食管理是生活方式管理中难度最大的 原则1:与基因相对应相平衡 只吃素 会导致大脑萎…...
ubuntu22.04 qemu 安装windows on arm虚拟机
ubuntu22.04 qemu 安装windows on arm虚拟机 iso: https://uupdump.net/ https://massgrave.dev/windows_arm_links vivo driver: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.262-2/ qemu sudo apt update sudo a…...
前端框架的演变与选择
目录 前端框架的演变与选择 1. 什么是前端框架? 2. 前端框架的演变 2.1 早期的Web开发 2.2 JavaScript库的兴起 2.3 MVC架构的引入 3. 现代前端框架概览 3.1 React 3.2 Vue.js 3.3 Angular 4. 其他值得关注的前端框架 4.1 Svelte 4.2 Ember.js 5. 如何…...
Oracle(109)如何管理用户密码策略?
管理用户密码策略是确保数据库安全性的重要措施之一。通过定义和实施密码策略,可以确保用户使用强密码,并定期更新密码,以防止未经授权的访问。以下是如何在 MySQL 和 PostgreSQL 中详细配置和管理用户密码策略的步骤和代码示例。 MySQL 用户…...
【重学MySQL】十三、基本的 select 语句
【重学MySQL】十三、基本的 select 语句 基本结构示例检索所有列检索特定列带有条件的检索dual 列的别名基本的列别名使用别名在表达式中的使用别名在聚合函数中的应用 distinct基本用法注意事项示例 空值参与运算数学运算字符串连接比较运算逻辑运算处理NULL的函数 着重号为什…...
vue3.5新特性整理
本文章介绍vue3.5更新的几个新特性 1.vue中watch中深度监听更新的层级 在之前deep 属性是一个boolean值 我们要监听对象的变化需要使用deep: true 在vue3.5之后 deep 也可以是一个number 表示对象要监听的层级数量 这个功能还是比较实用的 因为层级过深的时候我们可能需要监听…...
RK3588 系列之3—rknn使用过程中遇到的bug
RK3588 系列之3—rknn使用过程中遇到的bug 1.librockchip_mpp.so: file format not recognized; treating as linker scrip2.Could not find a package configuration file provided by "OpenCV" with any of the following names参考文献 1.librockchip_…...
Java中的强引用、软引用、弱引用和虚引用于JVM的垃圾回收机制
参考资料 https://juejin.cn/post/7123853933801373733 在 Java 中,引用类型分为四种:强引用(Strong Reference)、软引用(Soft Reference)、弱引用(Weak Reference)和虚引用…...
网络协议的基础知识
前言 本文将详细介绍IP地址、端口号、协议、协议分层、封装、分用、客户端、服务器、请求、响应以及两台主机之间的网络通信流程等网络原理知识。 一、IP 地址 概念 IP地址主要用于标识网络中的主机和其他网络设备(如路由器)的位置。 类似于快递中的…...
Java高级Day37-UDP网络编程
109.netstat指令 netstat -an 可以查看当前主机网络情况,包括端口监听情况和网络连接情况 netstat -an|more 可以分页显示 要求在dos控制台下执行 说明: LISTENING表示某个端口在监听 如果有一个外部程序(客户端)连接到该端口…...
如何利用ChatGPT提升学术论文讨论部分的撰写质量和效率
大家好,感谢关注。我是七哥,一个在高校里不务正业,折腾学术科研AI实操的学术人。关于使用ChatGPT等AI学术科研的相关问题可以和作者七哥(yida985)交流,多多交流,相互成就,共同进步,为大家带来最酷最有效的智能AI学术科研写作攻略。经过数月爆肝,终于完成学术AI使用教…...
谷歌seo网址如何快速被收录?
想让你的网站快速被搜索引擎收录,可以采取几种不同的策略。首先,确保你的网站内容丰富、有价值,搜索引擎更喜欢收录内容质量高的网站。同时,增强网站的外链建设,做好这些站内优化,接下来就是通过谷歌搜索控…...
自动驾驶---什么是Frenet坐标系?
1 背景 为什么提出Frenet坐标系?Frenet坐标系的提出主要是为了解决自动驾驶系统在路径规划的问题,它基于以下几个原因: 符合人类的驾驶习惯: 人类驾驶员在驾驶过程中,通常不会关心自己距离起点的横向和纵向距离&#x…...
如何编写Linux PCI设备驱动器 之一
如何编写Linux PCI设备驱动器 之一 PCI寻址PCI驱动器使用的APIpci_register_driver()pci_driver结构pci_device_id结构 如何查找PCI设备存取PCI配置空间读配置空间APIs写配置空间APIswhere的常量值共用部分类型0类型1 PCI总线通过使用比ISA更高的时钟速率来实现更好的性能&…...
梯度弥散问题及解决方法
梯度弥散问题及解决方法 简要阐述梯度弥散发生的原因以及现象针对不同发生原因有什么解决方案1. 使用ReLU及其变体激活函数2. 权重初始化3. 批量归一化(Batch Normalization)4. 残差连接(Residual Connections)5. 梯度裁剪(Gradient Clipping)简要阐述梯度弥散发生的原因…...
FFmpeg 低延迟同屏方案
引言 在实时互动需求激增的当下,无论是在线教育中的师生同屏演示、远程办公的屏幕共享协作,还是游戏直播的画面实时传输,低延迟同屏已成为保障用户体验的核心指标。FFmpeg 作为一款功能强大的多媒体框架,凭借其灵活的编解码、数据…...
Module Federation 和 Native Federation 的比较
前言 Module Federation 是 Webpack 5 引入的微前端架构方案,允许不同独立构建的应用在运行时动态共享模块。 Native Federation 是 Angular 官方基于 Module Federation 理念实现的专为 Angular 优化的微前端方案。 概念解析 Module Federation (模块联邦) Modul…...
WordPress插件:AI多语言写作与智能配图、免费AI模型、SEO文章生成
厌倦手动写WordPress文章?AI自动生成,效率提升10倍! 支持多语言、自动配图、定时发布,让内容创作更轻松! AI内容生成 → 不想每天写文章?AI一键生成高质量内容!多语言支持 → 跨境电商必备&am…...
MySQL中【正则表达式】用法
MySQL 中正则表达式通过 REGEXP 或 RLIKE 操作符实现(两者等价),用于在 WHERE 子句中进行复杂的字符串模式匹配。以下是核心用法和示例: 一、基础语法 SELECT column_name FROM table_name WHERE column_name REGEXP pattern; …...
初学 pytest 记录
安装 pip install pytest用例可以是函数也可以是类中的方法 def test_func():print()class TestAdd: # def __init__(self): 在 pytest 中不可以使用__init__方法 # self.cc 12345 pytest.mark.api def test_str(self):res add(1, 2)assert res 12def test_int(self):r…...
HashMap中的put方法执行流程(流程图)
1 put操作整体流程 HashMap 的 put 操作是其最核心的功能之一。在 JDK 1.8 及以后版本中,其主要逻辑封装在 putVal 这个内部方法中。整个过程大致如下: 初始判断与哈希计算: 首先,putVal 方法会检查当前的 table(也就…...
AGain DB和倍数增益的关系
我在设置一款索尼CMOS芯片时,Again增益0db变化为6DB,画面的变化只有2倍DN的增益,比如10变为20。 这与dB和线性增益的关系以及传感器处理流程有关。以下是具体原因分析: 1. dB与线性增益的换算关系 6dB对应的理论线性增益应为&…...
Linux 中如何提取压缩文件 ?
Linux 是一种流行的开源操作系统,它提供了许多工具来管理、压缩和解压缩文件。压缩文件有助于节省存储空间,使数据传输更快。本指南将向您展示如何在 Linux 中提取不同类型的压缩文件。 1. Unpacking ZIP Files ZIP 文件是非常常见的,要在 …...
纯 Java 项目(非 SpringBoot)集成 Mybatis-Plus 和 Mybatis-Plus-Join
纯 Java 项目(非 SpringBoot)集成 Mybatis-Plus 和 Mybatis-Plus-Join 1、依赖1.1、依赖版本1.2、pom.xml 2、代码2.1、SqlSession 构造器2.2、MybatisPlus代码生成器2.3、获取 config.yml 配置2.3.1、config.yml2.3.2、项目配置类 2.4、ftl 模板2.4.1、…...
【网络安全】开源系统getshell漏洞挖掘
审计过程: 在入口文件admin/index.php中: 用户可以通过m,c,a等参数控制加载的文件和方法,在app/system/entrance.php中存在重点代码: 当M_TYPE system并且M_MODULE include时,会设置常量PATH_OWN_FILE为PATH_APP.M_T…...
