Fixed bug: newly added apps didn't show up immediately

Now, whenever apps change visibility or are removed, we invalidate the bitmap cache for CellLayout

Change-Id: I883ea6cc07b1b09775bb7d262417acb34fbec3de
This commit is contained in:
Michael Jurka committed 2011-01-07 21:06:30 -08:00
1 parent c42d5e330a
commit 99b6a5b5f7
3 files changed
+61 -10

No files matched your search

+16 -1
View File
@@ -30,13 +30,14 @@ import android.graphics.Region.Op;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
/**
* TextView that draws a bubble behind the text. We cannot use a LineBackgroundSpan
* because we want to make the bubble taller than the text and TextView's clip is
* too aggressive.
*/
public class BubbleTextView extends CacheableTextView {
public class BubbleTextView extends CacheableTextView implements VisibilityChangedBroadcaster {
static final float CORNER_RADIUS = 4.0f;
static final float SHADOW_LARGE_RADIUS = 4.0f;
static final float SHADOW_SMALL_RADIUS = 1.75f;
@@ -64,6 +65,8 @@ public class BubbleTextView extends CacheableTextView {
private boolean mBackgroundSizeChanged;
private Drawable mBackground;
private VisibilityChangedListener mOnVisibilityChangedListener;
public BubbleTextView(Context context) {
super(context);
init();
@@ -240,6 +243,18 @@ public class BubbleTextView extends CacheableTextView {
return result;
}
public void setVisibilityChangedListener(VisibilityChangedListener listener) {
mOnVisibilityChangedListener = listener;
}
@Override
protected void onVisibilityChanged(View changedView, int visibility) {
if (mOnVisibilityChangedListener != null) {
mOnVisibilityChangedListener.receiveVisibilityChangedMessage(this);
}
super.onVisibilityChanged(changedView, visibility);
}
@Override
public void draw(Canvas canvas) {
if (mPressedOrFocusedBackground != null && (isPressed() || isFocused())) {