Simpler edit text style preference

pull/14/head
Sam Bosley 12 years ago
parent 56ca0030f9
commit a73d34ea3a

@ -37,6 +37,7 @@
android:layout_weight="100" android:layout_weight="100"
android:scrollbars="vertical" android:scrollbars="vertical"
android:gravity="top" android:gravity="top"
android:background="@null"
android:hint="@string/TEA_notes_hint" android:hint="@string/TEA_notes_hint"
android:autoText="true" android:autoText="true"
android:capitalize="sentences" android:capitalize="sentences"

@ -72,6 +72,9 @@
<!-- account status section key --> <!-- account status section key -->
<string name="p_account">account</string> <string name="p_account">account</string>
<!-- simple input box style -->
<string name="p_simple_input_boxes">simple_input_boxes</string>
<string-array name="TEA_reminder_random_hours"> <string-array name="TEA_reminder_random_hours">
<!-- values (in hours) associated with items above. --> <!-- values (in hours) associated with items above. -->

@ -704,6 +704,9 @@
<!-- Preference: show list members in shared list --> <!-- Preference: show list members in shared list -->
<string name="EPr_show_list_members_title">Show list members in shared lists</string> <string name="EPr_show_list_members_title">Show list members in shared lists</string>
<!-- Preference: simple input box style -->
<string name="EPr_simple_input_boxes">Simple input boxes</string>
<!-- slide 30f/ 36f: Preference: Theme --> <!-- slide 30f/ 36f: Preference: Theme -->
@ -718,9 +721,6 @@
<!-- slide 30d/ 34f: Preference screen: all task row settings --> <!-- slide 30d/ 34f: Preference screen: all task row settings -->
<string name="EPr_taskRowPrefs_title">Task row appearance</string> <string name="EPr_taskRowPrefs_title">Task row appearance</string>
<!-- slide 33b/ 49e: Preference screen: Astrid Labs (experimental features)-->
<!-- slide 33f -->
<!-- slide 49g: Preferences: use the system contact picker for task assignment --> <!-- slide 49g: Preferences: use the system contact picker for task assignment -->
<string name="EPr_use_contact_picker">Use contact picker</string> <string name="EPr_use_contact_picker">Use contact picker</string>
<!-- slide 49b --> <!-- slide 49b -->

@ -52,6 +52,10 @@
<item name="vpiTabTextStyle">@style/CustomTabPageIndicator.Text</item> <item name="vpiTabTextStyle">@style/CustomTabPageIndicator.Text</item>
</style> </style>
<style name="Theme.Simple" parent="Theme">
<item name="asEditTextBackground">@null</item>
</style>
<style name="Theme.Transparent" parent="Theme"> <style name="Theme.Transparent" parent="Theme">
<item name="asContentBackground">#22000000</item> <item name="asContentBackground">#22000000</item>
<item name="abBackground">#aa000000</item> <item name="abBackground">#aa000000</item>
@ -64,6 +68,10 @@
<item name="android:colorBackgroundCacheHint">@null</item> <item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowShowWallpaper">true</item> <item name="android:windowShowWallpaper">true</item>
</style> </style>
<style name="Theme.Transparent.Simple" parent="Theme.Transparent">
<item name="asEditTextBackground">@null</item>
</style>
<style name="Theme.White" parent="@style/Theme.Sherlock.Light"> <style name="Theme.White" parent="@style/Theme.Sherlock.Light">
<item name="asContentBackground">@android:color/white</item> <item name="asContentBackground">@android:color/white</item>
@ -102,6 +110,10 @@
<item name="abLogo">@drawable/home_button_red</item> <item name="abLogo">@drawable/home_button_red</item>
</style> </style>
<style name="Theme.White.Simple" parent="Theme.White">
<item name="asEditTextBackground">@null</item>
</style>
<style name="Theme.White.Blue"> <style name="Theme.White.Blue">
<item name="asAddButtonImg">@drawable/plus_button_dark_blue</item> <item name="asAddButtonImg">@drawable/plus_button_dark_blue</item>
<item name="asMicButtonImg">@drawable/mic_button_dark_blue</item> <item name="asMicButtonImg">@drawable/mic_button_dark_blue</item>
@ -118,6 +130,10 @@
<item name="abLogo">@drawable/home_button_dark_blue</item> <item name="abLogo">@drawable/home_button_dark_blue</item>
</style> </style>
<style name="Theme.White.Blue.Simple" parent="Theme.White.Blue">
<item name="asEditTextBackground">@null</item>
</style>
<style name="Theme.TransparentWhite" parent="Theme.White.Blue"> <style name="Theme.TransparentWhite" parent="Theme.White.Blue">
<item name="asContentBackground">#22000000</item> <item name="asContentBackground">#22000000</item>
<item name="abBackground">#aa000000</item> <item name="abBackground">#aa000000</item>
@ -131,6 +147,10 @@
<item name="android:windowShowWallpaper">true</item> <item name="android:windowShowWallpaper">true</item>
</style> </style>
<style name="Theme.TransparentWhite.Simple" parent="Theme.TransparentWhite">
<item name="asEditTextBackground">@null</item>
</style>
<style name="Theme.FullTransparent" parent="@style/Theme.Sherlock"> <style name="Theme.FullTransparent" parent="@style/Theme.Sherlock">
<item name="android:windowIsTranslucent">true</item> <item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowBackground">@android:color/transparent</item>

@ -68,6 +68,11 @@
android:entryValues="@array/EPr_theme_widget_settings" android:entryValues="@array/EPr_theme_widget_settings"
android:title="@string/EPr_theme_widget_title" /> android:title="@string/EPr_theme_widget_title" />
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_simple_input_boxes"
android:title="@string/EPr_simple_input_boxes"
android:defaultValue="false"/>
<com.todoroo.astrid.ui.MultilineCheckboxPreference <com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_showSmartConfirmation_key" android:key="@string/p_showSmartConfirmation_key"
android:title="@string/EPr_showSmartConfirmation_title" android:title="@string/EPr_showSmartConfirmation_title"
@ -108,7 +113,6 @@
android:key="@string/p_use_contact_picker" android:key="@string/p_use_contact_picker"
android:title="@string/EPr_use_contact_picker"/> android:title="@string/EPr_use_contact_picker"/>
<com.todoroo.astrid.ui.MultilineCheckboxPreference <com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_voiceInputEnabled" android:key="@string/p_voiceInputEnabled"
android:title="@string/EPr_voiceInputEnabled_title" android:title="@string/EPr_voiceInputEnabled_title"

@ -640,6 +640,8 @@ public class EditPreferences extends TodorooPreferenceActivity {
public void addPreferenceListeners() { public void addPreferenceListeners() {
findPreference(getString(R.string.p_theme)).setOnPreferenceChangeListener(new SetResultOnPreferenceChangeListener(RESULT_CODE_PERFORMANCE_PREF_CHANGED)); findPreference(getString(R.string.p_theme)).setOnPreferenceChangeListener(new SetResultOnPreferenceChangeListener(RESULT_CODE_PERFORMANCE_PREF_CHANGED));
findPreference(getString(R.string.p_simple_input_boxes)).setOnPreferenceChangeListener(new SetResultOnPreferenceChangeListener(RESULT_CODE_PERFORMANCE_PREF_CHANGED));
findPreference(getString(R.string.p_fontSize)).setOnPreferenceChangeListener(new SetResultOnPreferenceChangeListener(RESULT_CODE_PERFORMANCE_PREF_CHANGED)); findPreference(getString(R.string.p_fontSize)).setOnPreferenceChangeListener(new SetResultOnPreferenceChangeListener(RESULT_CODE_PERFORMANCE_PREF_CHANGED));
findPreference(getString(R.string.p_theme_widget)).setOnPreferenceChangeListener(new OnPreferenceChangeListener() { findPreference(getString(R.string.p_theme_widget)).setOnPreferenceChangeListener(new OnPreferenceChangeListener() {

@ -49,7 +49,11 @@ public class ThemeService {
public static int getTheme() { public static int getTheme() {
String preference = Preferences.getStringValue(R.string.p_theme); String preference = Preferences.getStringValue(R.string.p_theme);
return getStyleForSetting(preference); boolean simple = Preferences.getBoolean(R.string.p_simple_input_boxes, false);
int style = getStyleForSetting(preference);
if (simple)
style = simplifyStyle(style);
return style;
} }
public static int getWidgetTheme() { public static int getWidgetTheme() {
@ -75,6 +79,23 @@ public class ThemeService {
return R.style.Theme_White_Blue; return R.style.Theme_White_Blue;
} }
private static int simplifyStyle(int original) {
switch (original) {
case R.style.Theme:
return R.style.Theme_Simple;
case R.style.Theme_Transparent:
return R.style.Theme_Transparent_Simple;
case R.style.Theme_TransparentWhite:
return R.style.Theme_TransparentWhite_Simple;
case R.style.Theme_White:
return R.style.Theme_White_Simple;
case R.style.Theme_White_Blue:
return R.style.Theme_White_Blue_Simple;
default:
return original;
}
}
public static int getThemeColor() { public static int getThemeColor() {
int theme = getTheme(); int theme = getTheme();
switch(theme) { switch(theme) {

@ -5,6 +5,7 @@
*/ */
package com.todoroo.astrid.utility; package com.todoroo.astrid.utility;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor; import android.content.SharedPreferences.Editor;
@ -162,6 +163,8 @@ public class AstridPreferences {
Preferences.setIfUnset(prefs, editor, r, R.string.p_use_filters, false); Preferences.setIfUnset(prefs, editor, r, R.string.p_use_filters, false);
Preferences.setIfUnset(prefs, editor, r, R.string.p_simple_input_boxes, true);
Preferences.setIfUnset(prefs, editor, r, R.string.p_show_list_members, false); Preferences.setIfUnset(prefs, editor, r, R.string.p_show_list_members, false);
SharedPreferences publicPrefs = getPublicPrefs(context); SharedPreferences publicPrefs = getPublicPrefs(context);

Loading…
Cancel
Save