医疗YS客户需要在我们的mt8735系统平台上,能够控制下方的导航栏的显示/不显示,那么就需要添加“虚拟按键”设置选项,同时也将该添加更新到mt8735系统平台的其他项目中。
(1)医疗YS客户所说的导航栏(最下方红色框框部分)
(3)能不能软件控制“虚拟按键”,则需要写一个测试APP,APP 可通过广播控制:"android.intent.action.NAVIGATION_BAR" putExtra : "enable" true -> 开,false -> 关.
测试软件界面:
(4)测试软件源码:
(5)“虚拟按键”在mt8735系统中添加与mt6735(AP7350)系统上添加的步骤类似,添加过程参考了TimKing--AP7350 系统添加 虚拟按键 开关设置选项
(1)医疗YS客户所说的导航栏(最下方红色框框部分)
(2)添加后的虚拟按键效果:
(3)能不能软件控制“虚拟按键”,则需要写一个测试APP,APP 可通过广播控制:"android.intent.action.NAVIGATION_BAR" putExtra : "enable" true -> 开,false -> 关.
测试软件界面:
(4)测试软件源码:
- package com.raindi.navigationctrl;
- import android.content.Intent;
- import android.provider.Settings;
- import android.support.v7.app.AppCompatActivity;
- import android.os.Bundle;
- import android.widget.CompoundButton;
- import android.widget.Switch;
- public class MainActivity extends AppCompatActivity {
- String action = "android.intent.action.NAVIGATION_BAR";
- Switch mSwitch;
- Intent intent = new Intent();
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- intent.setAction(action);
- mSwitch = (Switch)findViewById(R.id.switch_id);
- int status = Settings.System.getInt(this.getContentResolver(),"navigation_bar_switch", 0);
- if (status == 0){
- mSwitch.setChecked(false);
- }else {
- mSwitch.setChecked(true);
- }
- mSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
- @Override
- public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
- if (isChecked){
- intent.putExtra("enable",true);
- }else {
- intent.putExtra("enable",false);
- }
- MainActivity.this.sendBroadcast(intent);
- }
- });
- }
- }
(5)“虚拟按键”在mt8735系统中添加与mt6735(AP7350)系统上添加的步骤类似,添加过程参考了TimKing--AP7350 系统添加 虚拟按键 开关设置选项