Revision 5e048300
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/external/RubikFiles.java | ||
---|---|---|
26 | 26 |
import java.io.IOException; |
27 | 27 |
import java.io.InputStream; |
28 | 28 |
import java.io.OutputStream; |
29 |
import java.util.Locale; |
|
29 | 30 |
|
30 | 31 |
import android.content.Context; |
31 | 32 |
import android.graphics.Bitmap; |
... | ... | |
138 | 139 |
|
139 | 140 |
public void deleteIcon(Context context, String name) |
140 | 141 |
{ |
141 |
String filename = name.toLowerCase() + ".png"; |
|
142 |
String filename = name.toLowerCase(Locale.ENGLISH) + ".png";
|
|
142 | 143 |
boolean success = context.deleteFile(filename); |
143 | 144 |
if( !success ) android.util.Log.e("D", "failed to delete "+filename); |
144 | 145 |
else android.util.Log.e("D", "successfully deleted "+filename); |
... | ... | |
148 | 149 |
|
149 | 150 |
public void deleteJsonObject(Context context, String name) |
150 | 151 |
{ |
151 |
String filename = name.toLowerCase() + "_object.json"; |
|
152 |
String filename = name.toLowerCase(Locale.ENGLISH) + "_object.json";
|
|
152 | 153 |
boolean success = context.deleteFile(filename); |
153 | 154 |
if( !success ) android.util.Log.e("D", "failed to delete "+filename); |
154 | 155 |
else android.util.Log.e("D", "successfully deleted "+filename); |
... | ... | |
158 | 159 |
|
159 | 160 |
public void deleteJsonExtras(Context context, String name) |
160 | 161 |
{ |
161 |
String filename = name.toLowerCase() + "_extras.json"; |
|
162 |
String filename = name.toLowerCase(Locale.ENGLISH) + "_extras.json";
|
|
162 | 163 |
boolean success = context.deleteFile(filename); |
163 | 164 |
if( !success ) android.util.Log.e("D", "failed to delete "+filename); |
164 | 165 |
else android.util.Log.e("D", "successfully deleted "+filename); |
src/main/java/org/distorted/external/RubikUpdates.java | ||
---|---|---|
21 | 21 |
|
22 | 22 |
import java.io.InputStream; |
23 | 23 |
import java.util.ArrayList; |
24 |
import java.util.Locale; |
|
24 | 25 |
|
25 | 26 |
import android.content.Context; |
26 | 27 |
import android.graphics.Bitmap; |
... | ... | |
117 | 118 |
|
118 | 119 |
if( oMinor>=0 && eMinor>=0 && oPercent>=0 ) |
119 | 120 |
{ |
120 |
int objOrdinal = RubikObjectList.getOrdinal(shortName.toUpperCase()); |
|
121 |
String upperName = shortName.toUpperCase(Locale.ENGLISH); |
|
122 |
int objOrdinal = RubikObjectList.getOrdinal(upperName); |
|
121 | 123 |
boolean updateO=true, updateE=true; |
122 | 124 |
|
123 | 125 |
if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "downloaded object "+shortName+" oMinor="+oMinor+" eMinor="+eMinor); |
src/main/java/org/distorted/main/RubikActivity.java | ||
---|---|---|
669 | 669 |
TwistyObject currObject = getObject(); |
670 | 670 |
String name = currObject.getShortName(); |
671 | 671 |
|
672 |
if( name.toLowerCase().equals(shortName) ) |
|
672 |
if( name.toLowerCase(Locale.ENGLISH).equals(shortName) )
|
|
673 | 673 |
{ |
674 | 674 |
RubikObject object = RubikObjectList.getObject(name); |
675 | 675 |
|
src/main/java/org/distorted/objects/RubikObject.java | ||
---|---|---|
63 | 63 |
int ordinal= type.ordinal(); |
64 | 64 |
|
65 | 65 |
mUpperName = type.name(); |
66 |
mLowerName = type.name().toLowerCase(); |
|
66 |
mLowerName = type.name().toLowerCase(Locale.ENGLISH);
|
|
67 | 67 |
mNumScramble = type.getNumScramble(); |
68 | 68 |
|
69 | 69 |
mIconID = type.getIconID(); |
src/main/java/org/distorted/objects/RubikObjectList.java | ||
---|---|---|
20 | 20 |
package org.distorted.objects; |
21 | 21 |
|
22 | 22 |
import java.util.ArrayList; |
23 |
import java.util.Locale; |
|
23 | 24 |
|
24 | 25 |
import android.content.Context; |
25 | 26 |
import android.content.SharedPreferences; |
... | ... | |
454 | 455 |
{ |
455 | 456 |
if( mThis==null ) mThis = new RubikObjectList(); |
456 | 457 |
|
457 |
String lowerName = name.toLowerCase(); |
|
458 |
String lowerName = name.toLowerCase(Locale.ENGLISH);
|
|
458 | 459 |
|
459 | 460 |
for(int i=0; i<mNumObjects; i++) |
460 | 461 |
{ |
Also available in: Unified diff
Fix for a bug when in Turkey and Azerbaijan, the names of downloaded objects which contain the letter 'I' do not get translated to upper case correctly (part 2: fix 'toLowerCase()' )