summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-04-01 07:22:56 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-04-01 07:22:56 +0000
commit80d171d3892bf31864f9f6486cd1e02ff90d2de2 (patch)
tree89f71a0e82d1c71c9c1749cdaffd0a2194bd10c4
parentb2b8f62e524a279c37d48e076bde630a8f6d4345 (diff)
parent438515f24828cc070e11839638e6266e1df32f20 (diff)
downloadpackages_apps_PhoneCommon-80d171d3892bf31864f9f6486cd1e02ff90d2de2.tar.gz
packages_apps_PhoneCommon-80d171d3892bf31864f9f6486cd1e02ff90d2de2.tar.bz2
packages_apps_PhoneCommon-80d171d3892bf31864f9f6486cd1e02ff90d2de2.zip
Snap for 4693621 from 438515f24828cc070e11839638e6266e1df32f20 to pi-release
Change-Id: I7ffa42b6e93159bb901a1c9ed7c9e6cadf04b583
-rw-r--r--src/com/android/phone/common/widget/ResizingTextEditText.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/com/android/phone/common/widget/ResizingTextEditText.java b/src/com/android/phone/common/widget/ResizingTextEditText.java
index 56a30e7..aa9fa68 100644
--- a/src/com/android/phone/common/widget/ResizingTextEditText.java
+++ b/src/com/android/phone/common/widget/ResizingTextEditText.java
@@ -30,6 +30,7 @@ import com.android.phone.common.util.ViewUtil;
public class ResizingTextEditText extends EditText {
private final int mOriginalTextSize;
private final int mMinTextSize;
+ private boolean mIsResizeEnabled = true;
public ResizingTextEditText(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -43,12 +44,20 @@ public class ResizingTextEditText extends EditText {
@Override
protected void onTextChanged(CharSequence text, int start, int lengthBefore, int lengthAfter) {
super.onTextChanged(text, start, lengthBefore, lengthAfter);
- ViewUtil.resizeText(this, mOriginalTextSize, mMinTextSize);
+ if (mIsResizeEnabled) {
+ ViewUtil.resizeText(this, mOriginalTextSize, mMinTextSize);
+ }
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
- ViewUtil.resizeText(this, mOriginalTextSize, mMinTextSize);
+ if (mIsResizeEnabled) {
+ ViewUtil.resizeText(this, mOriginalTextSize, mMinTextSize);
+ }
+ }
+
+ public void setResizeEnabled(boolean isEnabled) {
+ mIsResizeEnabled = isEnabled;
}
}