Merge "All runnable are stopped on detach. DO NOT MERGE." into gingerbread
This commit is contained in:
committed by
Android (Google) Code Review
commit
8a6ba494a2
@@ -3815,6 +3815,18 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
||||
hideError();
|
||||
}
|
||||
|
||||
if (mBlink != null) {
|
||||
mBlink.cancel();
|
||||
}
|
||||
|
||||
if (mInsertionPointCursorController != null) {
|
||||
mInsertionPointCursorController.onDetached();
|
||||
}
|
||||
|
||||
if (mSelectionModifierCursorController != null) {
|
||||
mSelectionModifierCursorController.onDetached();
|
||||
}
|
||||
|
||||
hideControllers();
|
||||
}
|
||||
|
||||
@@ -7718,6 +7730,13 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
||||
* @param event The touch event
|
||||
*/
|
||||
public boolean onTouchEvent(MotionEvent event);
|
||||
|
||||
/**
|
||||
* Called when the view is detached from window. Perform house keeping task, such as
|
||||
* stopping Runnable thread that would otherwise keep a reference on the context, thus
|
||||
* preventing the activity to be recycled.
|
||||
*/
|
||||
public void onDetached();
|
||||
}
|
||||
|
||||
private class HandleView extends View {
|
||||
@@ -7995,12 +8014,12 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
||||
|
||||
public void hide() {
|
||||
mHandle.hide();
|
||||
TextView.this.removeCallbacks(mHider);
|
||||
removeCallbacks(mHider);
|
||||
}
|
||||
|
||||
private void hideDelayed(int msec) {
|
||||
TextView.this.removeCallbacks(mHider);
|
||||
TextView.this.postDelayed(mHider, msec);
|
||||
removeCallbacks(mHider);
|
||||
postDelayed(mHider, msec);
|
||||
}
|
||||
|
||||
public boolean isShowing() {
|
||||
@@ -8040,6 +8059,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
||||
hide();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetached() {
|
||||
removeCallbacks(mHider);
|
||||
}
|
||||
}
|
||||
|
||||
private class SelectionModifierCursorController implements CursorController {
|
||||
@@ -8197,6 +8221,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
||||
hide();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetached() {
|
||||
removeCallbacks(mHider);
|
||||
}
|
||||
}
|
||||
|
||||
private void hideInsertionPointCursorController() {
|
||||
|
||||
Reference in New Issue
Block a user