From 97c4216e082f30b57a47c3bc15100a74fa8e4897 Mon Sep 17 00:00:00 2001 From: John Spurlock Date: Fri, 14 Jun 2013 16:16:43 -0400 Subject: [PATCH] Remove unused EventHole. Change-Id: Ia83bb72c93561bdfa4d767bd78fe0dff60f5de5b --- .../systemui/statusbar/policy/EventHole.java | 82 ---------------------- 1 file changed, 82 deletions(-) delete mode 100644 packages/SystemUI/src/com/android/systemui/statusbar/policy/EventHole.java diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/EventHole.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/EventHole.java deleted file mode 100644 index aca88fe3707d..000000000000 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/EventHole.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.systemui.statusbar.policy; - -import android.content.Context; -import android.graphics.Region; -import android.util.AttributeSet; -import android.view.View; -import android.view.ViewTreeObserver; - -public class EventHole extends View implements ViewTreeObserver.OnComputeInternalInsetsListener { - private static final String TAG = "StatusBar.EventHole"; - - private boolean mWindowVis; - private int[] mLoc = new int[2]; - - public EventHole(Context context, AttributeSet attrs) { - this(context, attrs, 0); - } - - public EventHole(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs); - } - - @Override - protected void onWindowVisibilityChanged(int visibility) { - super.onWindowVisibilityChanged(visibility); - mWindowVis = visibility == View.VISIBLE; - } - - @Override - protected void onAttachedToWindow() { - super.onAttachedToWindow(); - getViewTreeObserver().addOnComputeInternalInsetsListener(this); - } - - @Override - protected void onDetachedFromWindow() { - super.onDetachedFromWindow(); - getViewTreeObserver().removeOnComputeInternalInsetsListener(this); - } - - public void onComputeInternalInsets(ViewTreeObserver.InternalInsetsInfo info) { - final boolean visible = isShown() && mWindowVis && getWidth() > 0 && getHeight() > 0; - final int[] loc = mLoc; - getLocationInWindow(loc); - final int l = loc[0]; - final int r = l + getWidth(); - final int t = loc[1]; - final int b = t + getHeight(); - - View top = this; - while (top.getParent() instanceof View) { - top = (View)top.getParent(); - } - - if (visible) { - info.setTouchableInsets( - ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION); - info.touchableRegion.set(0, 0, top.getWidth(), top.getHeight()); - info.touchableRegion.op(l, t, r, b, Region.Op.DIFFERENCE); - } else { - info.setTouchableInsets( - ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_FRAME); - } - } -} - -- 2.11.0