mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-09 05:24:44 +01:00
fix so prefs doesn't crash when pct_suffix is translated
This commit is contained in:
parent
84a291216e
commit
a055815b70
3 changed files with 9 additions and 7 deletions
|
@ -2682,7 +2682,7 @@ pouvez utiliser l\'application des Paramètres Android pour l\'allumer.</string>
|
||||||
<string name="sms_ready_text">Toucher le périphérique récepteur maintenant</string>
|
<string name="sms_ready_text">Toucher le périphérique récepteur maintenant</string>
|
||||||
|
|
||||||
<!--<string name="pct_suffix">\u0020pct.</string>-->
|
<!--<string name="pct_suffix">\u0020pct.</string>-->
|
||||||
<string name="pct_suffix">\u0020pct.</string>
|
<string name="pct_suffix">\u0020prct.</string>
|
||||||
|
|
||||||
<!--<string name="menu_rateme">Rate Crosswords</string>-->
|
<!--<string name="menu_rateme">Rate Crosswords</string>-->
|
||||||
<string name="menu_rateme">Évaluer Crosswords</string>
|
<string name="menu_rateme">Évaluer Crosswords</string>
|
||||||
|
|
|
@ -102,11 +102,10 @@
|
||||||
android:key="@string/prefs_appearance"
|
android:key="@string/prefs_appearance"
|
||||||
>
|
>
|
||||||
|
|
||||||
<!-- " pct." below must match R.string.pct_suffix -->
|
|
||||||
<org.eehouse.android.xw4.XWThumbListPreference
|
<org.eehouse.android.xw4.XWThumbListPreference
|
||||||
android:key="@string/key_thumbsize"
|
android:key="@string/key_thumbsize"
|
||||||
android:title="@string/summary_thumbsize"
|
android:title="@string/summary_thumbsize"
|
||||||
android:defaultValue="30 pct."
|
android:defaultValue="30"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<org.eehouse.android.xw4.XWSumListPreference
|
<org.eehouse.android.xw4.XWSumListPreference
|
||||||
|
|
|
@ -40,11 +40,14 @@ public class XWThumbListPreference extends XWListPreference {
|
||||||
super.onAttachedToActivity();
|
super.onAttachedToActivity();
|
||||||
|
|
||||||
CharSequence[] newEntries = new CharSequence[7];
|
CharSequence[] newEntries = new CharSequence[7];
|
||||||
int indx = 0;
|
newEntries[0] = LocUtils.getString( m_context, R.string.thumb_off );
|
||||||
newEntries[indx++] = LocUtils.getString( m_context, R.string.thumb_off );
|
CharSequence[] newEntryValues = new CharSequence[7];
|
||||||
|
newEntryValues[0] = "0";
|
||||||
String suffix = LocUtils.getString( m_context, R.string.pct_suffix );
|
String suffix = LocUtils.getString( m_context, R.string.pct_suffix );
|
||||||
for ( int pct = 20; pct <= 45; pct += 5 ) {
|
for ( int ii = 1; ii < newEntries.length; ++ii ) {
|
||||||
newEntries[indx++] = String.format( "%d%s", pct, suffix );
|
int pct = 15 + (ii * 5);
|
||||||
|
newEntries[ii] = String.format( "%d%s", pct, suffix );
|
||||||
|
newEntryValues[ii] = String.format( "%d", pct );
|
||||||
}
|
}
|
||||||
setEntries( newEntries );
|
setEntries( newEntries );
|
||||||
setEntryValues( newEntries );
|
setEntryValues( newEntries );
|
||||||
|
|
Loading…
Reference in a new issue