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

【大模型RAG】拍照搜题技术架构速览:三层管道、两级检索、兜底大模型
摘要 拍照搜题系统采用“三层管道(多模态 OCR → 语义检索 → 答案渲染)、两级检索(倒排 BM25 向量 HNSW)并以大语言模型兜底”的整体框架: 多模态 OCR 层 将题目图片经过超分、去噪、倾斜校正后,分别用…...
零门槛NAS搭建:WinNAS如何让普通电脑秒变私有云?
一、核心优势:专为Windows用户设计的极简NAS WinNAS由深圳耘想存储科技开发,是一款收费低廉但功能全面的Windows NAS工具,主打“无学习成本部署” 。与其他NAS软件相比,其优势在于: 无需硬件改造:将任意W…...
设计模式和设计原则回顾
设计模式和设计原则回顾 23种设计模式是设计原则的完美体现,设计原则设计原则是设计模式的理论基石, 设计模式 在经典的设计模式分类中(如《设计模式:可复用面向对象软件的基础》一书中),总共有23种设计模式,分为三大类: 一、创建型模式(5种) 1. 单例模式(Sing…...
OkHttp 中实现断点续传 demo
在 OkHttp 中实现断点续传主要通过以下步骤完成,核心是利用 HTTP 协议的 Range 请求头指定下载范围: 实现原理 Range 请求头:向服务器请求文件的特定字节范围(如 Range: bytes1024-) 本地文件记录:保存已…...

学校时钟系统,标准考场时钟系统,AI亮相2025高考,赛思时钟系统为教育公平筑起“精准防线”
2025年#高考 将在近日拉开帷幕,#AI 监考一度冲上热搜。当AI深度融入高考,#时间同步 不再是辅助功能,而是决定AI监考系统成败的“生命线”。 AI亮相2025高考,40种异常行为0.5秒精准识别 2025年高考即将拉开帷幕,江西、…...

嵌入式学习笔记DAY33(网络编程——TCP)
一、网络架构 C/S (client/server 客户端/服务器):由客户端和服务器端两个部分组成。客户端通常是用户使用的应用程序,负责提供用户界面和交互逻辑 ,接收用户输入,向服务器发送请求,并展示服务…...
08. C#入门系列【类的基本概念】:开启编程世界的奇妙冒险
C#入门系列【类的基本概念】:开启编程世界的奇妙冒险 嘿,各位编程小白探险家!欢迎来到 C# 的奇幻大陆!今天咱们要深入探索这片大陆上至关重要的 “建筑”—— 类!别害怕,跟着我,保准让你轻松搞…...
C#学习第29天:表达式树(Expression Trees)
目录 什么是表达式树? 核心概念 1.表达式树的构建 2. 表达式树与Lambda表达式 3.解析和访问表达式树 4.动态条件查询 表达式树的优势 1.动态构建查询 2.LINQ 提供程序支持: 3.性能优化 4.元数据处理 5.代码转换和重写 适用场景 代码复杂性…...
Webpack性能优化:构建速度与体积优化策略
一、构建速度优化 1、升级Webpack和Node.js 优化效果:Webpack 4比Webpack 3构建时间降低60%-98%。原因: V8引擎优化(for of替代forEach、Map/Set替代Object)。默认使用更快的md4哈希算法。AST直接从Loa…...

基于PHP的连锁酒店管理系统
有需要请加文章底部Q哦 可远程调试 基于PHP的连锁酒店管理系统 一 介绍 连锁酒店管理系统基于原生PHP开发,数据库mysql,前端bootstrap。系统角色分为用户和管理员。 技术栈 phpmysqlbootstrapphpstudyvscode 二 功能 用户 1 注册/登录/注销 2 个人中…...