mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-19 20:21:45 -05:00
Refactoring: Some variable, method, and id renaming.
This commit is contained in:
parent
7028a4c167
commit
da7210d1db
@ -127,7 +127,7 @@
|
|||||||
android:summary="@string/global_settings_show_contact_name_summary" />
|
android:summary="@string/global_settings_show_contact_name_summary" />
|
||||||
|
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:key="change_registered_name_color"
|
android:key="messagelist_contact_name_color"
|
||||||
android:title="@string/global_settings_registered_name_color_label"
|
android:title="@string/global_settings_registered_name_color_label"
|
||||||
android:summary="@string/global_settings_registered_name_color_default"
|
android:summary="@string/global_settings_registered_name_color_default"
|
||||||
android:dependency="messagelist_show_contact_name" />
|
android:dependency="messagelist_show_contact_name" />
|
||||||
|
@ -142,8 +142,8 @@ public class K9 extends Application
|
|||||||
private static boolean mMessageListTouchable = false;
|
private static boolean mMessageListTouchable = false;
|
||||||
|
|
||||||
private static boolean mShowContactName = false;
|
private static boolean mShowContactName = false;
|
||||||
private static boolean mChangeRegisteredNameColor = false;
|
private static boolean mChangeContactNameColor = false;
|
||||||
private static int mRegisteredNameColor = 0xff00008f;
|
private static int mContactNameColor = 0xff00008f;
|
||||||
private static boolean mMessageViewFixedWidthFont = false;
|
private static boolean mMessageViewFixedWidthFont = false;
|
||||||
private static boolean mMessageViewReturnToList = false;
|
private static boolean mMessageViewReturnToList = false;
|
||||||
|
|
||||||
@ -382,8 +382,8 @@ public class K9 extends Application
|
|||||||
editor.putBoolean("messageListTouchable",mMessageListTouchable);
|
editor.putBoolean("messageListTouchable",mMessageListTouchable);
|
||||||
|
|
||||||
editor.putBoolean("showContactName",mShowContactName);
|
editor.putBoolean("showContactName",mShowContactName);
|
||||||
editor.putBoolean("changeRegisteredNameColor",mChangeRegisteredNameColor);
|
editor.putBoolean("changeRegisteredNameColor",mChangeContactNameColor);
|
||||||
editor.putInt("registeredNameColor",mRegisteredNameColor);
|
editor.putInt("registeredNameColor",mContactNameColor);
|
||||||
editor.putBoolean("messageViewFixedWidthFont",mMessageViewFixedWidthFont);
|
editor.putBoolean("messageViewFixedWidthFont",mMessageViewFixedWidthFont);
|
||||||
editor.putBoolean("messageViewReturnToList", mMessageViewReturnToList);
|
editor.putBoolean("messageViewReturnToList", mMessageViewReturnToList);
|
||||||
|
|
||||||
@ -423,8 +423,8 @@ public class K9 extends Application
|
|||||||
mMessageListTouchable = sprefs.getBoolean("messageListTouchable",false);
|
mMessageListTouchable = sprefs.getBoolean("messageListTouchable",false);
|
||||||
|
|
||||||
mShowContactName = sprefs.getBoolean("showContactName", false);
|
mShowContactName = sprefs.getBoolean("showContactName", false);
|
||||||
mChangeRegisteredNameColor = sprefs.getBoolean("changeRegisteredNameColor", false);
|
mChangeContactNameColor = sprefs.getBoolean("changeRegisteredNameColor", false);
|
||||||
mRegisteredNameColor = sprefs.getInt("registeredNameColor", 0xff00008f);
|
mContactNameColor = sprefs.getInt("registeredNameColor", 0xff00008f);
|
||||||
mMessageViewFixedWidthFont = sprefs.getBoolean("messageViewFixedWidthFont", false);
|
mMessageViewFixedWidthFont = sprefs.getBoolean("messageViewFixedWidthFont", false);
|
||||||
mMessageViewReturnToList = sprefs.getBoolean("messageViewReturnToList", false);
|
mMessageViewReturnToList = sprefs.getBoolean("messageViewReturnToList", false);
|
||||||
|
|
||||||
@ -701,24 +701,24 @@ public class K9 extends Application
|
|||||||
mShowContactName = showContactName;
|
mShowContactName = showContactName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean changeRegisteredNameColor()
|
public static boolean changeContactNameColor()
|
||||||
{
|
{
|
||||||
return mChangeRegisteredNameColor;
|
return mChangeContactNameColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setChangeRegisteredNameColor(boolean checkboxes)
|
public static void setChangeContactNameColor(boolean contactNameColor)
|
||||||
{
|
{
|
||||||
mChangeRegisteredNameColor = checkboxes;
|
mChangeContactNameColor = contactNameColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getRegisteredNameColor()
|
public static int getContactNameColor()
|
||||||
{
|
{
|
||||||
return mRegisteredNameColor;
|
return mContactNameColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setRegisteredNameColor(int registeredNameColor)
|
public static void setContactNameColor(int contactNameColor)
|
||||||
{
|
{
|
||||||
mRegisteredNameColor = registeredNameColor;
|
mContactNameColor = contactNameColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean messageViewFixedWidthFont()
|
public static boolean messageViewFixedWidthFont()
|
||||||
|
@ -50,7 +50,7 @@ public class Prefs extends K9PreferenceActivity
|
|||||||
private static final String PREFERENCE_MESSAGELIST_CHECKBOXES = "messagelist_checkboxes";
|
private static final String PREFERENCE_MESSAGELIST_CHECKBOXES = "messagelist_checkboxes";
|
||||||
private static final String PREFERENCE_MESSAGELIST_TOUCHABLE = "messagelist_touchable";
|
private static final String PREFERENCE_MESSAGELIST_TOUCHABLE = "messagelist_touchable";
|
||||||
private static final String PREFERENCE_MESSAGELIST_SHOW_CONTACT_NAME = "messagelist_show_contact_name";
|
private static final String PREFERENCE_MESSAGELIST_SHOW_CONTACT_NAME = "messagelist_show_contact_name";
|
||||||
private static final String PREFERENCE_CHANGE_REGISTERED_NAME_COLOR = "change_registered_name_color";
|
private static final String PREFERENCE_MESSAGELIST_CONTACT_NAME_COLOR = "messagelist_contact_name_color";
|
||||||
private static final String PREFERENCE_MESSAGEVIEW_FIXEDWIDTH = "messageview_fixedwidth_font";
|
private static final String PREFERENCE_MESSAGEVIEW_FIXEDWIDTH = "messageview_fixedwidth_font";
|
||||||
private static final String PREFERENCE_MESSAGEVIEW_RETURN_TO_LIST = "messageview_return_to_list";
|
private static final String PREFERENCE_MESSAGEVIEW_RETURN_TO_LIST = "messageview_return_to_list";
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ public class Prefs extends K9PreferenceActivity
|
|||||||
private CheckBoxPreference mCheckboxes;
|
private CheckBoxPreference mCheckboxes;
|
||||||
private CheckBoxPreference mTouchable;
|
private CheckBoxPreference mTouchable;
|
||||||
private CheckBoxPreference mShowContactName;
|
private CheckBoxPreference mShowContactName;
|
||||||
private CheckBoxPreference mChangeRegisteredNameColor;
|
private CheckBoxPreference mChangeContactNameColor;
|
||||||
private CheckBoxPreference mFixedWidth;
|
private CheckBoxPreference mFixedWidth;
|
||||||
private CheckBoxPreference mReturnToList;
|
private CheckBoxPreference mReturnToList;
|
||||||
|
|
||||||
@ -236,26 +236,26 @@ public class Prefs extends K9PreferenceActivity
|
|||||||
mShowContactName = (CheckBoxPreference)findPreference(PREFERENCE_MESSAGELIST_SHOW_CONTACT_NAME);
|
mShowContactName = (CheckBoxPreference)findPreference(PREFERENCE_MESSAGELIST_SHOW_CONTACT_NAME);
|
||||||
mShowContactName.setChecked(K9.showContactName());
|
mShowContactName.setChecked(K9.showContactName());
|
||||||
|
|
||||||
mChangeRegisteredNameColor = (CheckBoxPreference)findPreference(PREFERENCE_CHANGE_REGISTERED_NAME_COLOR);
|
mChangeContactNameColor = (CheckBoxPreference)findPreference(PREFERENCE_MESSAGELIST_CONTACT_NAME_COLOR);
|
||||||
mChangeRegisteredNameColor.setChecked(K9.changeRegisteredNameColor());
|
mChangeContactNameColor.setChecked(K9.changeContactNameColor());
|
||||||
if (K9.changeRegisteredNameColor())
|
if (K9.changeContactNameColor())
|
||||||
mChangeRegisteredNameColor.setSummary(R.string.global_settings_registered_name_color_changed);
|
mChangeContactNameColor.setSummary(R.string.global_settings_registered_name_color_changed);
|
||||||
else
|
else
|
||||||
mChangeRegisteredNameColor.setSummary(R.string.global_settings_registered_name_color_default);
|
mChangeContactNameColor.setSummary(R.string.global_settings_registered_name_color_default);
|
||||||
mChangeRegisteredNameColor.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
|
mChangeContactNameColor.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
|
||||||
{
|
{
|
||||||
public boolean onPreferenceChange(Preference preference, Object newValue)
|
public boolean onPreferenceChange(Preference preference, Object newValue)
|
||||||
{
|
{
|
||||||
if ((boolean)(Boolean)newValue == true)
|
if ((boolean)(Boolean)newValue == true)
|
||||||
{
|
{
|
||||||
onChooseRegisteredNameColor();
|
onChooseContactNameColor();
|
||||||
mChangeRegisteredNameColor.setSummary(R.string.global_settings_registered_name_color_changed);
|
mChangeContactNameColor.setSummary(R.string.global_settings_registered_name_color_changed);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mChangeRegisteredNameColor.setSummary(R.string.global_settings_registered_name_color_default);
|
mChangeContactNameColor.setSummary(R.string.global_settings_registered_name_color_default);
|
||||||
}
|
}
|
||||||
mChangeRegisteredNameColor.setChecked((Boolean)newValue);
|
mChangeContactNameColor.setChecked((Boolean)newValue);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -314,7 +314,7 @@ public class Prefs extends K9PreferenceActivity
|
|||||||
K9.setMessageListTouchable(mTouchable.isChecked());
|
K9.setMessageListTouchable(mTouchable.isChecked());
|
||||||
|
|
||||||
K9.setShowContactName(mShowContactName.isChecked());
|
K9.setShowContactName(mShowContactName.isChecked());
|
||||||
K9.setChangeRegisteredNameColor(mChangeRegisteredNameColor.isChecked());
|
K9.setChangeContactNameColor(mChangeContactNameColor.isChecked());
|
||||||
K9.setMessageViewFixedWidthFont(mFixedWidth.isChecked());
|
K9.setMessageViewFixedWidthFont(mFixedWidth.isChecked());
|
||||||
K9.setMessageViewReturnToList(mReturnToList.isChecked());
|
K9.setMessageViewReturnToList(mReturnToList.isChecked());
|
||||||
|
|
||||||
@ -358,15 +358,15 @@ public class Prefs extends K9PreferenceActivity
|
|||||||
FontSizeSettings.actionEditSettings(this);
|
FontSizeSettings.actionEditSettings(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onChooseRegisteredNameColor()
|
public void onChooseContactNameColor()
|
||||||
{
|
{
|
||||||
new ColorPickerDialog(this, new ColorPickerDialog.OnColorChangedListener()
|
new ColorPickerDialog(this, new ColorPickerDialog.OnColorChangedListener()
|
||||||
{
|
{
|
||||||
public void colorChanged(int color)
|
public void colorChanged(int color)
|
||||||
{
|
{
|
||||||
K9.setRegisteredNameColor(color);
|
K9.setContactNameColor(color);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
K9.getRegisteredNameColor()).show();
|
K9.getContactNameColor()).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -275,10 +275,10 @@ public class Address
|
|||||||
|
|
||||||
if (name != null)
|
if (name != null)
|
||||||
{
|
{
|
||||||
if (K9.changeRegisteredNameColor())
|
if (K9.changeContactNameColor())
|
||||||
{
|
{
|
||||||
final SpannableString coloredName = new SpannableString(name);
|
final SpannableString coloredName = new SpannableString(name);
|
||||||
coloredName.setSpan(new ForegroundColorSpan(K9.getRegisteredNameColor()),
|
coloredName.setSpan(new ForegroundColorSpan(K9.getContactNameColor()),
|
||||||
0,
|
0,
|
||||||
coloredName.length(),
|
coloredName.length(),
|
||||||
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
|
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user