1
0
mirror of https://github.com/moparisthebest/k-9 synced 2025-02-17 07:30:16 -05:00

Control wrapping of folder names programmatically only

This removes the default settings (ellipsized, single line) from the layout
xml file and implements them programmatically.  This fixes the problem where:
You are viewing a folder list while wrapping is currently on, then you go into settings
and turn wrapping off, after which you are back at the folder list, but the
list is still wrapped.
This commit is contained in:
Joe Steele 2012-10-02 16:03:59 -04:00
parent 2c20413af6
commit d5a2c6b5c7
2 changed files with 5 additions and 2 deletions

View File

@ -33,8 +33,6 @@
android:id="@+id/folder_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="start"
android:textColor="?android:attr/textColorPrimary"
android:textAppearance="?android:attr/textAppearanceLarge" />

View File

@ -16,6 +16,7 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.PowerManager;
import android.text.Editable;
import android.text.TextUtils.TruncateAt;
import android.text.TextWatcher;
import android.util.Log;
import android.util.TypedValue;
@ -1164,6 +1165,10 @@ public class FolderList extends K9ListActivity implements OnNavigationListener {
holder.folderName.setEllipsize(null);
holder.folderName.setSingleLine(false);
}
else {
holder.folderName.setEllipsize(TruncateAt.START);
holder.folderName.setSingleLine(true);
}
holder.folderStatus.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getFolderStatus());