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)简要阐述梯度弥散发生的原因…...

基于Flask实现的医疗保险欺诈识别监测模型
基于Flask实现的医疗保险欺诈识别监测模型 项目截图 项目简介 社会医疗保险是国家通过立法形式强制实施,由雇主和个人按一定比例缴纳保险费,建立社会医疗保险基金,支付雇员医疗费用的一种医疗保险制度, 它是促进社会文明和进步的…...
连锁超市冷库节能解决方案:如何实现超市降本增效
在连锁超市冷库运营中,高能耗、设备损耗快、人工管理低效等问题长期困扰企业。御控冷库节能解决方案通过智能控制化霜、按需化霜、实时监控、故障诊断、自动预警、远程控制开关六大核心技术,实现年省电费15%-60%,且不改动原有装备、安装快捷、…...
Axios请求超时重发机制
Axios 超时重新请求实现方案 在 Axios 中实现超时重新请求可以通过以下几种方式: 1. 使用拦截器实现自动重试 import axios from axios;// 创建axios实例 const instance axios.create();// 设置超时时间 instance.defaults.timeout 5000;// 最大重试次数 cons…...

【JavaWeb】Docker项目部署
引言 之前学习了Linux操作系统的常见命令,在Linux上安装软件,以及如何在Linux上部署一个单体项目,大多数同学都会有相同的感受,那就是麻烦。 核心体现在三点: 命令太多了,记不住 软件安装包名字复杂&…...

Maven 概述、安装、配置、仓库、私服详解
目录 1、Maven 概述 1.1 Maven 的定义 1.2 Maven 解决的问题 1.3 Maven 的核心特性与优势 2、Maven 安装 2.1 下载 Maven 2.2 安装配置 Maven 2.3 测试安装 2.4 修改 Maven 本地仓库的默认路径 3、Maven 配置 3.1 配置本地仓库 3.2 配置 JDK 3.3 IDEA 配置本地 Ma…...

浪潮交换机配置track检测实现高速公路收费网络主备切换NQA
浪潮交换机track配置 项目背景高速网络拓扑网络情况分析通信线路收费网络路由 收费汇聚交换机相应配置收费汇聚track配置 项目背景 在实施省内一条高速公路时遇到的需求,本次涉及的主要是收费汇聚交换机的配置,浪潮网络设备在高速项目很少,通…...

Selenium常用函数介绍
目录 一,元素定位 1.1 cssSeector 1.2 xpath 二,操作测试对象 三,窗口 3.1 案例 3.2 窗口切换 3.3 窗口大小 3.4 屏幕截图 3.5 关闭窗口 四,弹窗 五,等待 六,导航 七,文件上传 …...

C++11 constexpr和字面类型:从入门到精通
文章目录 引言一、constexpr的基本概念与使用1.1 constexpr的定义与作用1.2 constexpr变量1.3 constexpr函数1.4 constexpr在类构造函数中的应用1.5 constexpr的优势 二、字面类型的基本概念与使用2.1 字面类型的定义与作用2.2 字面类型的应用场景2.2.1 常量定义2.2.2 模板参数…...

运行vue项目报错 errors and 0 warnings potentially fixable with the `--fix` option.
报错 找到package.json文件 找到这个修改成 "lint": "eslint --fix --ext .js,.vue src" 为elsint有配置结尾换行符,最后运行:npm run lint --fix...

[10-1]I2C通信协议 江协科技学习笔记(17个知识点)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17...