edittextpreference

Change EditTextPreference dialog input text color

早过忘川 提交于 2020-12-12 11:19:06
问题 I am able to change the title and summary color of my edit text preference. When you click into it I have the background dark and the buttons white. I still need to figure out how to change the actual value text. Any ideas? Would be great if I could change the color of that line too. import android.annotation.SuppressLint; import android.app.AlertDialog; import android.content.Context; import android.graphics.Typeface; import android.preference.EditTextPreference; import android.support.v4

Android how to set default value of EditTextPreference from SharedPreference?

馋奶兔 提交于 2019-12-22 06:36:54
问题 This time in the same project I'm facing a slightly challenging issue where in settings.xml file in the res/xml folder: <EditTextPreference android:key="weight" android:title="@string/update_user_weight" android:persistent="true" android:dialogTitle="@string/update_user_weight" android:dialogMessage="@string/update_user_weight_message" android:defaultValue="" /> <EditTextPreference android:key="age" android:title="@string/update_user_age" android:persistent="true" android:dialogTitle="@string

How can I check an EditTextPreference value before the User validate it?

[亡魂溺海] 提交于 2019-12-12 06:25:41
问题 I have currently a Preference in my application where the user is prompted to enter between 2 and 10 numerical values. As this feature is only available for power users and beta testers, not for public release, I decided to let them enter a CSV value. So, in my EditTextPreference, some users will enter: "1;20;30", some other will enter "1;10;10;10;10;10;10;10" etc... After, in my code, I am just splitting these values to build an array and execute my code. I have to admit that's not very

Why I can't enforce EditTextPreference to take just numbers?

本秂侑毒 提交于 2019-12-10 18:59:34
问题 GOAL: Use EditTextPreference to take a number input from an user. PROBLEM: I'm using support.v7.preference and, from what I've understood, this library bring problems to creates a custom DialogPreference (HowTo use support.v7.preference with AppCompat and potential drawbacks). Anyway I tried to create a NumberPickerPreference extending DialogPreference but I got ClassCastException . Also I found another approach: programmatically set the input type of an EditTextPreference object like below:

EditTextPreference.setText(value) not updating as expected

允我心安 提交于 2019-12-07 17:33:41
问题 I'm trying to prevent the user from entering an empty string into an EditTextPreference (in the example, catName ). I use a OnPreferenceChangeListener to detect when a change is made to the EditTextPreference , and if there is a change and the string is blank, I use the EditTextPreference.setText() command to reset to the old value. However, the new value doesn't show up properly if I reopen the EditTextPreference in the GUI (the string is blank), and if I go back into the main app, I can

EditTextPreference.setText(value) not updating as expected

≡放荡痞女 提交于 2019-12-06 00:08:44
I'm trying to prevent the user from entering an empty string into an EditTextPreference (in the example, catName ). I use a OnPreferenceChangeListener to detect when a change is made to the EditTextPreference , and if there is a change and the string is blank, I use the EditTextPreference.setText() command to reset to the old value. However, the new value doesn't show up properly if I reopen the EditTextPreference in the GUI (the string is blank), and if I go back into the main app, I can verify that a blank value is being saved to the preferences. I've verified that the if statement executes

Android how to set default value of EditTextPreference from SharedPreference?

拈花ヽ惹草 提交于 2019-12-05 10:23:47
This time in the same project I'm facing a slightly challenging issue where in settings.xml file in the res/xml folder: <EditTextPreference android:key="weight" android:title="@string/update_user_weight" android:persistent="true" android:dialogTitle="@string/update_user_weight" android:dialogMessage="@string/update_user_weight_message" android:defaultValue="" /> <EditTextPreference android:key="age" android:title="@string/update_user_age" android:persistent="true" android:dialogTitle="@string/update_user_age" android:dialogMessage="@string/update_user_age_message" android:defaultValue="" />

How do I programmatically add EditTextPreferences to my PreferenceFragment?

落花浮王杯 提交于 2019-12-04 20:17:54
问题 I am new to Android, so I need a little guidance on how to programmatically add EditTextPreference objects to my PreferenceFragment . I am pulling in a list of values from a web service. I have saved them successfully to my SharedPreferences , and I use them to generate URLs (path portion). I would like the users of my app to be able to edit these values, but after lots of searching on Google, it isn't clear to me how to programmatically add EditTextPreference objects to my PreferenceFragment

How do I programmatically add EditTextPreferences to my PreferenceFragment?

我与影子孤独终老i 提交于 2019-12-03 12:55:57
I am new to Android, so I need a little guidance on how to programmatically add EditTextPreference objects to my PreferenceFragment . I am pulling in a list of values from a web service. I have saved them successfully to my SharedPreferences , and I use them to generate URLs (path portion). I would like the users of my app to be able to edit these values, but after lots of searching on Google, it isn't clear to me how to programmatically add EditTextPreference objects to my PreferenceFragment . Please note, my PreferenceFragment is working fine for the SharedPreferences values I hard code as