Merge "Update background text images in recovery"
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 111 KiB |
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 191 KiB After Width: | Height: | Size: 192 KiB |
Before Width: | Height: | Size: 171 KiB After Width: | Height: | Size: 172 KiB |
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 437 KiB After Width: | Height: | Size: 379 KiB |
Before Width: | Height: | Size: 407 KiB After Width: | Height: | Size: 347 KiB |
Before Width: | Height: | Size: 238 KiB After Width: | Height: | Size: 145 KiB |
Before Width: | Height: | Size: 258 KiB After Width: | Height: | Size: 252 KiB |
Before Width: | Height: | Size: 174 KiB After Width: | Height: | Size: 169 KiB |
Before Width: | Height: | Size: 597 KiB After Width: | Height: | Size: 606 KiB |
Before Width: | Height: | Size: 556 KiB After Width: | Height: | Size: 568 KiB |
Before Width: | Height: | Size: 325 KiB After Width: | Height: | Size: 315 KiB |
|
@ -38,6 +38,7 @@ import java.io.FileOutputStream;
|
|||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
|
||||
|
@ -148,11 +149,28 @@ public class Main extends Activity {
|
|||
mText = (TextView) findViewById(R.id.text);
|
||||
|
||||
String[] localeNames = getAssets().getLocales();
|
||||
Arrays.sort(localeNames);
|
||||
Arrays.sort(localeNames, new Comparator<String>() {
|
||||
// Override the string comparator so that en is sorted behind en_US.
|
||||
// As a result, en_US will be matched first in recovery.
|
||||
@Override
|
||||
public int compare(String s1, String s2) {
|
||||
if (s1.equals(s2)) {
|
||||
return 0;
|
||||
} else if (s1.startsWith(s2)) {
|
||||
return -1;
|
||||
} else if (s2.startsWith(s1)) {
|
||||
return 1;
|
||||
}
|
||||
return s1.compareTo(s2);
|
||||
}
|
||||
});
|
||||
|
||||
ArrayList<Locale> locales = new ArrayList<Locale>();
|
||||
for (String localeName : localeNames) {
|
||||
Log.i(TAG, "locale = " + localeName);
|
||||
locales.add(Locale.forLanguageTag(localeName));
|
||||
if (!localeName.isEmpty()) {
|
||||
locales.add(Locale.forLanguageTag(localeName));
|
||||
}
|
||||
}
|
||||
|
||||
final Runnable seq = buildSequence(locales.toArray(new Locale[0]));
|
||||
|
|