Loading services/core/java/com/android/server/policy/ImmersiveModeConfirmation.java +22 −1 Original line number Original line Diff line number Diff line Loading @@ -36,10 +36,10 @@ import android.view.Gravity; import android.view.MotionEvent; import android.view.MotionEvent; import android.view.View; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup; import android.view.ViewTreeObserver; import android.view.WindowManager; import android.view.WindowManager; import android.view.animation.Animation; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.view.animation.AnimationUtils; import android.view.animation.DecelerateInterpolator; import android.view.animation.Interpolator; import android.view.animation.Interpolator; import android.widget.Button; import android.widget.Button; import android.widget.FrameLayout; import android.widget.FrameLayout; Loading Loading @@ -212,6 +212,25 @@ public class ImmersiveModeConfirmation { } } }; }; private ViewTreeObserver.OnComputeInternalInsetsListener mInsetsListener = new ViewTreeObserver.OnComputeInternalInsetsListener() { private final int[] mTmpInt2 = new int[2]; @Override public void onComputeInternalInsets( ViewTreeObserver.InternalInsetsInfo inoutInfo) { // Set touchable region to cover the cling layout. mClingLayout.getLocationInWindow(mTmpInt2); inoutInfo.setTouchableInsets( ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION); inoutInfo.touchableRegion.set( mTmpInt2[0], mTmpInt2[1], mTmpInt2[0] + mClingLayout.getWidth(), mTmpInt2[1] + mClingLayout.getHeight()); } }; private BroadcastReceiver mReceiver = new BroadcastReceiver() { private BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override @Override public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) { Loading @@ -238,6 +257,8 @@ public class ImmersiveModeConfirmation { mWindowManager.getDefaultDisplay().getMetrics(metrics); mWindowManager.getDefaultDisplay().getMetrics(metrics); float density = metrics.density; float density = metrics.density; getViewTreeObserver().addOnComputeInternalInsetsListener(mInsetsListener); // create the confirmation cling // create the confirmation cling mClingLayout = (ViewGroup) mClingLayout = (ViewGroup) View.inflate(getContext(), R.layout.immersive_mode_cling, null); View.inflate(getContext(), R.layout.immersive_mode_cling, null); Loading Loading
services/core/java/com/android/server/policy/ImmersiveModeConfirmation.java +22 −1 Original line number Original line Diff line number Diff line Loading @@ -36,10 +36,10 @@ import android.view.Gravity; import android.view.MotionEvent; import android.view.MotionEvent; import android.view.View; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup; import android.view.ViewTreeObserver; import android.view.WindowManager; import android.view.WindowManager; import android.view.animation.Animation; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.view.animation.AnimationUtils; import android.view.animation.DecelerateInterpolator; import android.view.animation.Interpolator; import android.view.animation.Interpolator; import android.widget.Button; import android.widget.Button; import android.widget.FrameLayout; import android.widget.FrameLayout; Loading Loading @@ -212,6 +212,25 @@ public class ImmersiveModeConfirmation { } } }; }; private ViewTreeObserver.OnComputeInternalInsetsListener mInsetsListener = new ViewTreeObserver.OnComputeInternalInsetsListener() { private final int[] mTmpInt2 = new int[2]; @Override public void onComputeInternalInsets( ViewTreeObserver.InternalInsetsInfo inoutInfo) { // Set touchable region to cover the cling layout. mClingLayout.getLocationInWindow(mTmpInt2); inoutInfo.setTouchableInsets( ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION); inoutInfo.touchableRegion.set( mTmpInt2[0], mTmpInt2[1], mTmpInt2[0] + mClingLayout.getWidth(), mTmpInt2[1] + mClingLayout.getHeight()); } }; private BroadcastReceiver mReceiver = new BroadcastReceiver() { private BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override @Override public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) { Loading @@ -238,6 +257,8 @@ public class ImmersiveModeConfirmation { mWindowManager.getDefaultDisplay().getMetrics(metrics); mWindowManager.getDefaultDisplay().getMetrics(metrics); float density = metrics.density; float density = metrics.density; getViewTreeObserver().addOnComputeInternalInsetsListener(mInsetsListener); // create the confirmation cling // create the confirmation cling mClingLayout = (ViewGroup) mClingLayout = (ViewGroup) View.inflate(getContext(), R.layout.immersive_mode_cling, null); View.inflate(getContext(), R.layout.immersive_mode_cling, null); Loading