Definition at line 20 of file IntEditTextPreference.java.
◆ IntEditTextPreference() [1/3]
| com.freerdp.freerdpcore.utils.IntEditTextPreference.IntEditTextPreference |
( |
Context |
context | ) |
|
|
inline |
◆ IntEditTextPreference() [2/3]
| com.freerdp.freerdpcore.utils.IntEditTextPreference.IntEditTextPreference |
( |
Context |
context, |
|
|
AttributeSet |
attrs |
|
) |
| |
|
inline |
◆ IntEditTextPreference() [3/3]
| com.freerdp.freerdpcore.utils.IntEditTextPreference.IntEditTextPreference |
( |
Context |
context, |
|
|
AttributeSet |
attrs, |
|
|
int |
defStyle |
|
) |
| |
|
inline |
◆ getPersistedString()
| String com.freerdp.freerdpcore.utils.IntEditTextPreference.getPersistedString |
( |
String |
defaultReturnValue | ) |
|
|
inlineprotected |
Definition at line 71 of file IntEditTextPreference.java.
72 {
73 int value = getPersistedInt(-1);
74 if (value > bounds_max || value < bounds_min)
75 value = bounds_default;
76 return String.valueOf(value);
77 }
◆ persistString()
| boolean com.freerdp.freerdpcore.utils.IntEditTextPreference.persistString |
( |
String |
value | ) |
|
|
inlineprotected |
◆ setBounds()
| void com.freerdp.freerdpcore.utils.IntEditTextPreference.setBounds |
( |
int |
min, |
|
|
int |
max, |
|
|
int |
defaultValue |
|
) |
| |
|
inline |
Definition at line 64 of file IntEditTextPreference.java.
65 {
66 bounds_min = min;
67 bounds_max = max;
68 bounds_default = defaultValue;
69 }
◆ setText()
| void com.freerdp.freerdpcore.utils.IntEditTextPreference.setText |
( |
String |
text | ) |
|
|
inline |
Definition at line 84 of file IntEditTextPreference.java.
85 {
86 String valueToSave = getText();
87
88 try
89 {
90 int parsed = Integer.parseInt(text);
91 if (parsed >= bounds_min && parsed <= bounds_max)
92 {
93 valueToSave = text;
94 }
95 }
96 catch (Exception ignored)
97 {
98 }
99
100 if (valueToSave == null)
101 {
102 valueToSave = String.valueOf(bounds_default);
103 }
104
105 super.setText(valueToSave);
106 }
The documentation for this class was generated from the following file: