1616
1717package com .android .systemui .statusbar .tablet ;
1818
19+ import com .android .systemui .R ;
1920import com .android .systemui .statusbar .BaseStatusBar ;
2021import com .android .systemui .statusbar .DelegateViewHelper ;
2122
@@ -37,8 +38,7 @@ public class TabletStatusBarView extends FrameLayout {
3738 private DelegateViewHelper mDelegateHelper ;
3839
3940 public TabletStatusBarView (Context context ) {
40- super (context );
41- mDelegateHelper = new DelegateViewHelper (this );
41+ this (context , null );
4242 }
4343
4444 public TabletStatusBarView (Context context , AttributeSet attrs ) {
@@ -54,6 +54,20 @@ public void setBar(BaseStatusBar phoneStatusBar) {
5454 mDelegateHelper .setBar (phoneStatusBar );
5555 }
5656
57+ @ Override
58+ protected void onFinishInflate () {
59+ super .onFinishInflate ();
60+ // Find the view we wish to grab events from in order to detect search gesture.
61+ // Depending on the device, this will be one of the id's listed below.
62+ // If we don't find one, we'll use the view provided in the constructor above (this view).
63+ View view = null ;
64+ if ((view = findViewById (R .id .navigationArea )) != null ) {
65+ mDelegateHelper .setSourceView (view );
66+ } else if ((view = findViewById (R .id .nav_buttons )) != null ) {
67+ mDelegateHelper .setSourceView (view );
68+ }
69+ }
70+
5771 @ Override
5872 public boolean onInterceptTouchEvent (MotionEvent ev ) {
5973 if (ev .getAction () == MotionEvent .ACTION_DOWN ) {
0 commit comments