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

Linux应用开发之网络套接字编程(实例篇)
服务端与客户端单连接 服务端代码 #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <arpa/inet.h> #include <pthread.h> …...

linux之kylin系统nginx的安装
一、nginx的作用 1.可做高性能的web服务器 直接处理静态资源(HTML/CSS/图片等),响应速度远超传统服务器类似apache支持高并发连接 2.反向代理服务器 隐藏后端服务器IP地址,提高安全性 3.负载均衡服务器 支持多种策略分发流量…...

练习(含atoi的模拟实现,自定义类型等练习)
一、结构体大小的计算及位段 (结构体大小计算及位段 详解请看:自定义类型:结构体进阶-CSDN博客) 1.在32位系统环境,编译选项为4字节对齐,那么sizeof(A)和sizeof(B)是多少? #pragma pack(4)st…...

家政维修平台实战20:权限设计
目录 1 获取工人信息2 搭建工人入口3 权限判断总结 目前我们已经搭建好了基础的用户体系,主要是分成几个表,用户表我们是记录用户的基础信息,包括手机、昵称、头像。而工人和员工各有各的表。那么就有一个问题,不同的角色…...

2021-03-15 iview一些问题
1.iview 在使用tree组件时,发现没有set类的方法,只有get,那么要改变tree值,只能遍历treeData,递归修改treeData的checked,发现无法更改,原因在于check模式下,子元素的勾选状态跟父节…...
LeetCode - 199. 二叉树的右视图
题目 199. 二叉树的右视图 - 力扣(LeetCode) 思路 右视图是指从树的右侧看,对于每一层,只能看到该层最右边的节点。实现思路是: 使用深度优先搜索(DFS)按照"根-右-左"的顺序遍历树记录每个节点的深度对于…...
腾讯云V3签名
想要接入腾讯云的Api,必然先按其文档计算出所要求的签名。 之前也调用过腾讯云的接口,但总是卡在签名这一步,最后放弃选择SDK,这次终于自己代码实现。 可能腾讯云翻新了接口文档,现在阅读起来,清晰了很多&…...

【JVM】Java虚拟机(二)——垃圾回收
目录 一、如何判断对象可以回收 (一)引用计数法 (二)可达性分析算法 二、垃圾回收算法 (一)标记清除 (二)标记整理 (三)复制 (四ÿ…...
uniapp 字符包含的相关方法
在uniapp中,如果你想检查一个字符串是否包含另一个子字符串,你可以使用JavaScript中的includes()方法或者indexOf()方法。这两种方法都可以达到目的,但它们在处理方式和返回值上有所不同。 使用includes()方法 includes()方法用于判断一个字…...

yaml读取写入常见错误 (‘cannot represent an object‘, 117)
错误一:yaml.representer.RepresenterError: (‘cannot represent an object’, 117) 出现这个问题一直没找到原因,后面把yaml.safe_dump直接替换成yaml.dump,确实能保存,但出现乱码: 放弃yaml.dump,又切…...