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

长沙网站优化收费sever2012 网站建设

长沙网站优化收费,sever2012 网站建设,云速网站建设,wordpress怎么改登陆背景 hi#xff0c;粉丝朋友们#xff1a; 近期有个学员问到了一个输入法相关问题。刚好梳理了一下输入法相关的在多屏模式的一个展示流程#xff0c;这里做个记录#xff0c;也相当于深入理解窗口相关的一篇干货blog。 如上面两幅图展示#xff0c;输入法可以自由自在显…背景 hi粉丝朋友们 近期有个学员问到了一个输入法相关问题。刚好梳理了一下输入法相关的在多屏模式的一个展示流程这里做个记录也相当于深入理解窗口相关的一篇干货blog。 如上面两幅图展示输入法可以自由自在显示在双屏的任意屏幕那么下面主要就是来解密输入到底如何做到的自由双屏展示。 分析思路 如果对输入相关业务不知道的话那么就只能考虑从窗口层面入手一般输入法都是其实是一个dialog这个类是SoftInputWindow 一般输入法窗口显示到了其他屏幕肯定相关的displayid是要变化的这里可以dumpsys window windows可以看出来 输入法窗口在副屏 Window #1 Window{e79aca4 u0 InputMethod}:mDisplayId2 rootTaskId35 mSessionSession{d9973cd 1240:u0a10084} mClientandroid.os.BinderProxye774f37mOwnerUid10084 showForAllUsersfalse packagecom.android.inputmethod.latin appopNONEmAttrs{(0,0)(fillxfill) grBOTTOM CENTER_VERTICAL sim{adjustpan} tyINPUT_METHOD fmtTRANSPARENT wanim0x1030056 receive insets ignoring z-orderflNOT_FOCUSABLE LAYOUT_IN_SCREEN SPLIT_TOUCH HARDWARE_ACCELERATED DRAWS_SYSTEM_BAR_BACKGROUNDSpflUSE_BLAST FIT_INSETS_CONTROLLEDbhvDEFAULTfitTypesSTATUS_BARS NAVIGATION_BARSfitSidesLEFT TOP RIGHT}Requested w1120 h2960 mLayoutSeq64mIsImWindowtrue mIsWallpaperfalse mIsFloatingLayertruemBaseLayer131000 mSubLayer0 mTokenWindowToken{8e22fba type2011 android.os.Binder8ee38e5}mViewVisibility0x0 mHaveFrametrue mObscuredfalsemGivenContentInsets[0,1759][0,0] mGivenVisibleInsets[0,1759][0,0]mTouchableInsets3 mGivenInsetsPendingfalsetouchable regionSkRegion((0,1759,1440,2792))mFullConfiguration{1.0 310mcc260mnc [en_US] ldltr sw411dp w411dp h797dp 560dpi nrml long port finger qwerty/v/v dpad/v winConfig{ mBoundsRect(0, 0 - 1440, 2960) mAppBoundsRect(0, 0 - 1440, 2792) mMaxBoundsRect(0, 0 - 1440, 2960) mDisplayRotationROTATION_0 mWindowingModefullscreen mDisplayWindowingModefullscreen mActivityTypeundefined mAlwaysOnTopundefined mRotationROTATION_0} s.49 fontWeightAdjustment0}mLastReportedConfiguration{1.0 310mcc260mnc [en_US] ldltr sw411dp w411dp h797dp 560dpi nrml long port finger qwerty/v/v dpad/v winConfig{ mBoundsRect(0, 0 - 1440, 2960) mAppBoundsRect(0, 0 - 1440, 2792) mMaxBoundsRect(0, 0 - 1440, 2960) mDisplayRotationROTATION_0 mWindowingModefullscreen mDisplayWindowingModefullscreen mActivityTypeundefined mAlwaysOnTopundefined mRotationROTATION_0} s.49 fontWeightAdjustment0}mHasSurfacetrue isReadyForDisplay()true mWindowRemovalAllowedfalseFrames: parent[0,0][1440,2960] display[0,0][1440,2960] frame[0,0][1440,2960] last[0,0][1440,2960] insetsChangedfalsesurface[0,0][0,0]ContainerAnimator:mLeashSurface(nameSurface(namee79aca4 InputMethod)/0xd668dc2 - animation-leash of insets_animation)/0xaeadaa0 mAnimationTypeinsets_animationAnimation: com.android.server.wm.InsetsSourceProvider$ControlAdapterc5c0659ControlAdapter mCapturedLeashSurface(nameSurface(namee79aca4 InputMethod)/0xd668dc2 - animation-leash of insets_animation)/0xaeadaa0WindowStateAnimator{ef4021e InputMethod}:mSurfaceSurface(nameInputMethod)/0x7be3affSurface: showntrue layer0 alpha1.0 rect(0.0,0.0) transform(1.0, 0.0, 0.0, 1.0)mDrawStateHAS_DRAWN mLastHiddenfalsemEnterAnimationPendingfalse mSystemDecorRect[0,0][0,0]mForceSeamlesslyRotatefalse seamlesslyRotate: pendingnull isOnScreentrueisVisibletruekeepClearAreas: restricted[], unrestricted[]输入法在主屏幕 Window #7 Window{ee26d8d u0 InputMethod}:mDisplayId0 rootTaskId1 mSessionSession{d9973cd 1240:u0a10084} mClientandroid.os.BinderProxy7424e24mOwnerUid10084 showForAllUsersfalse packagecom.android.inputmethod.latin appopNONEmAttrs{(0,0)(fillxfill) grBOTTOM CENTER_VERTICAL sim{adjustpan} tyINPUT_METHOD fmtTRANSPARENT wanim0x1030056 receive insets ignoring z-orderflNOT_FOCUSABLE LAYOUT_IN_SCREEN SPLIT_TOUCH HARDWARE_ACCELERATED DRAWS_SYSTEM_BAR_BACKGROUNDSpflUSE_BLAST FIT_INSETS_CONTROLLEDbhvDEFAULTfitTypesSTATUS_BARS NAVIGATION_BARSfitSidesLEFT TOP RIGHT}Requested w1440 h2960 mLayoutSeq162mIsImWindowtrue mIsWallpaperfalse mIsFloatingLayertruemBaseLayer131000 mSubLayer0 mTokenWindowToken{ba8dd3a type2011 android.os.Binder4152c65}mViewVisibility0x0 mHaveFrametrue mObscuredfalsemGivenContentInsets[0,1675][0,0] mGivenVisibleInsets[0,1675][0,0]mTouchableInsets3 mGivenInsetsPendingfalsetouchable regionSkRegion((0,1759,1440,2792))mFullConfiguration{1.0 310mcc260mnc [en_US] ldltr sw411dp w411dp h773dp 560dpi nrml long port finger qwerty/v/v dpad/v winConfig{ mBoundsRect(0, 0 - 1440, 2960) mAppBoundsRect(0, 0 - 1440, 2792) mMaxBoundsRect(0, 0 - 1440, 2960) mDisplayRotationROTATION_0 mWindowingModefullscreen mDisplayWindowingModefullscreen mActivityTypeundefined mAlwaysOnTopundefined mRotationROTATION_0} s.24 fontWeightAdjustment0}mLastReportedConfiguration{1.0 310mcc260mnc [en_US] ldltr sw411dp w411dp h773dp 560dpi nrml long port finger qwerty/v/v dpad/v winConfig{ mBoundsRect(0, 0 - 1440, 2960) mAppBoundsRect(0, 0 - 1440, 2792) mMaxBoundsRect(0, 0 - 1440, 2960) mDisplayRotationROTATION_0 mWindowingModefullscreen mDisplayWindowingModefullscreen mActivityTypeundefined mAlwaysOnTopundefined mRotationROTATION_0} s.24 fontWeightAdjustment0}mHasSurfacetrue isReadyForDisplay()true mWindowRemovalAllowedfalseFrames: parent[0,84][1440,2960] display[0,84][1440,2960] frame[0,84][1440,2960] last[0,84][1440,2960] insetsChangedfalsesurface[0,0][0,0]ContainerAnimator:mLeashSurface(nameSurface(nameee26d8d InputMethod)/0x1dbd753 - animation-leash of insets_animation)/0xf16d3fd mAnimationTypeinsets_animationAnimation: com.android.server.wm.InsetsSourceProvider$ControlAdapter3fd88f2ControlAdapter mCapturedLeashSurface(nameSurface(nameee26d8d InputMethod)/0x1dbd753 - animation-leash of insets_animation)/0xf16d3fdWindowStateAnimator{fd93b43 InputMethod}:mAnimationIsEntrancetrue mSurfaceSurface(nameInputMethod)/0x85ed5c0Surface: showntrue layer0 alpha1.0 rect(0.0,0.0) transform(1.0, 0.0, 0.0, 1.0)mDrawStateHAS_DRAWN mLastHiddenfalsemEnterAnimationPendingfalse mSystemDecorRect[0,0][0,0]mForceSeamlesslyRotatefalse seamlesslyRotate: pendingnull isOnScreentrueisVisibletruekeepClearAreas: restricted[], unrestricted[]明显看到了displayId是变化了而且window对象不是一个 这里可以考虑在SoftInputWindow的构造方法中加入相关堆栈。 日志堆栈及源码 上一个屏幕的输入法移除 systemserver发起inputmethodservice的destory bringDownServiceLocked:4744, ActiveServices (com.android.server.am) bringDownServiceIfNeededLocked:4566, ActiveServices (com.android.server.am) removeConnectionLocked:4923, ActiveServices (com.android.server.am) unbindServiceLocked:3164, ActiveServices (com.android.server.am) unbindService:12670, ActivityManagerService (com.android.server.am) unbindService:2079, ContextImpl (android.app) unbindMainConnection:450, InputMethodBindingController (com.android.server.inputmethod) unbindCurrentMethod:353, InputMethodBindingController (com.android.server.inputmethod) startInputUncheckedLocked:2843, InputMethodManagerService (com.android.server.inputmethod) startInputOrWindowGainedFocusInternalLocked:4156, InputMethodManagerService (com.android.server.inputmethod) startInputOrWindowGainedFocusInternal:3863, InputMethodManagerService (com.android.server.inputmethod) startInputOrWindowGainedFocus:3816, InputMethodManagerService (com.android.server.inputmethod) onTransact:402, IInputMethodManager$Stub (com.android.internal.view) onTransact:1957, InputMethodManagerService (com.android.server.inputmethod) execTransactInternal:1280, Binder (android.os) execTransact:1244, Binder (android.os)新的输入法service启动 realStartServiceLocked:4373, ActiveServices (com.android.server.am) bringUpServiceLocked:4228, ActiveServices (com.android.server.am) bindServiceLocked:2956, ActiveServices (com.android.server.am) bindServiceInstance:12653, ActivityManagerService (com.android.server.am) bindServiceInstance:12609, ActivityManagerService (com.android.server.am) bindServiceCommon:2035, ContextImpl (android.app) bindServiceAsUser:1974, ContextImpl (android.app) bindCurrentInputMethodService:466, InputMethodBindingController (com.android.server.inputmethod) bindCurrentInputMethodServiceMainConnection:479, InputMethodBindingController (com.android.server.inputmethod) bindCurrentMethod:400, InputMethodBindingController (com.android.server.inputmethod) startInputUncheckedLocked:2845, InputMethodManagerService (com.android.server.inputmethod) startInputOrWindowGainedFocusInternalLocked:4156, InputMethodManagerService (com.android.server.inputmethod) startInputOrWindowGainedFocusInternal:3863, InputMethodManagerService (com.android.server.inputmethod) startInputOrWindowGainedFocus:3816, InputMethodManagerService (com.android.server.inputmethod) onTransact:402, IInputMethodManager$Stub (com.android.internal.view) onTransact:1957, InputMethodManagerService (com.android.server.inputmethod) execTransactInternal:1280, Binder (android.os) execTransact:1244, Binder (android.os)这里可以看出主要是一个跨进程调用发起老的输入法service要stopdestory新的service要进行onCreate这些堆栈都是在systemserver进程打出来的。 是谁发起跨进程startInputOrWindowGainedFocus方法呢当然是app端啊输入焦点EditText那个app App端发起启动输入法 startInputInner:2379, InputMethodManager (android.view.inputmethod) startInput:665, InputMethodManager$DelegateImpl (android.view.inputmethod) startInputAsyncOnWindowFocusGain:733, InputMethodManager$DelegateImpl (android.view.inputmethod) onPostWindowFocus:141, ImeFocusController (android.view) handleWindowFocusChanged:3699, ViewRootImpl (android.view) -$$Nest$mhandleWindowFocusChanged:-1, ViewRootImpl (android.view) handleMessageImpl:5538, ViewRootImpl$ViewRootHandler (android.view) handleMessage:5452, ViewRootImpl$ViewRootHandler (android.view) dispatchMessage:106, Handler (android.os) loopOnce:201, Looper (android.os) loop:288, Looper (android.os) main:7898, ActivityThread (android.app) invoke:-1, Method (java.lang.reflect) run:548, RuntimeInit$MethodAndArgsCaller (com.android.internal.os) main:936, ZygoteInit (com.android.internal.os) 可以看到在app ViewRootImpl的handleWindowFocusChanged() 方法发起的操作 SoftInputWindow创建堆栈 LatinIME这个service的onCreate创建 init:135, SoftInputWindow (android.inputmethodservice) onCreate:1515, InputMethodService (android.inputmethodservice) onCreate:608, LatinIME (com.android.inputmethod.latin) handleCreateService:4515, ActivityThread (android.app) -$$Nest$mhandleCreateService:-1, ActivityThread (android.app) handleMessage:2162, ActivityThread$H (android.app) dispatchMessage:106, Handler (android.os) loopOnce:201, Looper (android.os) loop:288, Looper (android.os) main:7898, ActivityThread (android.app) invoke:-1, Method (java.lang.reflect) run:548, RuntimeInit$MethodAndArgsCaller (com.android.internal.os) main:936, ZygoteInit (com.android.internal.os)创建SoftInputWindow的Display确定 相关创建SoftInputWindow代码关键的是这个context看看这个context的创建流程 frameworks/base/core/java/android/app/ActivityThread.java UnsupportedAppUsageprivate void handleCreateService(CreateServiceData data) { //省略大部分ContextImpl context ContextImpl.getImpl(service.createServiceBaseContext(this, packageInfo));}调用到了createServiceBaseContext方法 frameworks/base/core/java/android/window/WindowProviderService.java /** hide */ Override public final Context createServiceBaseContext(ActivityThread mainThread,LoadedApk packageInfo) {final Context context super.createServiceBaseContext(mainThread, packageInfo);final Display display context.getSystemService(DisplayManager.class).getDisplay(getInitialDisplayId());//这里是核心关键会创建displayreturn context.createTokenContext(mWindowToken, display); }这里可以看到主要核心就是context.getSystemService(DisplayManager.class) .getDisplay(getInitialDisplayId())获取一个display这个display也就是最后决定输入在哪个屏幕的关键 这里主要通过getInitialDisplayId获取到合适的displayId frameworks/base/core/java/android/inputmethodservice/AbstractInputMethodService.java /** hide */Overridepublic final int getInitialDisplayId() {try {//这里主要调用到wms的getImeDisplayIdreturn WindowManagerGlobal.getWindowManagerService().getImeDisplayId();} catch (RemoteException e) {throw e.rethrowFromSystemServer();}}下面看看wms的getImeDisplayId frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java Overridepublic int getImeDisplayId() {synchronized (mGlobalLock) {//这里主要获取一下焦点的Display是谁final DisplayContent dc mRoot.getTopFocusedDisplayContent();//这里有个getImePolicy获取要等于DISPLAY_IME_POLICY_LOCAL才可以return dc.getImePolicy() DISPLAY_IME_POLICY_LOCAL ? dc.getDisplayId(): DEFAULT_DISPLAY;}}那现在就清楚了输入法显示在哪个Display是最后调用到了wms的中的getImeDisplayId方法这个方法主要就是获取当前谁是focused的display然后把displayid传递回去 总结 整个多屏输入法的流程涉及到了3个进程 ----焦点app发起startInputAsyncOnWindowFocusGain------systemserver stop老的servicestart新service--------输入法进程创建新的service onCreate执行-------输入法创建带有display的context--------创建对于输入法窗口带有新的display更多framework干货获取相关可以 私聊v(androidframework007) 点击这里 https://mp.weixin.qq.com/s/Qv8zjgQ0CkalKmvi8tMGaw 视频https://www.bilibili.com/video/BV1ah411d7Y3
http://www.yutouwan.com/news/252789/

相关文章:

  • 邢台做网站推广服务xly000.WordPress.cok
  • 嘉兴做微网站wordpress div layer
  • 官方网站面膜做微商微号网站开发
  • 酒楼网站模板wordpress 自动上传插件
  • 免费网站空间怎么网站建设公司名称
  • 枣庄做网站制作济南建设银行
  • 外贸网站 备案中民保险网
  • 可以做反链的网站济南电子商务网站开发
  • wordpress托管和建站网页制作和网页制作技术
  • 物流公司网站怎么做拓者设计官网网页版
  • 做画册去什么网站找素材深圳seo博客
  • 网站页面设计流程海外域名服务商
  • 最新域名2021东莞市seo网络推广企业
  • 如何自己制作一个网站中国互联网服务平台
  • 账号注册网站佛山建站怎么做
  • 个旧建设局信息公开门户网站网站建设教学方法探究
  • 建设局网站安全自查情况报告多个链接的网站怎么做的
  • php模板建站wordpress怎么添加文件验证
  • 动漫网站设计方案广州免费核酸检测点
  • 空间刷赞网站推广lnmp 502 wordpress
  • 做框架表格网站wordpress部署
  • 自做网站多少钱官网传奇
  • 合肥做网站 卫来网络wordpress快应用
  • 中山站群网站建设wordpress秒开优化
  • 做电影网站为什么要数据库中小企业网站开发
  • 共创福州网站建设网站建设头部代码
  • 网站后台怎么进入wordpress高德地图开发平台
  • 英文网站建设哪家好网站开发需求逻辑图
  • 做网站应该注意哪些方面网站的优化与网站建设有关吗
  • 学校的网站如何建设济南网络推广公司哪家好