From d6e568c4f3b30431a0086e647f38d24ffd81457a Mon Sep 17 00:00:00 2001 From: Gilles Debunne Date: Tue, 25 Jan 2011 10:14:43 -0800 Subject: Removed warnings in DynamicLayout Change-Id: Ied1c330795412d0bdcac1236b466951112fabc7d --- core/java/android/text/DynamicLayout.java | 37 ++++++++++++------------------- 1 file changed, 14 insertions(+), 23 deletions(-) (limited to 'core/java/android/text/DynamicLayout.java') diff --git a/core/java/android/text/DynamicLayout.java b/core/java/android/text/DynamicLayout.java index b6aa03a..403f20e 100644 --- a/core/java/android/text/DynamicLayout.java +++ b/core/java/android/text/DynamicLayout.java @@ -341,55 +341,47 @@ extends Layout } } - private void dump(boolean show) { - int n = getLineCount(); - - for (int i = 0; i < n; i++) { - System.out.print("line " + i + ": " + getLineStart(i) + " to " + getLineEnd(i) + " "); - - if (show) { - System.out.print(getText().subSequence(getLineStart(i), - getLineEnd(i))); - } - - System.out.println(""); - } - - System.out.println(""); - } - + @Override public int getLineCount() { return mInts.size() - 1; } + @Override public int getLineTop(int line) { return mInts.getValue(line, TOP); } + @Override public int getLineDescent(int line) { return mInts.getValue(line, DESCENT); } + @Override public int getLineStart(int line) { return mInts.getValue(line, START) & START_MASK; } + @Override public boolean getLineContainsTab(int line) { return (mInts.getValue(line, TAB) & TAB_MASK) != 0; } + @Override public int getParagraphDirection(int line) { return mInts.getValue(line, DIR) >> DIR_SHIFT; } + @Override public final Directions getLineDirections(int line) { return mObjects.getValue(line, 0); } + @Override public int getTopPadding() { return mTopPadding; } + @Override public int getBottomPadding() { return mBottomPadding; } @@ -403,11 +395,11 @@ extends Layout implements TextWatcher, SpanWatcher { public ChangeWatcher(DynamicLayout layout) { - mLayout = new WeakReference(layout); + mLayout = new WeakReference(layout); } private void reflow(CharSequence s, int where, int before, int after) { - DynamicLayout ml = (DynamicLayout) mLayout.get(); + DynamicLayout ml = mLayout.get(); if (ml != null) ml.reflow(s, where, before, after); @@ -417,7 +409,6 @@ extends Layout public void beforeTextChanged(CharSequence s, int where, int before, int after) { - ; } public void onTextChanged(CharSequence s, @@ -426,7 +417,6 @@ extends Layout } public void afterTextChanged(Editable s) { - ; } public void onSpanAdded(Spannable s, Object o, int start, int end) { @@ -447,9 +437,10 @@ extends Layout } } - private WeakReference mLayout; + private WeakReference mLayout; } + @Override public int getEllipsisStart(int line) { if (mEllipsizeAt == null) { return 0; @@ -458,6 +449,7 @@ extends Layout return mInts.getValue(line, ELLIPSIS_START); } + @Override public int getEllipsisCount(int line) { if (mEllipsizeAt == null) { return 0; @@ -494,7 +486,6 @@ extends Layout private static final int COLUMNS_ELLIPSIZE = 5; private static final int START_MASK = 0x1FFFFFFF; - private static final int DIR_MASK = 0xC0000000; private static final int DIR_SHIFT = 30; private static final int TAB_MASK = 0x20000000; -- cgit v1.1