diff --git a/src/com/fsck/k9/FontSizes.java b/src/com/fsck/k9/FontSizes.java index 30df6fe0c..5a1ae2a41 100644 --- a/src/com/fsck/k9/FontSizes.java +++ b/src/com/fsck/k9/FontSizes.java @@ -30,14 +30,14 @@ public class FontSizes { private static final String MESSAGE_COMPOSE_INPUT = "fontSizeMessageComposeInput"; /* - * Values for the font sizes in DIP (device independent pixel) + * Values for the font sizes in SP (Scale-independent Pixels) */ - public static final int FONT_10DIP = 10; - public static final int FONT_12DIP = 12; + public static final int FONT_10SP = 10; + public static final int FONT_12SP = 12; public static final int SMALL = 14; // ?android:attr/textAppearanceSmall - public static final int FONT_16DIP = 16; + public static final int FONT_16SP = 16; public static final int MEDIUM = 18; // ?android:attr/textAppearanceMedium - public static final int FONT_20DIP = 20; + public static final int FONT_20SP = 20; public static final int LARGE = 22; // ?android:attr/textAppearanceLarge @@ -139,18 +139,18 @@ public class FontSizes { folderName = LARGE; folderStatus = SMALL; - messageListSubject = FONT_16DIP; + messageListSubject = FONT_16SP; messageListSender = SMALL; messageListDate = SMALL; messageListPreview = SMALL; messageViewSender = SMALL; - messageViewTo = FONT_12DIP; - messageViewCC = FONT_12DIP; - messageViewAdditionalHeaders = FONT_12DIP; - messageViewSubject = FONT_12DIP; - messageViewTime = FONT_10DIP; - messageViewDate = FONT_10DIP; + messageViewTo = FONT_12SP; + messageViewCC = FONT_12SP; + messageViewAdditionalHeaders = FONT_12SP; + messageViewSubject = FONT_12SP; + messageViewTime = FONT_10SP; + messageViewDate = FONT_10SP; messageComposeInput = MEDIUM; } diff --git a/src/com/fsck/k9/activity/Accounts.java b/src/com/fsck/k9/activity/Accounts.java index 6ede2c5bc..70206b9b9 100644 --- a/src/com/fsck/k9/activity/Accounts.java +++ b/src/com/fsck/k9/activity/Accounts.java @@ -1645,8 +1645,8 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC } - holder.description.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getAccountName()); - holder.email.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getAccountDescription()); + holder.description.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getAccountName()); + holder.email.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getAccountDescription()); if (K9.useCompactLayouts()) { holder.accountsItemLayout.setMinimumHeight(0); diff --git a/src/com/fsck/k9/activity/ChooseAccount.java b/src/com/fsck/k9/activity/ChooseAccount.java index 0c1c0041c..df2d47932 100644 --- a/src/com/fsck/k9/activity/ChooseAccount.java +++ b/src/com/fsck/k9/activity/ChooseAccount.java @@ -176,7 +176,7 @@ public class ChooseAccount extends K9ExpandableListActivity { final TextView description = (TextView) v.findViewById(R.id.description); final Account account = getAccounts()[groupPosition]; description.setText(account.getDescription()); - description.setTextSize(TypedValue.COMPLEX_UNIT_DIP, K9.getFontSizes().getAccountName()); + description.setTextSize(TypedValue.COMPLEX_UNIT_SP, K9.getFontSizes().getAccountName()); // display unavailable accounts translucent /* @@ -214,8 +214,8 @@ public class ChooseAccount extends K9ExpandableListActivity { final TextView name = (TextView) v.findViewById(R.id.name); final TextView description = (TextView) v.findViewById(R.id.description); - name.setTextSize(TypedValue.COMPLEX_UNIT_DIP, K9.getFontSizes().getAccountName()); - description.setTextSize(TypedValue.COMPLEX_UNIT_DIP, K9.getFontSizes().getAccountDescription()); + name.setTextSize(TypedValue.COMPLEX_UNIT_SP, K9.getFontSizes().getAccountName()); + description.setTextSize(TypedValue.COMPLEX_UNIT_SP, K9.getFontSizes().getAccountDescription()); name.setText(identity.getDescription()); description.setText(String.format("%s <%s>", identity.getName(), identity.getEmail())); diff --git a/src/com/fsck/k9/activity/FolderList.java b/src/com/fsck/k9/activity/FolderList.java index e225c8689..bf1f53322 100644 --- a/src/com/fsck/k9/activity/FolderList.java +++ b/src/com/fsck/k9/activity/FolderList.java @@ -1147,8 +1147,8 @@ public class FolderList extends K9ListActivity { holder.chip.setBackgroundDrawable(mAccount.generateColorChip().drawable()); holder.chip.getBackground().setAlpha(folder.unreadMessageCount == 0 ? 127 : 255); - holder.folderName.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getFolderName()); - holder.folderStatus.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getFolderStatus()); + holder.folderName.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getFolderName()); + holder.folderStatus.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getFolderStatus()); return view; diff --git a/src/com/fsck/k9/activity/LauncherShortcuts.java b/src/com/fsck/k9/activity/LauncherShortcuts.java index 58107e54d..f6e01c1ab 100644 --- a/src/com/fsck/k9/activity/LauncherShortcuts.java +++ b/src/com/fsck/k9/activity/LauncherShortcuts.java @@ -113,8 +113,8 @@ public class LauncherShortcuts extends K9ListActivity implements OnItemClickList holder.chip.setBackgroundColor(account.getChipColor()); holder.chip.getBackground().setAlpha(255); - holder.description.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getAccountName()); - holder.email.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getAccountDescription()); + holder.description.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getAccountName()); + holder.email.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getAccountDescription()); return view; } diff --git a/src/com/fsck/k9/activity/MessageCompose.java b/src/com/fsck/k9/activity/MessageCompose.java index ec08ee33e..faeca1b2c 100644 --- a/src/com/fsck/k9/activity/MessageCompose.java +++ b/src/com/fsck/k9/activity/MessageCompose.java @@ -697,13 +697,13 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc // Set font size of input controls int fontSize = mFontSizes.getMessageComposeInput(); - mToView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, fontSize); - mCcView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, fontSize); - mBccView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, fontSize); - mSubjectView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, fontSize); - mMessageContentView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, fontSize); - mQuotedText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, fontSize); - mSignatureView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, fontSize); + mToView.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSize); + mCcView.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSize); + mBccView.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSize); + mSubjectView.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSize); + mMessageContentView.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSize); + mQuotedText.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSize); + mSignatureView.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSize); } /** diff --git a/src/com/fsck/k9/activity/MessageList.java b/src/com/fsck/k9/activity/MessageList.java index 204108c92..7627a9b34 100644 --- a/src/com/fsck/k9/activity/MessageList.java +++ b/src/com/fsck/k9/activity/MessageList.java @@ -2169,15 +2169,15 @@ public class MessageList if (holder.selected != null) { holder.selected.setOnCheckedChangeListener(holder); } - holder.subject.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getMessageListSubject()); - holder.date.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getMessageListDate()); + holder.subject.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageListSubject()); + holder.date.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageListDate()); if (mTouchView) { holder.preview.setLines(mPreviewLines); - holder.preview.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getMessageListPreview()); + holder.preview.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageListPreview()); } else { - holder.from.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getMessageListSender()); + holder.from.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageListSender()); } view.setTag(holder); diff --git a/src/com/fsck/k9/preferences/GlobalSettings.java b/src/com/fsck/k9/preferences/GlobalSettings.java index 12f0c7ecf..42ad9312d 100644 --- a/src/com/fsck/k9/preferences/GlobalSettings.java +++ b/src/com/fsck/k9/preferences/GlobalSettings.java @@ -90,31 +90,31 @@ public class GlobalSettings { new V(1, new FontSizeSetting(FontSizes.SMALL)) )); s.put("fontSizeMessageListSubject", Settings.versions( - new V(1, new FontSizeSetting(FontSizes.FONT_16DIP)) + new V(1, new FontSizeSetting(FontSizes.FONT_16SP)) )); s.put("fontSizeMessageViewAdditionalHeaders", Settings.versions( - new V(1, new FontSizeSetting(FontSizes.FONT_12DIP)) + new V(1, new FontSizeSetting(FontSizes.FONT_12SP)) )); s.put("fontSizeMessageViewCC", Settings.versions( - new V(1, new FontSizeSetting(FontSizes.FONT_12DIP)) + new V(1, new FontSizeSetting(FontSizes.FONT_12SP)) )); s.put("fontSizeMessageViewContent", Settings.versions( new V(1, new WebFontSizeSetting(3)) )); s.put("fontSizeMessageViewDate", Settings.versions( - new V(1, new FontSizeSetting(FontSizes.FONT_10DIP)) + new V(1, new FontSizeSetting(FontSizes.FONT_10SP)) )); s.put("fontSizeMessageViewSender", Settings.versions( new V(1, new FontSizeSetting(FontSizes.SMALL)) )); s.put("fontSizeMessageViewSubject", Settings.versions( - new V(1, new FontSizeSetting(FontSizes.FONT_12DIP)) + new V(1, new FontSizeSetting(FontSizes.FONT_12SP)) )); s.put("fontSizeMessageViewTime", Settings.versions( - new V(1, new FontSizeSetting(FontSizes.FONT_10DIP)) + new V(1, new FontSizeSetting(FontSizes.FONT_10SP)) )); s.put("fontSizeMessageViewTo", Settings.versions( - new V(1, new FontSizeSetting(FontSizes.FONT_12DIP)) + new V(1, new FontSizeSetting(FontSizes.FONT_12SP)) )); s.put("gesturesEnabled", Settings.versions( new V(1, new BooleanSetting(true)), diff --git a/src/com/fsck/k9/preferences/Settings.java b/src/com/fsck/k9/preferences/Settings.java index 3ae1feb1d..1dd47f40e 100644 --- a/src/com/fsck/k9/preferences/Settings.java +++ b/src/com/fsck/k9/preferences/Settings.java @@ -516,12 +516,12 @@ public class Settings { super(defaultValue); Map mapping = new HashMap(); - mapping.put(FontSizes.FONT_10DIP, "tiniest"); - mapping.put(FontSizes.FONT_12DIP, "tiny"); + mapping.put(FontSizes.FONT_10SP, "tiniest"); + mapping.put(FontSizes.FONT_12SP, "tiny"); mapping.put(FontSizes.SMALL, "smaller"); - mapping.put(FontSizes.FONT_16DIP, "small"); + mapping.put(FontSizes.FONT_16SP, "small"); mapping.put(FontSizes.MEDIUM, "medium"); - mapping.put(FontSizes.FONT_20DIP, "large"); + mapping.put(FontSizes.FONT_20SP, "large"); mapping.put(FontSizes.LARGE, "larger"); mMapping = Collections.unmodifiableMap(mapping); } diff --git a/src/com/fsck/k9/view/MessageHeader.java b/src/com/fsck/k9/view/MessageHeader.java index 124335f74..371bc5905 100644 --- a/src/com/fsck/k9/view/MessageHeader.java +++ b/src/com/fsck/k9/view/MessageHeader.java @@ -94,18 +94,18 @@ public class MessageHeader extends LinearLayout { mFlagged = (CheckBox) findViewById(R.id.flagged); defaultSubjectColor = mSubjectView.getCurrentTextColor(); - mSubjectView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getMessageViewSubject()); - mTimeView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getMessageViewTime()); - mDateView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getMessageViewDate()); - mAdditionalHeadersView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getMessageViewAdditionalHeaders()); + mSubjectView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewSubject()); + mTimeView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewTime()); + mDateView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewDate()); + mAdditionalHeadersView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewAdditionalHeaders()); mAdditionalHeadersView.setVisibility(View.GONE); mAttachmentIcon.setVisibility(View.GONE); mAnsweredIcon.setVisibility(View.GONE); - mFromView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getMessageViewSender()); - mToView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getMessageViewTo()); - mCcView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getMessageViewCC()); - ((TextView) findViewById(R.id.to_label)).setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getMessageViewTo()); - ((TextView) findViewById(R.id.cc_label)).setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getMessageViewCC()); + mFromView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewSender()); + mToView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewTo()); + mCcView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewCC()); + ((TextView) findViewById(R.id.to_label)).setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewTo()); + ((TextView) findViewById(R.id.cc_label)).setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewCC()); setOnClickListener(new OnClickListener() { @Override