From fc5eb9e2819c3b606c46b1b050e28a702bd4082e Mon Sep 17 00:00:00 2001 From: serso Date: Sun, 7 Feb 2016 13:55:05 +0100 Subject: [PATCH] Make DisplayView scrollable --- .../main/java/org/solovyev/android/calculator/DisplayView.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/org/solovyev/android/calculator/DisplayView.java b/app/src/main/java/org/solovyev/android/calculator/DisplayView.java index 1dd07255..359d6daf 100644 --- a/app/src/main/java/org/solovyev/android/calculator/DisplayView.java +++ b/app/src/main/java/org/solovyev/android/calculator/DisplayView.java @@ -27,6 +27,7 @@ import android.content.Context; import android.content.res.Resources; import android.support.annotation.NonNull; import android.text.TextUtils; +import android.text.method.ScrollingMovementMethod; import android.util.AttributeSet; import org.solovyev.android.Check; import org.solovyev.android.calculator.text.TextProcessor; @@ -65,6 +66,8 @@ public class DisplayView extends AutoResizeTextView { final Resources resources = getResources(); setAddEllipsis(false); setMinTextSize(applyDimension(COMPLEX_UNIT_SP, 10, resources.getDisplayMetrics())); + // make text scrollable if it doesn't fit + setMovementMethod(ScrollingMovementMethod.getInstance()); if (context instanceof Service) { return; }