am afca1ddd: Comprehensive memory deallocation
* commit 'afca1ddd233c03d79433931a0b6ba97ed22663ed': Comprehensive memory deallocationmain
commit
5f676a7311
|
@ -1228,6 +1228,6 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
|
||||||
@Override
|
@Override
|
||||||
public void deallocateMemory() {
|
public void deallocateMemory() {
|
||||||
super.deallocateMemory();
|
super.deallocateMemory();
|
||||||
mGestureTrailsDrawingPreview.deallocateMemory();
|
mDrawingPreviewPlacerView.deallocateMemory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,9 +50,7 @@ public abstract class AbstractDrawingPreview {
|
||||||
// Default implementation is empty.
|
// Default implementation is empty.
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onDetachFromWindow() {
|
public abstract void onDeallocateMemory();
|
||||||
// Default implementation is empty.
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws the preview
|
* Draws the preview
|
||||||
|
|
|
@ -59,13 +59,17 @@ public final class DrawingPreviewPlacerView extends RelativeLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void deallocateMemory() {
|
||||||
|
final int count = mPreviews.size();
|
||||||
|
for (int i = 0; i < count; i++) {
|
||||||
|
mPreviews.get(i).onDeallocateMemory();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDetachedFromWindow() {
|
protected void onDetachedFromWindow() {
|
||||||
super.onDetachedFromWindow();
|
super.onDetachedFromWindow();
|
||||||
final int count = mPreviews.size();
|
deallocateMemory();
|
||||||
for (int i = 0; i < count; i++) {
|
|
||||||
mPreviews.get(i).onDetachFromWindow();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -105,6 +105,11 @@ public class GestureFloatingTextDrawingPreview extends AbstractDrawingPreview {
|
||||||
mParams = new GesturePreviewTextParams(typedArray);
|
mParams = new GesturePreviewTextParams(typedArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDeallocateMemory() {
|
||||||
|
// Nothing to do here.
|
||||||
|
}
|
||||||
|
|
||||||
public void setSuggetedWords(final SuggestedWords suggestedWords) {
|
public void setSuggetedWords(final SuggestedWords suggestedWords) {
|
||||||
if (!isPreviewEnabled()) {
|
if (!isPreviewEnabled()) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -103,11 +103,7 @@ public final class GestureTrailsDrawingPreview extends AbstractDrawingPreview {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDetachFromWindow() {
|
public void onDeallocateMemory() {
|
||||||
freeOffscreenBuffer();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deallocateMemory() {
|
|
||||||
freeOffscreenBuffer();
|
freeOffscreenBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,11 @@ public final class SlidingKeyInputDrawingPreview extends AbstractDrawingPreview
|
||||||
mPaint.setColor(previewColor);
|
mPaint.setColor(previewColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDeallocateMemory() {
|
||||||
|
// Nothing to do here.
|
||||||
|
}
|
||||||
|
|
||||||
public void dismissSlidingKeyInputPreview() {
|
public void dismissSlidingKeyInputPreview() {
|
||||||
mShowsSlidingKeyInputPreview = false;
|
mShowsSlidingKeyInputPreview = false;
|
||||||
getDrawingView().invalidate();
|
getDrawingView().invalidate();
|
||||||
|
|
Loading…
Reference in New Issue