Loading api/current.xml +30 −0 Original line number Diff line number Diff line Loading @@ -173225,6 +173225,21 @@ <parameter name="direction" type="int"> </parameter> </method> <method name="dispatchVisibilityChanged" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="protected" > <parameter name="changedView" type="android.view.View"> </parameter> <parameter name="visibility" type="int"> </parameter> </method> <method name="dispatchWindowFocusChanged" return="void" abstract="false" Loading Loading @@ -175085,6 +175100,21 @@ <parameter name="event" type="android.view.MotionEvent"> </parameter> </method> <method name="onVisibilityChanged" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="protected" > <parameter name="changedView" type="android.view.View"> </parameter> <parameter name="visibility" type="int"> </parameter> </method> <method name="onWindowFocusChanged" return="void" abstract="false" core/java/android/test/InstrumentationTestCase.java +0 −36 Original line number Diff line number Diff line Loading @@ -147,42 +147,6 @@ public class InstrumentationTestCase extends TestCase { } } @Override public void runBare() throws Throwable { runMethod("setUp"); try { runTest(); } finally { runMethod("tearDown"); } } private Throwable[] runMethod(String name) throws Throwable { final Throwable[] exceptions = new Throwable[1]; final Method m = getClass().getMethod(name, (Class[]) null); if (m.isAnnotationPresent(UiThreadTest.class)) { getInstrumentation().runOnMainSync(new Runnable() { public void run() { try { m.invoke(InstrumentationTestCase.this); } catch (Throwable throwable) { exceptions[0] = throwable; } } }); if (exceptions[0] != null) { throw exceptions[0]; } exceptions[0] = null; } else { m.invoke(this); } return exceptions; } /** * Runs the current unit test. If the unit test is annotated with * {@link android.test.UiThreadTest}, the test is run on the UI thread. Loading core/java/android/view/View.java +24 −0 Original line number Diff line number Diff line Loading @@ -3770,6 +3770,26 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility return mAttachInfo != null && mAttachInfo.mHasWindowFocus; } /** * Dispatch a view visibility change down the view hierarchy. * ViewGroups should override to route to their children. * @param changedView The view whose visibility changed. Could be 'this' or * an ancestor view. * @param visibility The new visibility of changedView. */ protected void dispatchVisibilityChanged(View changedView, int visibility) { onVisibilityChanged(changedView, visibility); } /** * Called when the visibility of the view or an ancestor of the view is changed. * @param changedView The view whose visibility changed. Could be 'this' or * an ancestor view. * @param visibility The new visibility of changedView. */ protected void onVisibilityChanged(View changedView, int visibility) { } /** * Dispatch a window visibility change down the view hierarchy. * ViewGroups should override to route to their children. Loading Loading @@ -4349,6 +4369,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } } if ((changed & VISIBILITY_MASK) != 0) { dispatchVisibilityChanged(this, (flags & VISIBILITY_MASK)); } if ((changed & WILL_NOT_CACHE_DRAWING) != 0) { destroyDrawingCache(); } Loading core/java/android/view/ViewGroup.java +13 −0 Original line number Diff line number Diff line Loading @@ -680,6 +680,19 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } } /** * {@inheritDoc} */ @Override protected void dispatchVisibilityChanged(View changedView, int visibility) { super.dispatchVisibilityChanged(changedView, visibility); final int count = mChildrenCount; final View[] children = mChildren; for (int i = 0; i < count; i++) { children[i].dispatchVisibilityChanged(changedView, visibility); } } /** * {@inheritDoc} */ Loading tests/FrameworkTest/AndroidManifest.xml +7 −0 Original line number Diff line number Diff line Loading @@ -377,6 +377,13 @@ </intent-filter> </activity> <activity android:name=".view.VisibilityCallback" android:label="VisibilityCallback"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" /> </intent-filter> </activity> <activity android:name=".view.BigCache" android:label="BigCache"> <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading Loading
api/current.xml +30 −0 Original line number Diff line number Diff line Loading @@ -173225,6 +173225,21 @@ <parameter name="direction" type="int"> </parameter> </method> <method name="dispatchVisibilityChanged" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="protected" > <parameter name="changedView" type="android.view.View"> </parameter> <parameter name="visibility" type="int"> </parameter> </method> <method name="dispatchWindowFocusChanged" return="void" abstract="false" Loading Loading @@ -175085,6 +175100,21 @@ <parameter name="event" type="android.view.MotionEvent"> </parameter> </method> <method name="onVisibilityChanged" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="protected" > <parameter name="changedView" type="android.view.View"> </parameter> <parameter name="visibility" type="int"> </parameter> </method> <method name="onWindowFocusChanged" return="void" abstract="false"
core/java/android/test/InstrumentationTestCase.java +0 −36 Original line number Diff line number Diff line Loading @@ -147,42 +147,6 @@ public class InstrumentationTestCase extends TestCase { } } @Override public void runBare() throws Throwable { runMethod("setUp"); try { runTest(); } finally { runMethod("tearDown"); } } private Throwable[] runMethod(String name) throws Throwable { final Throwable[] exceptions = new Throwable[1]; final Method m = getClass().getMethod(name, (Class[]) null); if (m.isAnnotationPresent(UiThreadTest.class)) { getInstrumentation().runOnMainSync(new Runnable() { public void run() { try { m.invoke(InstrumentationTestCase.this); } catch (Throwable throwable) { exceptions[0] = throwable; } } }); if (exceptions[0] != null) { throw exceptions[0]; } exceptions[0] = null; } else { m.invoke(this); } return exceptions; } /** * Runs the current unit test. If the unit test is annotated with * {@link android.test.UiThreadTest}, the test is run on the UI thread. Loading
core/java/android/view/View.java +24 −0 Original line number Diff line number Diff line Loading @@ -3770,6 +3770,26 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility return mAttachInfo != null && mAttachInfo.mHasWindowFocus; } /** * Dispatch a view visibility change down the view hierarchy. * ViewGroups should override to route to their children. * @param changedView The view whose visibility changed. Could be 'this' or * an ancestor view. * @param visibility The new visibility of changedView. */ protected void dispatchVisibilityChanged(View changedView, int visibility) { onVisibilityChanged(changedView, visibility); } /** * Called when the visibility of the view or an ancestor of the view is changed. * @param changedView The view whose visibility changed. Could be 'this' or * an ancestor view. * @param visibility The new visibility of changedView. */ protected void onVisibilityChanged(View changedView, int visibility) { } /** * Dispatch a window visibility change down the view hierarchy. * ViewGroups should override to route to their children. Loading Loading @@ -4349,6 +4369,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } } if ((changed & VISIBILITY_MASK) != 0) { dispatchVisibilityChanged(this, (flags & VISIBILITY_MASK)); } if ((changed & WILL_NOT_CACHE_DRAWING) != 0) { destroyDrawingCache(); } Loading
core/java/android/view/ViewGroup.java +13 −0 Original line number Diff line number Diff line Loading @@ -680,6 +680,19 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } } /** * {@inheritDoc} */ @Override protected void dispatchVisibilityChanged(View changedView, int visibility) { super.dispatchVisibilityChanged(changedView, visibility); final int count = mChildrenCount; final View[] children = mChildren; for (int i = 0; i < count; i++) { children[i].dispatchVisibilityChanged(changedView, visibility); } } /** * {@inheritDoc} */ Loading
tests/FrameworkTest/AndroidManifest.xml +7 −0 Original line number Diff line number Diff line Loading @@ -377,6 +377,13 @@ </intent-filter> </activity> <activity android:name=".view.VisibilityCallback" android:label="VisibilityCallback"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" /> </intent-filter> </activity> <activity android:name=".view.BigCache" android:label="BigCache"> <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading