当前位置: 首页 > wzjs >正文

阳泉市住房保障和城乡建设管理局网站小程序登录密码怎么找回

阳泉市住房保障和城乡建设管理局网站,小程序登录密码怎么找回,宣传网站有哪些,我的世界做皮肤网站1.前言 在10.0的系统rom定制化开发中,在某些特定的产品开发中,需要通过接口来控制系统状态栏的显示和隐藏, 所以就需要了解systemui状态栏的显示构造过程,然后通过相关接口来显示和隐藏状态栏,接下来就来 实现相关的功…

1.前言

在10.0的系统rom定制化开发中,在某些特定的产品开发中,需要通过接口来控制系统状态栏的显示和隐藏, 所以就需要了解systemui状态栏的显示构造过程,然后通过相关接口来显示和隐藏状态栏,接下来就来 实现相关的功能

2.通过广播控制systemui状态栏动态显示和隐藏功能实现的核心类

frameworks/base/packages/SystemUl/src/com/android/systemui/statusbar/phone/StatusBar.java

3.通过广播控制systemui状态栏动态显示和隐藏功能实现的核心功能分析和实现

在系统SystemUI状态栏中,StatusBar也是继承SystemUI,启动流程和SystemUI一致。并在start的时候添加创建StatusBar相关的view。 我们从StatusBar的start()方法开始看,从这里来分析下Statusbar的加载流程和工作原理 在系统启动的过程中,在SystemServer.java类中,在启动SystemUIService这个服务以后,这个SystemUIService服务会 调用SystemUI类的Start()方法;SystemUI类又是被BaseStatusBar类实现的;PhoneStatusBar类又继承了 BaseStatusBar类,重写了start()方法,因此实际调用的是PhoneStatusBar的start()方法来完成状态栏的启动。

3.1 StatusBar的创建过程分析

systemui其实结构是比较复杂,里面管理各种服务,导航栏,状态栏,近期列表,下拉菜单,关机界面等, 其中以导航栏和状态栏,近期列表用的比较多,也是本博文会重点讲解的内容。从结构上来讲下拉菜单和 状态栏都是属于statusbar,结构树上也是属于顶层的super_status_bar.xml 创建StatusBar :createAndAddWindows() ,并且做一些初始化值。

    public class StatusBar extends SystemUI implements DemoMode,ActivityStarter, OnUnlockMethodChangedListener,OnHeadsUpChangedListener, CommandQueue.Callbacks, ZenModeController.Callback,ColorExtractor.OnColorsChangedListener, ConfigurationListener,StatusBarStateController.StateListener, ShadeController,ActivityLaunchAnimator.Callback, AmbientPulseManager.OnAmbientChangedListener,AppOpsController.Callback {protected void makeStatusBarView(@Nullable RegisterStatusBarResult result) {final Context context = mContext;updateDisplaySize(); // populates mDisplayMetricsupdateResources();updateTheme();inflateStatusBarWindow(context);mStatusBarWindow.setService(this);mStatusBarWindow.setOnTouchListener(getStatusBarWindowTouchListener());// TODO: Deal with the ugliness that comes from having some of the statusbar broken out// into fragments, but the rest here, it leaves some awkward lifecycle and whatnot.mNotificationPanel = mStatusBarWindow.findViewById(R.id.notification_panel);mStackScroller = mStatusBarWindow.findViewById(R.id.notification_stack_scroller);mZenController.addCallback(this);NotificationListContainer notifListContainer = (NotificationListContainer) mStackScroller;mNotificationLogger.setUpWithContainer(notifListContainer);mNotificationIconAreaController = SystemUIFactory.getInstance().createNotificationIconAreaController(context, this, mStatusBarStateController);inflateShelf();mNotificationIconAreaController.setupShelf(mNotificationShelf);Dependency.get(DarkIconDispatcher.class).addDarkReceiver(mNotificationIconAreaController);// Allow plugins to reference DarkIconDispatcher and StatusBarStateControllerDependency.get(PluginDependencyProvider.class).allowPluginDependency(DarkIconDispatcher.class);Dependency.get(PluginDependencyProvider.class).allowPluginDependency(StatusBarStateController.class);FragmentHostManager.get(mStatusBarWindow).addTagListener(CollapsedStatusBarFragment.TAG, (tag, fragment) -> {CollapsedStatusBarFragment statusBarFragment =(CollapsedStatusBarFragment) fragment;statusBarFragment.initNotificationIconArea(mNotificationIconAreaController);PhoneStatusBarView oldStatusBarView = mStatusBarView;mStatusBarView = (PhoneStatusBarView) fragment.getView();mStatusBarView.setBar(this);mStatusBarView.setPanel(mNotificationPanel);mStatusBarView.setScrimController(mScrimController);// CollapsedStatusBarFragment re-inflated PhoneStatusBarView and both of// mStatusBarView.mExpanded and mStatusBarView.mBouncerShowing are false.// PhoneStatusBarView's new instance will set to be gone in// PanelBar.updateVisibility after calling mStatusBarView.setBouncerShowing// that will trigger PanelBar.updateVisibility. If there is a heads up showing,// it needs to notify PhoneStatusBarView's new instance to update the correct// status by calling mNotificationPanel.notifyBarPanelExpansionChanged().if (mHeadsUpManager.hasPinnedHeadsUp()) {mNotificationPanel.notifyBarPanelExpansionChanged();}mStatusBarView.setBouncerShowing(mBouncerShowing);if (oldStatusBarView != null) {float fraction = oldStatusBarView.getExpansionFraction();boolean expanded = oldStatusBarView.isExpanded();mStatusBarView.panelExpansionChanged(fraction, expanded);}HeadsUpAppearanceController oldController = mHeadsUpAppearanceController;if (mHeadsUpAppearanceController != null) {// This view is being recreated, let's destroy the old onemHeadsUpAppearanceController.destroy();}mHeadsUpAppearanceController = new HeadsUpAppearanceController(mNotificationIconAreaController, mHeadsUpManager, mStatusBarWindow);mHeadsUpAppearanceController.readFrom(oldController);mStatusBarWindow.setStatusBarView(mStatusBarView);updateAreThereNotifications();checkBarModes();}).getFragmentManager().beginTransaction().replace(R.id.status_bar_container, new CollapsedStatusBarFragment(),CollapsedStatusBarFragment.TAG).commit();mIconController = Dependency.get(StatusBarIconController.class);mHeadsUpManager = new HeadsUpManagerPhone(context, mStatusBarWindow, mGroupManager, this,}.....}

在通过广播控制systemui状态栏动态显示和隐藏功能实现的核心功能中,通过上述的分析得知, makeStatusBarView负责状态栏具体创建 1.加载statusbar设备树super_status_bar :inflateStatusBarWindow(context)-->mPhoneStatusBarWindow(mSuperStatusBarViewFactory.getStatusBarWindowView()),这个设备树的根View是StatusBarWindowView 2.CollapsedStatusBarFragment就是作为加载状态栏的Fragment mPhoneStatusBarWindow负责状态栏的显示和隐藏功能,所以具体就需要来通过mPhoneStatusBarWindow来 控制状态栏的显示和隐藏

//add core startprivate void showStatusBar() {if (mPhoneStatusBarWindow!=null){mPhoneStatusBarWindow.setVisibility(View.VISIBLE);}}private void hideStatusBar() {if (mPhoneStatusBarWindow != null){mPhoneStatusBarWindow.setVisibility(View.GONE);}}
//add core end@VisibleForTestingprotected void registerBroadcastReceiver() {IntentFilter filter = new IntentFilter();filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);filter.addAction(Intent.ACTION_SCREEN_OFF);
+        filter.addAction("com.android.action.showstatus");
+        filter.addAction("com.android.action.hidestatus");filter.addAction(DevicePolicyManager.ACTION_SHOW_DEVICE_MONITORING_DIALOG);mBroadcastDispatcher.registerReceiver(mBroadcastReceiver, filter, null, UserHandle.ALL);}private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {@Overridepublic void onReceive(Context context, Intent intent) {if (DEBUG) Log.v(TAG, "onReceive: " + intent);String action = intent.getAction();if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action)) {KeyboardShortcuts.dismiss();if (mRemoteInputManager.getController() != null) {mRemoteInputManager.getController().closeRemoteInputs();}if (mBubbleController.isStackExpanded()) {mBubbleController.collapseStack();}if (mLockscreenUserManager.isCurrentProfile(getSendingUserId())) {int flags = CommandQueue.FLAG_EXCLUDE_NONE;String reason = intent.getStringExtra("reason");if (reason != null && reason.equals(SYSTEM_DIALOG_REASON_RECENT_APPS)) {flags |= CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL;}mShadeController.animateCollapsePanels(flags);}} 
//add core start
+         else if("com.android.action.hidestatus".equals(action)) {
+               hideStatusBar(); //隐藏状态栏
+         }
+        else if("com.android.action.showstatus".equals(action)) {
+               showStatusBar(); //显示状态栏
+        }
//add core end}};

在通过广播控制systemui状态栏动态显示和隐藏功能实现的核心功能中,通过上述的分析得知, 在通过上述增加showStatusBar()和hideStatusBar()显示和隐藏状态栏的方法中,通过注册广播 com.android.action.showstatus和com.android.action.hidestatus来调用相对应的方法来 显示和隐藏状态栏的功能实现

http://www.dtcms.com/wzjs/812193.html

相关文章:

  • wordpress怎么改端口网站站内优化
  • 山东省建设机械协会网站青岛网站seo收费标准
  • 这样建立自己的网站苏州工业园区属于哪个区
  • 徐州学习网站建设编程能干什么
  • 中山建设局网站首页网站建设私单合同
  • 建设单位应该关注的网站项目建设的背景怎么写
  • 邯郸医疗网站建设南宁app下载
  • 化妆品品牌网站建设网站搭建注意事项
  • 乔拓云建站有免费的吗网站模板站的模板展示怎么做的
  • 金泉网做网站要找谁网络科技公司名字起名大全
  • 做问卷调查的网站挣钱ip开源网站fpga可以做点什么用
  • 河南国正建设集团公司网站沈阳网站建设开发
  • 做网站双12促销方案变更网站做推广需要备案
  • 郑州手机网站建设价格明细表进行网站建设视频
  • wordpress建站论坛今天福州发生一起重大
  • 做商城网站要什么手续跟业务合作做网站给多少提成
  • 苏州网站建设选苏州梦易行做网线头子的顺序
  • 课题组网站建设上海网站建设seodian
  • 自己做网站推广关键词电子商务网站建设 asp
  • 谷歌提交网站网页设计与网站建设设计报告
  • 个体工商户注册网站网页建站软件
  • 网站关键词百度自然排名优化怎么做网站诊断分析
  • 泰安网站制作电话电商推广平台
  • 盐城网站建设案例wordpress多用户注册
  • 网站里的横幅广告怎么做如何搜索到自己的网站
  • 怎样做公司的网站首页一站式
  • 网站更新了域名如何找到给个网站谢谢了
  • 简洁大气公司网站建筑工地正规免费找活平台
  • 网站名词网站备案域名需要解析到备案服务器吗
  • 做阿里国际网站多少钱做购物网站的引言