diff options
Diffstat (limited to 'src/com/android/launcher3/LauncherRootView.java')
-rw-r--r-- | src/com/android/launcher3/LauncherRootView.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/com/android/launcher3/LauncherRootView.java b/src/com/android/launcher3/LauncherRootView.java index fc4de2d32..b1273b64c 100644 --- a/src/com/android/launcher3/LauncherRootView.java +++ b/src/com/android/launcher3/LauncherRootView.java @@ -29,6 +29,7 @@ public class LauncherRootView extends InsettableFrameLayout { private int mRightInsetBarWidth; private View mAlignedView; + private WindowStateListener mWindowStateListener; public LauncherRootView(Context context, AttributeSet attrs) { super(context, attrs); @@ -117,4 +118,31 @@ public class LauncherRootView extends InsettableFrameLayout { } } } + + public void setWindowStateListener(WindowStateListener listener) { + mWindowStateListener = listener; + } + + @Override + public void onWindowFocusChanged(boolean hasWindowFocus) { + super.onWindowFocusChanged(hasWindowFocus); + if (mWindowStateListener != null) { + mWindowStateListener.onWindowFocusChanged(hasWindowFocus); + } + } + + @Override + protected void onWindowVisibilityChanged(int visibility) { + super.onWindowVisibilityChanged(visibility); + if (mWindowStateListener != null) { + mWindowStateListener.onWindowVisibilityChanged(visibility); + } + } + + public interface WindowStateListener { + + void onWindowFocusChanged(boolean hasFocus); + + void onWindowVisibilityChanged(int visibility); + } }
\ No newline at end of file |