summaryrefslogtreecommitdiffstats
path: root/core/java/android/widget/TextView.java
diff options
context:
space:
mode:
authorGilles Debunne <debunne@google.com>2012-02-22 14:27:12 -0800
committerGilles Debunne <debunne@google.com>2012-02-22 14:29:20 -0800
commit978a8ff842d400249b1e0de4217913fb972cb2db (patch)
tree5e0ac36ba3f9b24f6a0742963600e54f8fa4490c /core/java/android/widget/TextView.java
parent60e2186c354c30b2f75ed0ef1ba75181bd32afda (diff)
downloadframeworks_base-978a8ff842d400249b1e0de4217913fb972cb2db.zip
frameworks_base-978a8ff842d400249b1e0de4217913fb972cb2db.tar.gz
frameworks_base-978a8ff842d400249b1e0de4217913fb972cb2db.tar.bz2
Removed TextAlign in TextView
This value is not assigned anymore. Change-Id: Ic86a38acb870994ebe77a817b61aa618813e3788
Diffstat (limited to 'core/java/android/widget/TextView.java')
-rw-r--r--core/java/android/widget/TextView.java72
1 files changed, 12 insertions, 60 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index f91da47..9bad59f 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -243,10 +243,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
private static final int SIGNED = 2;
private static final int DECIMAL = 4;
- private static enum TEXT_ALIGN {
- INHERIT, GRAVITY, TEXT_START, TEXT_END, CENTER, VIEW_START, VIEW_END;
- }
-
/**
* Draw marquee text with fading edges as usual
*/
@@ -329,9 +325,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
// The alignment to pass to Layout, or null if not resolved.
private Layout.Alignment mLayoutAlignment;
- // The default value for mTextAlign.
- private TEXT_ALIGN mTextAlign = TEXT_ALIGN.INHERIT;
-
private boolean mResolvedDrawables;
/**
@@ -5658,69 +5651,28 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
physicalWidth, false);
}
- @Override
- protected void resetResolvedLayoutDirection() {
- super.resetResolvedLayoutDirection();
-
- if (mLayoutAlignment != null &&
- (mTextAlign == TEXT_ALIGN.VIEW_START ||
- mTextAlign == TEXT_ALIGN.VIEW_END)) {
- mLayoutAlignment = null;
- }
- }
-
private Layout.Alignment getLayoutAlignment() {
if (mLayoutAlignment == null) {
- Layout.Alignment alignment;
- TEXT_ALIGN textAlign = mTextAlign;
- switch (textAlign) {
- case INHERIT:
- // fall through to gravity temporarily
- // intention is to inherit value through view hierarchy.
- case GRAVITY:
- switch (mGravity & Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK) {
- case Gravity.START:
- alignment = Layout.Alignment.ALIGN_NORMAL;
- break;
- case Gravity.END:
- alignment = Layout.Alignment.ALIGN_OPPOSITE;
- break;
- case Gravity.LEFT:
- alignment = Layout.Alignment.ALIGN_LEFT;
- break;
- case Gravity.RIGHT:
- alignment = Layout.Alignment.ALIGN_RIGHT;
- break;
- case Gravity.CENTER_HORIZONTAL:
- alignment = Layout.Alignment.ALIGN_CENTER;
- break;
- default:
- alignment = Layout.Alignment.ALIGN_NORMAL;
- break;
- }
- break;
- case TEXT_START:
- alignment = Layout.Alignment.ALIGN_NORMAL;
+ switch (mGravity & Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK) {
+ case Gravity.START:
+ mLayoutAlignment = Layout.Alignment.ALIGN_NORMAL;
break;
- case TEXT_END:
- alignment = Layout.Alignment.ALIGN_OPPOSITE;
+ case Gravity.END:
+ mLayoutAlignment = Layout.Alignment.ALIGN_OPPOSITE;
break;
- case CENTER:
- alignment = Layout.Alignment.ALIGN_CENTER;
+ case Gravity.LEFT:
+ mLayoutAlignment = Layout.Alignment.ALIGN_LEFT;
break;
- case VIEW_START:
- alignment = (getResolvedLayoutDirection() == LAYOUT_DIRECTION_RTL) ?
- Layout.Alignment.ALIGN_RIGHT : Layout.Alignment.ALIGN_LEFT;
+ case Gravity.RIGHT:
+ mLayoutAlignment = Layout.Alignment.ALIGN_RIGHT;
break;
- case VIEW_END:
- alignment = (getResolvedLayoutDirection() == LAYOUT_DIRECTION_RTL) ?
- Layout.Alignment.ALIGN_LEFT : Layout.Alignment.ALIGN_RIGHT;
+ case Gravity.CENTER_HORIZONTAL:
+ mLayoutAlignment = Layout.Alignment.ALIGN_CENTER;
break;
default:
- alignment = Layout.Alignment.ALIGN_NORMAL;
+ mLayoutAlignment = Layout.Alignment.ALIGN_NORMAL;
break;
}
- mLayoutAlignment = alignment;
}
return mLayoutAlignment;
}