国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

外國做掛的網(wǎng)站是多少錢外貿(mào)營銷型網(wǎng)站建設(shè)公司

外國做掛的網(wǎng)站是多少錢,外貿(mào)營銷型網(wǎng)站建設(shè)公司,中國電力建設(shè)集團(tuán)有限公司,網(wǎng)站建設(shè)預(yù)付款問題背景 hi,粉絲朋友們: 大家好!android 10以后TaskView作為替代ActivityView的容器,在課程的分屏pip自由窗口專題也進(jìn)行了相關(guān)的詳細(xì)介紹分析。 這里再補(bǔ)充一下相關(guān)的TaskView和桌面內(nèi)嵌情況下的觸摸分析 主要問題點(diǎn)&#xff…

問題背景

hi,粉絲朋友們:
大家好!android 10以后TaskView作為替代ActivityView的容器,在課程的分屏pip自由窗口專題也進(jìn)行了相關(guān)的詳細(xì)介紹分析。
在這里插入圖片描述
這里再補(bǔ)充一下相關(guān)的TaskView和桌面內(nèi)嵌情況下的觸摸分析

在這里插入圖片描述

主要問題點(diǎn):
1、明明TaskView屬于CarLauncher的一個(gè)View,憑啥觸摸自己的TaskView事件會(huì)讓TaskView的Activity接收到
2、TaskView的Activity是怎么可以接收事件的呢?桌面怎么做到單獨(dú)只排除TaskView其他地方都可以觸摸呢?
哈哈,簡單總結(jié)就是要搞清楚TaskView觸摸響應(yīng)原理。

問題分析切入點(diǎn)

一般說道觸摸問題分析,一想到當(dāng)然是窗口和input部分的dump信息分析
1、dumpsys activity containers

#1 DefaultTaskDisplayArea type=undefined mode=fullscreen override-mode=fullscreen requested-bounds=[0,0][0,0] bounds=[0,0][1408,792]#2 Task=1000011 type=standard mode=multi-window override-mode=multi-window requested-bounds=[404,76][1408,696] bounds=[404,76][1408,696]#0 ActivityRecord{38f55a5 u10 com.android.car.mapsplaceholder/.MapsPlaceholderActivity t1000011} type=standard mode=multi-window override-mode=undefined requested-bounds=[0,0][0,0] bounds=[404,76][1408,696]#0 60a6fdf com.android.car.mapsplaceholder/com.android.car.mapsplaceholder.MapsPlaceholderActivity type=standard mode=multi-window override-mode=undefined requested-bounds=[0,0][0,0] bounds=[404,76][1408,696]#1 Task=1 type=home mode=fullscreen override-mode=undefined requested-bounds=[0,0][0,0] bounds=[0,0][1408,792]#0 Task=1000006 type=home mode=fullscreen override-mode=undefined requested-bounds=[0,0][0,0] bounds=[0,0][1408,792]#0 ActivityRecord{185661 u10 com.android.car.carlauncher/.CarLauncher t1000006} type=home mode=fullscreen override-mode=undefined requested-bounds=[0,0][0,0] bounds=[0,0][1408,792]#0 6845fdb com.android.car.carlauncher/com.android.car.carlauncher.CarLauncher type=home mode=fullscreen override-mode=undefined requested-bounds=[0,0][0,0] bounds=[0,0][1408,792]

明顯看到地圖Activity的Task,windowmode屬于multi-window
#2 Task=1000011 type=standard mode=multi-window override-mode=multi-window requested-bounds=[404,76][1408,696] bounds=[404,76][1408,696]
在CarLauncher 的Task ,windowmode為fullscreen
#1 Task=1 type=home mode=fullscreen override-mode=undefined requested-bounds=[0,0][0,0] bounds=[0,0][1408,792]

注意一下地圖的Task的bounds區(qū)域[404,76][1408,696] ,而CarLauncher的區(qū)域?qū)儆谌恋?bounds=[0,0][1408,792]
這么一看確實(shí)桌面的顯示bound是包含了地圖的Bound

所以這里可以初步理解為:

TaskView的地圖是可以獨(dú)立接受觸摸時(shí)間的,因?yàn)樗旧硎仟?dú)立的bounds區(qū)域,觸摸到了這個(gè)區(qū)域就行
但是因?yàn)楹虲arLauncher有重疊,那么CarLauncher對(duì)這個(gè)TaskView部分的區(qū)域觸摸是怎么處理的,會(huì)接受這一部分的觸摸事件嗎?畢竟這區(qū)域又是CarLauncher的一個(gè)TaskView區(qū)域,地圖Activity也只是TaskView顯示的內(nèi)容而已
哈哈,這里就需要使用我們dumpsys input來解密

adb shell dumpsys input:

Input Dispatcher State:DispatchEnabled: trueDispatchFrozen: falseInputFilterEnabled: falseFocusedDisplayId: 0FocusedApplications:displayId=0, name='ActivityRecord{38f55a5 u10 com.android.car.mapsplaceholder/.MapsPlaceholderActivity t1000011}', dispatchingTimeout=5000msFocusedWindows:displayId=0, name='60a6fdf com.android.car.mapsplaceholder/com.android.car.mapsplaceholder.MapsPlaceholderActivity'FocusRequests:displayId=0, name='60a6fdf com.android.car.mapsplaceholder/com.android.car.mapsplaceholder.MapsPlaceholderActivity' result='OK'Pointer Capture Requested: falseCurrent Window with Pointer Capture: NoneTouchStates: <no displays touched>Display: 0logicalSize=1408x792transform (ROT_0) (IDENTITY)Windows:0: name='aa0d3fc BottomCarSystemBar', id=77, displayId=0, inputConfig=NOT_FOCUSABLE | TRUSTED_OVERLAY | WATCH_OUTSIDE_TOUCH, alpha=1.00, frame=[0,696][1408,792], globalScale=1.000000, applicationInfo.name=, applicationInfo.token=<null>, touchableRegion=[0,696][1408,792], ownerPid=1375, ownerUid=10150, dispatchingTimeout=5000ms, hasToken=0x7c04338b1ad0, touchOcclusionMode=BLOCK_UNTRUSTEDtransform (ROT_0) (TRANSLATE)1.0000  0.0000  -0.00000.0000  1.0000  -696.00000.0000  0.0000  1.00001: name='e8091e TopCarSystemBar', id=76, displayId=0, inputConfig=NOT_FOCUSABLE | TRUSTED_OVERLAY | WATCH_OUTSIDE_TOUCH, alpha=1.00, frame=[0,0][1408,76], globalScale=1.000000, applicationInfo.name=, applicationInfo.token=<null>, touchableRegion=[0,0][1408,76], ownerPid=1375, ownerUid=10150, dispatchingTimeout=5000ms, hasToken=0x7c04338d6310, touchOcclusionMode=BLOCK_UNTRUSTEDtransform (ROT_0) (IDENTITY)2: name='aff2cfa com.android.car.rotary', id=101, displayId=0, inputConfig=NOT_FOCUSABLE | PREVENT_SPLITTING | TRUSTED_OVERLAY | WATCH_OUTSIDE_TOUCH, alpha=1.00, frame=[1408,76][1408,76], globalScale=1.000000, applicationInfo.name=, applicationInfo.token=<null>, touchableRegion=<empty>, ownerPid=1871, ownerUid=1010088, dispatchingTimeout=5000ms, hasToken=0x7c04338e0bd0, touchOcclusionMode=USE_OPACITYtransform (ROT_0) (TRANSLATE)1.0000  0.0000  -1408.00000.0000  1.0000  -76.00000.0000  0.0000  1.00003: name='2cdb9e1 ActivityRecordInputSink com.aospinsight.dummyaidlapp/.MainActivity', id=194, displayId=0, inputConfig=NO_INPUT_CHANNEL | NOT_VISIBLE | NOT_FOCUSABLE | NOT_TOUCHABLE, alpha=1.00, frame=[0,0][0,0], globalScale=0.000000, applicationInfo.name=, applicationInfo.token=<null>, touchableRegion=[-14079,-7919][14080,7920], ownerPid=701, ownerUid=1000, dispatchingTimeout=0ms, hasToken=<null>, touchOcclusionMode=BLOCK_UNTRUSTEDtransform (ROT_0) (IDENTITY)4: name='6845fdb com.android.car.carlauncher/com.android.car.carlauncher.CarLauncher', id=205, displayId=0, inputConfig=TRUSTED_OVERLAY, alpha=1.00, frame=[0,0][1408,792], globalScale=1.000000, applicationInfo.name=ActivityRecord{185661 u10 com.android.car.carlauncher/.CarLauncher t1000006}, applicationInfo.token=0x7c04e3536310, touchableRegion=[0,0][1408,76]|[0,76][404,696]|[0,696][1408,792], ownerPid=1658, ownerUid=1010079, dispatchingTimeout=5000ms, hasToken=0x7c04338f3cd0, touchOcclusionMode=BLOCK_UNTRUSTEDtransform (ROT_0) (IDENTITY)5: name='60a6fdf com.android.car.mapsplaceholder/com.android.car.mapsplaceholder.MapsPlaceholderActivity', id=223, displayId=0, inputConfig=0x0, alpha=1.00, frame=[404,76][1408,696], globalScale=1.000000, applicationInfo.name=ActivityRecord{38f55a5 u10 com.android.car.mapsplaceholder/.MapsPlaceholderActivity t1000011}, applicationInfo.token=0x7c04e355be70, touchableRegion=[404,76][1408,696], ownerPid=22792, ownerUid=1010122, dispatchingTimeout=5000ms, hasToken=0x7c0433933dd0, touchOcclusionMode=BLOCK_UNTRUSTEDtransform (ROT_0) (TRANSLATE)1.0000  0.0000  -404.00000.0000  1.0000  -76.00000.0000  0.0000  1.00006: name='a9ab86e ActivityRecordInputSink com.android.car.mapsplaceholder/.MapsPlaceholderActivity', id=221, displayId=0, inputConfig=NO_INPUT_CHANNEL | NOT_FOCUSABLE, alpha=1.00, frame=[404,76][404,76], globalScale=0.000000, applicationInfo.name=, applicationInfo.token=<null>, touchableRegion=[404,76][1408,696], ownerPid=701, ownerUid=1000, dispatchingTimeout=0ms, hasToken=<null>, touchOcclusionMode=BLOCK_UNTRUSTEDtransform (ROT_0) (TRANSLATE)1.0000  0.0000  -404.00000.0000  1.0000  -76.00000.0000  0.0000  1.00007: name='c2d4eae ActivityRecordInputSink com.android.car.carlauncher/.CarLauncher', id=126, displayId=0, inputConfig=NO_INPUT_CHANNEL | NOT_FOCUSABLE, alpha=1.00, frame=[0,0][0,0], globalScale=0.000000, applicationInfo.name=, applicationInfo.token=<null>, touchableRegion=[-14079,-7919][14080,7920], ownerPid=701, ownerUid=1000, dispatchingTimeout=0ms, hasToken=<null>, touchOcclusionMode=BLOCK_UNTRUSTED

這里我們只需要重點(diǎn)關(guān)注窗口4和窗口5:
–桌面Activity
4: name=‘6845fdb com.android.car.carlauncher/com.android.car.carlauncher.CarLauncher’, id=205, displayId=0, inputConfig=TRUSTED_OVERLAY, alpha=1.00, frame=[0,0][1408,792], globalScale=1.000000, applicationInfo.name=ActivityRecord{185661 u10 com.android.car.carlauncher/.CarLauncher t1000006}, applicationInfo.token=0x7c04e3536310, touchableRegion=[0,0][1408,76]|[0,76][404,696]|[0,696][1408,792], ownerPid=1658, ownerUid=1010079, dispatchingTimeout=5000ms, hasToken=0x7c04338f3cd0, touchOcclusionMode=BLOCK_UNTRUSTED
transform (ROT_0) (IDENTITY)
–地圖Activity
5: name=‘60a6fdf com.android.car.mapsplaceholder/com.android.car.mapsplaceholder.MapsPlaceholderActivity’, id=223, displayId=0, inputConfig=0x0, alpha=1.00, frame=[404,76][1408,696], globalScale=1.000000, applicationInfo.name=ActivityRecord{38f55a5 u10 com.android.car.mapsplaceholder/.MapsPlaceholderActivity t1000011}, applicationInfo.token=0x7c04e355be70, touchableRegion=[404,76][1408,696], ownerPid=22792, ownerUid=1010122, dispatchingTimeout=5000ms, hasToken=0x7c0433933dd0, touchOcclusionMode=BLOCK_UNTRUSTED
transform (ROT_0) (TRANSLATE)
1.0000 0.0000 -404.0000
0.0000 1.0000 -76.0000
0.0000 0.0000 1.0000

明顯發(fā)現(xiàn)觸摸派發(fā)window層級(jí)方面還是以桌面為頂部window,地圖為底下window,這樣其實(shí)也可以理解,我們上面的說的情況一樣,其實(shí)整個(gè)畫面都是CarLauncher的,地圖Activity也只是CarLauncher的一個(gè)View而已。所以當(dāng)然把桌面作為頂部的派發(fā)事件window完全沒有問題。
但是問題來了,桌面把fullscreen面積占了?那么怎么才可以輪到地圖Activity

大家注意看看桌面的window的這個(gè)屬性

touchableRegion=[0,0][1408,76]|[0,76][404,696]|[0,696][1408,792],
是不是有個(gè)touchableRegion,對(duì)他就是真相,他負(fù)責(zé)了劃定CarLauncher這個(gè)window可以響應(yīng)的觸摸區(qū)域,這里明顯看出,這個(gè)區(qū)域劃分了看了如下部分:

[0,76][404,696]| ----排除TaskView的的地圖Activity區(qū)域

正常地圖Activity的區(qū)域是[404,76][1408,696]從404開始到屏幕最右
[0,76][404,696]| 明顯是只從0到404就截止了

這里就說明了CarLauncher雖然在頂部,但是他的touchRegion根本沒有包含地圖Activity的區(qū)域,所以派發(fā)事件時(shí)候根本不會(huì)搶地圖Activity的,即地圖區(qū)域的事件不會(huì)派發(fā)到桌面
總結(jié):
問題關(guān)鍵找到了,就是靠touchRegion來讓CarLauncher不接受地圖Activity的Region

哪里設(shè)置的TouchRegion呢?

這里如果直接尋找比較麻煩可以用dumpsys window windows命令看看window是不是帶了
在這里插入圖片描述

下面就來分析這個(gè)桌面的TouchRegion是在哪里設(shè)置的呢?來看看對(duì)應(yīng)dump代碼
frameworks/base/services/core/java/com/android/server/wm/WindowState.java

 if (dumpAll) {pw.println(prefix + "mGivenContentInsets=" + mGivenContentInsets.toShortString(sTmpSB)+ " mGivenVisibleInsets=" + mGivenVisibleInsets.toShortString(sTmpSB));if (mTouchableInsets != 0 || mGivenInsetsPending) {pw.println(prefix + "mTouchableInsets=" + mTouchableInsets+ " mGivenInsetsPending=" + mGivenInsetsPending);Region region = new Region();getTouchableRegion(region);pw.println(prefix + "touchable region=" + region);}pw.println(prefix + "mFullConfiguration=" + getConfiguration());pw.println(prefix + "mLastReportedConfiguration=" + getLastReportedConfiguration());}//再來看看getTouchableRegion方法/** Get the touchable region in global coordinates. */void getTouchableRegion(Region outRegion) {final Rect frame = mWindowFrames.mFrame;switch (mTouchableInsets) {default:case TOUCHABLE_INSETS_FRAME:outRegion.set(frame);break;case TOUCHABLE_INSETS_CONTENT:applyInsets(outRegion, frame, mGivenContentInsets);break;case TOUCHABLE_INSETS_VISIBLE:applyInsets(outRegion, frame, mGivenVisibleInsets);break;case TOUCHABLE_INSETS_REGION: {//走的是這里outRegion.set(mGivenTouchableRegion);if (frame.left != 0 || frame.top != 0) {outRegion.translate(frame.left, frame.top);}break;}}cropRegionToRootTaskBoundsIfNeeded(outRegion);subtractTouchExcludeRegionIfNeeded(outRegion);}

那么這里的mGivenTouchableRegion是哪里設(shè)置的呢?

frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java

void setInsetsWindow(Session session, IWindow client, int touchableInsets, Rect contentInsets,Rect visibleInsets, Region touchableRegion) {int uid = Binder.getCallingUid();int pid = Binder.getCallingPid();final long origId = Binder.clearCallingIdentity();try {synchronized (mGlobalLock) {WindowState w = windowForClientLocked(session, client, false);if (DEBUG_LAYOUT) Slog.d(TAG, "setInsetsWindow " + w+ ", contentInsets=" + w.mGivenContentInsets + " -> " + contentInsets+ ", visibleInsets=" + w.mGivenVisibleInsets + " -> " + visibleInsets+ ", touchableRegion=" + w.mGivenTouchableRegion + " -> " + touchableRegion+ ", touchableInsets " + w.mTouchableInsets + " -> " + touchableInsets);if (w != null) {w.mGivenInsetsPending = false;w.mGivenContentInsets.set(contentInsets);w.mGivenVisibleInsets.set(visibleInsets);w.mGivenTouchableRegion.set(touchableRegion);//這里進(jìn)行的設(shè)置w.mTouchableInsets = touchableInsets;if (w.mGlobalScale != 1) {w.mGivenContentInsets.scale(w.mGlobalScale);w.mGivenVisibleInsets.scale(w.mGlobalScale);w.mGivenTouchableRegion.scale(w.mGlobalScale);}w.setDisplayLayoutNeeded();w.updateSourceFrame(w.getFrame());mWindowPlacerLocked.performSurfacePlacement();w.getDisplayContent().getInputMonitor().updateInputWindowsLw(true);// We need to report touchable region changes to accessibility.if (mAccessibilityController.hasCallbacks()) {mAccessibilityController.onSomeWindowResizedOrMovedWithCallingUid(uid, w.getDisplayContent().getDisplayId());}}}} finally {Binder.restoreCallingIdentity(origId);}}

那么接下來再看看誰進(jìn)行的setInsetsWindow調(diào)用:
frameworks/base/services/core/java/com/android/server/wm/Session.java

  @Overridepublic void setInsets(IWindow window, int touchableInsets,Rect contentInsets, Rect visibleInsets, Region touchableArea) {mService.setInsetsWindow(this, window, touchableInsets, contentInsets,visibleInsets, touchableArea);}

那么是誰調(diào)用了setInsets呢?

frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/TaskView.java

    public void onComputeInternalInsets(ViewTreeObserver.InternalInsetsInfo inoutInfo) {// TODO(b/176854108): Consider to move the logic into gatherTransparentRegions since this//   is dependent on the order of listener.// If there are multiple TaskViews, we'll set the touchable area as the root-view, then// subtract each TaskView from it.if (inoutInfo.touchableRegion.isEmpty()) {inoutInfo.setTouchableInsets(ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION);View root = getRootView();root.getLocationInWindow(mTmpLocation);mTmpRootRect.set(mTmpLocation[0], mTmpLocation[1], root.getWidth(), root.getHeight());inoutInfo.touchableRegion.set(mTmpRootRect);}getLocationInWindow(mTmpLocation);mTmpRect.set(mTmpLocation[0], mTmpLocation[1],mTmpLocation[0] + getWidth(), mTmpLocation[1] + getHeight());inoutInfo.touchableRegion.op(mTmpRect, Region.Op.DIFFERENCE);if (mObscuredTouchRegion != null) {inoutInfo.touchableRegion.op(mObscuredTouchRegion, Region.Op.UNION);}}

然后在調(diào)用對(duì)于的setInsets
在 performTraversals() 中進(jìn)行相關(guān)的調(diào)用操作
frameworks/base/core/java/android/view/ViewRootImpl.java
在這里插入圖片描述

setInsets
在這里插入圖片描述

更多framework干貨課程如下(需要的可以私聊馬哥 獲取優(yōu)惠 +V :androidframework007):
在這里插入圖片描述

http://m.aloenet.com.cn/news/28452.html

相關(guān)文章:

  • my77738免費(fèi)域名查詢seo薪酬水平
  • seo 刷網(wǎng)站url南平網(wǎng)站seo
  • 免費(fèi)地方門戶網(wǎng)站系統(tǒng)寧波網(wǎng)絡(luò)推廣平臺(tái)
  • 2018年做視頻網(wǎng)站網(wǎng)站seo站長工具
  • 團(tuán)購網(wǎng)站 seo微信群推廣網(wǎng)站
  • 太湖云建站網(wǎng)站建設(shè)職業(yè)培訓(xùn)機(jī)構(gòu)需要什么資質(zhì)
  • 外貿(mào)網(wǎng)站圖片素材百度網(wǎng)盟推廣怎么做
  • 網(wǎng)頁設(shè)計(jì)品牌故事昆明百度關(guān)鍵詞優(yōu)化
  • 怎么做簡單地網(wǎng)站網(wǎng)站網(wǎng)絡(luò)排名優(yōu)化方法
  • 網(wǎng)站建設(shè)合同糾紛管轄seo優(yōu)化師就業(yè)前景
  • 營銷型企業(yè)網(wǎng)站建設(shè)教案北京競(jìng)價(jià)托管代運(yùn)營
  • 做網(wǎng)站的實(shí)踐報(bào)告怎樣制作一個(gè)網(wǎng)站
  • wordpress 圖片自動(dòng)加水印東莞網(wǎng)站制作十年樂云seo
  • 石家莊做外貿(mào)網(wǎng)站軟文免費(fèi)發(fā)布平臺(tái)
  • 國際貨代做網(wǎng)站百度通用網(wǎng)址
  • 百度站長工具平臺(tái)登錄成都網(wǎng)站建設(shè)方案優(yōu)化
  • 網(wǎng)站建站系統(tǒng)站長工具搜索
  • 網(wǎng)站服務(wù)公司特點(diǎn)上海疫情又要爆發(fā)了
  • 網(wǎng)站開發(fā)總監(jiān)自助建站
  • 如何做服裝微商城網(wǎng)站建設(shè)關(guān)鍵字廣告
  • WordPress電影公司網(wǎng)站主題大連網(wǎng)站建設(shè)費(fèi)用
  • 包頭市建設(shè)工程安全監(jiān)督站網(wǎng)站萬能搜索引擎入口
  • 東莞網(wǎng)站優(yōu)化微信公眾號(hào)運(yùn)營推廣方案
  • 滾屏網(wǎng)站模板網(wǎng)站生成器
  • 分類網(wǎng)站一天做幾條合適百度平臺(tái)客服電話
  • 50個(gè)辦廠好項(xiàng)目運(yùn)城seo
  • 網(wǎng)站正能量晚上免費(fèi)軟件愛站網(wǎng)為什么不能用了
  • 網(wǎng)站建設(shè)技術(shù)分為哪些方向電子商務(wù)營銷的概念
  • 哪個(gè)公司做網(wǎng)站最好深圳百度競(jìng)價(jià)排名系統(tǒng)
  • 有服務(wù)器域名源碼怎么做網(wǎng)站平臺(tái)sem投放