1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我们的应用程序跑在 RK3399Pro 上面,是一个公共场合使用的代码,所以把菜单底部的返回,HOME,都隐藏,并且参考菜单导航栏下拉功能要取消。
我是 Firefly 的写代码三个 实现功能框架层添加功能 1.导航栏添加手机功能。 2.导航栏支持横屏切换功能。 3.导航栏支持动态和导航显示栏,永久关闭导航栏在框架层提供借用外部使用 不多说,直接上代码 frameworks/base/core/java/android/content/Intent.java diff --git a/frameworks/base/core/java/android/content/Intent.java b/frameworks/base/core/java/android/content/Intent.java index 6fd333a0c9..1dc8da6746 100755 --- a/frameworks/base/core/java/android/content/Intent.java +++ b/frameworks/base/core/java/android/content/Intent.java @@ -2079,6 +2079,31 @@ public class Intent implements Parcelable, Cloneable { */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_CLOSE_SYSTEM_DIALOGS = "android.intent.action.CLOSE_SYSTEM_DIALOGS"; + + /****/ + /**firefly_modify_songjf Broadcast Action:Status bar hidden + * @hide + */ + public static final String ACTION_HIDE_BAR = "action.HIDE_STATUSBAR"; + /****/ + /**firefly_modify_songjf Broadcast Action:Status bar show + * @hide + */ + public static final String ACTION_SHOW_BAR = "action.SHOW_STATUSBAR"; + + /****/ + /**firefly_modify_songjf Broadcast Action:Status bar show + * @hide + */ + public static final String ACTION_ALWAYS_HIDE_BAR_CHANGE = "action.ALWAYS_HIDE_STATUSBAR_CHENAGE"; + + + /****/ + /**firefly_modify_songjf Broadcast Action:poweroff + * @hide + */ + public static final String ACTION_SYSTEMUI_FIREFLY_POWEROFF = "action.SYSTEMUI_FIREFLY_POWEROFF"; + /** * Broadcast Action: Trigger the download and eventual installation * of a package. frameworks/base/core/java/android/provider/Settings.java diff --git a/frameworks/base/core/java/android/provider/Settings.java b/frameworks/base/core/java/android/provider/Settings.java index d5a9d09ce4..a4fbd2064f 100755 --- a/frameworks/base/core/java/android/provider/Settings.java +++ b/frameworks/base/core/java/android/provider/Settings.java @@ -3627,6 +3627,23 @@ public final class Settings { */ public static final String SCREENSHOT_BUTTON_SHOW = "screenshot_button_show"; + /** + *hidebar button wether display + * @hide + */ + public static final String HIDEBAR_BUTTON_SHOW = "hidebar_button_show"; + + /** + *hide status bar + * @hide + */ + public static final String ALWAYS_HIDE_BAR="always_hide_bar"; + + /** + * if enabled while show rotation in SystenUI and Settings-DisplaySettings + * @hide + */ + public static final String ENABLE_ROTATION_BY_USER = "enable_rotation_by_user"; /** * Whether the phone vibrates when it is ringing due to an incoming call. This will * be used by Phone and Setting apps; it shouldn't affect other apps. frameworks/base/core/java/com/android/internal/statu***ar/IStatusBar.aidl diff --git a/frameworks/base/core/java/com/android/internal/statu***ar/IStatusBar.aidl b/frameworks/base/core/java/com/android/internal/statu***ar/IStatusBar.aidl index bab0306aaf..8da31c5df1 100644 --- a/frameworks/base/core/java/com/android/internal/statu***ar/IStatusBar.aidl +++ b/frameworks/base/core/java/com/android/internal/statu***ar/IStatusBar.aidl @@ -55,6 +55,10 @@ oneway interface IStatusBar boolean showImeSwitcher); void setWindowState(int window, int state); + + //firefly_modify_songjf, add bar interface + void addBar(); + void showRecentApps(boolean triggeredFromAltTab, boolean fromHome); void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey); void toggleRecentApps(); frameworks/base/core/java/com/android/internal/statu***ar/IStatusBarService.aidl diff --git a/frameworks/base/core/java/com/android/internal/statu***ar/IStatusBarService.aidl b/frameworks/base/core/java/com/android/internal/statu***ar/IStatusBarService.aidl index 82eb1abcba..4f59192186 100644 --- a/frameworks/base/core/java/com/android/internal/statu***ar/IStatusBarService.aidl +++ b/frameworks/base/core/java/com/android/internal/statu***ar/IStatusBarService.aidl @@ -73,6 +73,9 @@ interface IStatusBarService void shutdown(); void reboot(boolean safeMode); + //firefly_modify_songjf, add bar interface + void addBar(); + void addTile(in ComponentName tile); void remTile(in ComponentName tile); void clickTile(in ComponentName tile); frameworks/base/packages/SettingsProvider/res/values/custom_defaults.xml diff --git a/frameworks/base/packages/SettingsProvider/res/values/custom_defaults.xml b/frameworks/base/packages/SettingsProvider/res/values/custom_defaults.xml new file mode 100644 index 0000000000..53da8c515b --- /dev/null +++ b/frameworks/base/packages/SettingsProvider/res/values/custom_defaults.xml @@ -0,0 +1,10 @@ + + + + + + + + + + frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java diff --git a/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index d8f3daf1d4..858babef54 100644 --- a/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -2339,6 +2339,16 @@ class DatabaseHelper extends SQLiteOpenHelper { loadIntegerSetting(stmt, Settings.System.SCREENSHOT_BUTTON_SHOW, R.integer.def_screenshot_button_show); + loadBooleanSetting(stmt, Settings.System.HIDEBAR_BUTTON_SHOW, + R.bool.def_hidebar_button_show); + + loadBooleanSetting(stmt, Settings.System.ALWAYS_HIDE_BAR, + R.bool.def_always_hide_bar); + + + loadBooleanSetting(stmt, Settings.System.ENABLE_ROTATION_BY_USER, + R.bool.def_enable_rotation_by_user); + /* * IMPORTANT: Do not add any more upgrade steps here as the global, * secure, and system settings are no longer stored in a database frameworks/base/packages/SystemUI/res/layout/hide_bar.xml |
|
|
|
diff --git a/frameworks/base/packages/SystemUI/res/layout/hide_bar.xml b/frameworks/base/packages/SystemUI/res/layout/hide_bar.xml
new file mode 100644 index 0000000000..1b2fe27d9e --- /dev/null +++ b/frameworks/base/packages/SystemUI/res/layout/hide_bar.xml @@ -0,0 +1,14 @@ + + + xmlns:systemui="http://schemas.android.com/apk/res-auto" + android:id="@+id/hide_bar" + android:layout_width="@dimen/navigation_key_width" + android:layout_height="match_parent" + android:layout_weight="0" + systemui:keyCode="-1" + android:scaleType="center" + android:contentDescription="@string/accessibility_home" + android:paddingStart="@dimen/navigation_key_padding" + android:paddingEnd="@dimen/navigation_key_padding" + /> frameworks/base/packages/SystemUI/res/layout/poweroff.xml diff --git a/frameworks/base/packages/SystemUI/res/layout/poweroff.xml b/frameworks/base/packages/SystemUI/res/layout/poweroff.xml new file mode 100644 index 0000000000..487b563103 --- /dev/null +++ b/frameworks/base/packages/SystemUI/res/layout/poweroff.xml @@ -0,0 +1,14 @@ + + + xmlns:systemui="http://schemas.android.com/apk/res-auto" + android:id="@+id/poweroff" + android:layout_width="@dimen/navigation_key_width" + android:layout_height="match_parent" + android:layout_weight="0" + systemui:keyCode="-1" + android:scaleType="center" + android:contentDescription="@string/accessibility_home" + android:paddingStart="@dimen/navigation_key_padding" + android:paddingEnd="@dimen/navigation_key_padding" + /> No newline at end of file frameworks/base/packages/SystemUI/res/layout/rotation.xml diff --git a/frameworks/base/packages/SystemUI/res/layout/rotation.xml b/frameworks/base/packages/SystemUI/res/layout/rotation.xml new file mode 100644 index 0000000000..20ab401782 --- /dev/null +++ b/frameworks/base/packages/SystemUI/res/layout/rotation.xml @@ -0,0 +1,14 @@ + + + xmlns:systemui="http://schemas.android.com/apk/res-auto" + android:id="@+id/rotation" + android:layout_width="@dimen/navigation_key_width" + android:layout_height="match_parent" + android:layout_weight="0" + systemui:keyCode="-2" + android:scaleType="center" + android:contentDescription="@string/accessibility_home" + android:paddingStart="@dimen/navigation_key_padding" + android:paddingEnd="@dimen/navigation_key_padding" + /> No newline at end of file frameworks/base/packages/SystemUI/res/values-sw600dp/config.xml diff --git a/frameworks/base/packages/SystemUI/res/values-sw600dp/config.xml b/frameworks/base/packages/SystemUI/res/values-sw600dp/config.xml index d5c4303003..07ea9ba760 100644 --- a/frameworks/base/packages/SystemUI/res/values-sw600dp/config.xml +++ b/frameworks/base/packages/SystemUI/res/values-sw600dp/config.xml @@ -34,7 +34,7 @@ - + frameworks/base/packages/SystemUI/res/values-zh-rCN/custom_strings.xml diff --git a/frameworks/base/packages/SystemUI/res/values-zh-rCN/custom_strings.xml b/frameworks/base/packages/SystemUI/res/values-zh-rCN/custom_strings.xml new file mode 100644 index 0000000000..d2d323ef24 --- /dev/null +++ b/frameworks/base/packages/SystemUI/res/values-zh-rCN/custom_strings.xml @@ -0,0 +1,9 @@ + + + + + + + + No newline at end of file frameworks/base/packages/SystemUI/res/values-zh-rHK/custom_strings.xml diff --git a/frameworks/base/packages/SystemUI/res/values-zh-rHK/custom_strings.xml b/frameworks/base/packages/SystemUI/res/values-zh-rHK/custom_strings.xml new file mode 100644 index 0000000000..6850f153b3 --- /dev/null +++ b/frameworks/base/packages/SystemUI/res/values-zh-rHK/custom_strings.xml @@ -0,0 +1,9 @@ + + + + + + + + s No newline at end of file frameworks/base/packages/SystemUI/res/values/config.xml diff --git a/frameworks/base/packages/SystemUI/res/values/config.xml b/frameworks/base/packages/SystemUI/res/values/config.xml index 8511fed05c..94eb8a676b 100644 --- a/frameworks/base/packages/SystemUI/res/values/config.xml +++ b/frameworks/base/packages/SystemUI/res/values/config.xml @@ -107,12 +107,12 @@ - wifi,bt,dnd,flashlight,rotation,battery,cell,airplane,cast + wifi,bt,dnd,flashlight,rotation,battery,cell,airplane,cast,screenshot - wifi,cell,battery,dnd,flashlight,rotation,bt,airplane,location,hotspot,inversion,saver,work,cast,night + wifi,cell,battery,dnd,flashlight,rotation,bt,airplane,location,hotspot,inversion,saver,work,cast,screenshot,night @@ -320,7 +320,7 @@ - + |
|
|
|
frameworks/base/packages/SystemUI/res/values/custom_strings.xml
diff --git a/frameworks/base/packages/SystemUI/res/values/custom_strings.xml b/frameworks/base/packages/SystemUI/res/values/custom_strings.xml new file mode 100644 index 0000000000..3c3fdefe10 --- /dev/null +++ b/frameworks/base/packages/SystemUI/res/values/custom_strings.xml @@ -0,0 +1,11 @@ + + + + + + + + + + s No newline at end of file frameworks/base/packages/SystemUI/src/com/android/systemui/statu***ar/CommandQueue.java diff --git a/frameworks/base/packages/SystemUI/src/com/android/systemui/statu***ar/CommandQueue.java b/frameworks/base/packages/SystemUI/src/com/android/systemui/statu***ar/CommandQueue.java index 6349275037..59e738a375 100644 --- a/frameworks/base/packages/SystemUI/src/com/android/systemui/statu***ar/CommandQueue.java +++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/statu***ar/CommandQueue.java @@ -83,6 +83,9 @@ public class CommandQueue extends IStatusBar.Stub { private static final int MSG_SHOW_SHUTDOWN_UI = 36 << MSG_SHIFT; private static final int MSG_SET_TOP_APP_HIDES_STATUS_BAR = 37 << MSG_SHIFT; + /**firefly_modify_songjf, add bar interface**/ + private static final int MSG_ADD_BAR = 38 << MSG_SHIFT; + public static final int FLAG_EXCLUDE_NONE = 0; public static final int FLAG_EXCLUDE_SEARCH_PANEL = 1 << 0; public static final int FLAG_EXCLUDE_RECENTS_PANEL = 1 << 1; @@ -142,6 +145,9 @@ public class CommandQueue extends IStatusBar.Stub { default void handleSystemKey(int arg1) { } default void handleShowGlobalActionsMenu() { } default void handleShowShutdownUi(boolean isReboot, String reason) { } + + /**firefly_modify_songjf, add bar interface **/ + default void addBar(){ } } @VisibleForTesting @@ -343,6 +349,14 @@ public class CommandQueue extends IStatusBar.Stub { } } + /**firefly_modify_songjf, add bar interface **/ + public void addBar() { + synchronized (mLock) { + mHandler.removeMessages(MSG_ADD_BAR); + mHandler.obtainMessage(MSG_ADD_BAR, 0, 0, null).sendToTarget(); + } + } + public void showScreenPinningRequest(int taskId) { synchronized (mLock) { mHand 写文章的时候板子不在身边,就找张的状态控制的效果是一样的。图片 在网上发布 /****/ /** Broadcast Action:Status bar show */ public static final String ACTION_ALWAYS_HIDE_BAR_CHANGE = "action.ALWAYS_HIDE_STATUSBAR_CHENAGE"; public static final String CNBOT_ACTION_ALWAYS_HIDE = "cnbot_always_hide_bar"; /** * 系统的状态栏控制 * @param context * @param hide 是否隐藏 */ public static void changeBarHideStatus(Context context , boolean hide){ if (context == null){ return; } Intent i = new Intent(ACTION_ALWAYS_HIDE_BAR_CHANGE); i.putExtra(CNBOT_ACTION_ALWAYS_HIDE,hide?1:0); context.sendBroadcast(i); } |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
基于米尔瑞芯微RK3576核心板/开发板的人脸疲劳检测应用方案
1162 浏览 0 评论
1330 浏览 1 评论
1015 浏览 1 评论
2345 浏览 1 评论
3671 浏览 1 评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-30 19:47 , Processed in 0.430569 second(s), Total 47, Slave 39 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号