summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorwangqi <wangqi@google.com>2017-12-14 11:16:32 -0800
committerCopybara-Service <copybara-piper@google.com>2017-12-14 12:35:36 -0800
commit2f91e94b720d579f8ca12d4f3193cfa7a999f99f (patch)
tree041bac7a18db317047e9d41f3fbd478c0cdd10d6 /java
parent21676ab40c39928c9e893972bac621b8dd5c7092 (diff)
Recycle TypedArray for AutoResizeTextView.
Bug: 70625240 Test: none PiperOrigin-RevId: 179069025 Change-Id: Iaabbe55fdbedd8ae901c6b9cf0c67be1adb31eb4
Diffstat (limited to 'java')
-rw-r--r--java/com/android/incallui/autoresizetext/AutoResizeTextView.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/java/com/android/incallui/autoresizetext/AutoResizeTextView.java b/java/com/android/incallui/autoresizetext/AutoResizeTextView.java
index 2789ceac2..487283a6b 100644
--- a/java/com/android/incallui/autoresizetext/AutoResizeTextView.java
+++ b/java/com/android/incallui/autoresizetext/AutoResizeTextView.java
@@ -21,6 +21,7 @@ import android.content.res.TypedArray;
import android.graphics.RectF;
import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
+import android.support.annotation.Nullable;
import android.text.Layout.Alignment;
import android.text.StaticLayout;
import android.text.TextPaint;
@@ -29,7 +30,6 @@ import android.util.DisplayMetrics;
import android.util.SparseIntArray;
import android.util.TypedValue;
import android.widget.TextView;
-import javax.annotation.Nullable;
/**
* A TextView that automatically scales its text to completely fill its allotted width.
@@ -82,6 +82,7 @@ public class AutoResizeTextView extends TextView {
TypedArray typedArray = context.getTheme().obtainStyledAttributes(
attrs, R.styleable.AutoResizeTextView, defStyleAttr, defStyleRes);
readAttrs(typedArray);
+ typedArray.recycle();
textPaint.set(getPaint());
}