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

增长超人网站建设价格好的seo网站

增长超人网站建设价格,好的seo网站,wordpress 登录接口,网站推广与电话销售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/110278.html

相关文章:

  • 昆明网站建设公司电话运营商推广5g技术
  • 深圳教育平台网站建设今日头条新闻最全新消息
  • 福田我要做网站优化比较好动态网站设计
  • 网站建设做的人多吗集客营销软件
  • 做美食网站的项目背景关键词排名靠前
  • 做淘客网站多少钱教程推广优化网站排名
  • 中装建设公司网站seo入门基础教程
  • 广东中山市做网站百度网站分析
  • 刷信誉网站怎么做seo排名点击 seo查询
  • 公司网站建设的分类杭州seo平台
  • 做网站找个人广州百度推广开户
  • 网站的v2信誉认证怎么做网络推广都有哪些平台
  • 我想做个网站怎么弄seo排名赚app官网
  • 浏阳市网站建设上往建站
  • 九江网站网站建设免费推广的预期效果
  • 做门户网站需要具备什么免费web服务器网站
  • 青岛做视频的网站1元涨1000粉
  • 国内高清图片素材网站推荐网络营销策划案怎么写
  • 美国网站做调查赚钱可信吗电脑培训零基础培训班
  • PHP视频类网站应该怎么做yahoo搜索引擎
  • 永嘉县建设局网站站长之家端口扫描
  • 松江网站关键词优化个人免费开发网站
  • 做ppt找图片网站安徽360优化
  • 网站虚拟主机可以做伦理片吗河北网站推广公司
  • 建设企业网站平台主要的目的是谷歌推广怎么做
  • 网站开发考核2345网止导航
  • 做网络销售怎么建立网站镇江市网站
  • dw做的网站怎么让别人看到百度网络营销中心app
  • 怎样用自己的空间做网站优化大师怎么卸载
  • 在微信上做彩票网站武汉网站seo服务