mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-18 11:55:38 -04:00
Merge branch 'master' into bookmarks
# Conflicts: # android/src/org/kiwix/kiwixmobile/settings/KiwixSettingsActivity.java
This commit is contained in:
commit
5abd99909a
@ -5,6 +5,7 @@ NEW: Kiwix search home screen widget
|
||||
FIXED: Opening problem with ZIM filenames with special characters
|
||||
FIXED: Useless "w820dp" language
|
||||
FIXED: Failing he, id, yi locales
|
||||
FIXED: Non-localised setting language list sorting
|
||||
|
||||
1.99
|
||||
FIXED: ZIM load error on ICS
|
||||
|
2
README
2
README
@ -110,7 +110,7 @@ To make an APK which embeds a ZIM file:
|
||||
* In the json file, add:
|
||||
"embed_zim": true,
|
||||
* You might need to set up following env. variable:
|
||||
_JAVA_OPTIONS="\"-Xmx4096m\" \"-Xms4096m\" \"-XX:MaxPermSize=4096m\""
|
||||
_JAVA_OPTIONS="\"-Xmx4096m\" \"-Xms4096m\""
|
||||
|
||||
*********************************************************************
|
||||
*************************** CONTACT *********************************
|
||||
|
@ -34,7 +34,7 @@ import shutil
|
||||
import logging
|
||||
from io import StringIO
|
||||
import tempfile
|
||||
import urllib.request as urllib2
|
||||
import urllib2
|
||||
from collections import OrderedDict
|
||||
from subprocess import call
|
||||
PY3 = sys.version_info.major >= 3
|
||||
|
2
gradlew
vendored
2
gradlew
vendored
@ -7,7 +7,7 @@
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS="\"-Xmx4096m\" \"-Xms4096m\" \"-XX:MaxPermSize=4096m\""
|
||||
DEFAULT_JVM_OPTS="\"-Xmx4096m\" \"-Xms4096m\""
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
@ -98,14 +98,7 @@ public class KiwixSettingsActivity extends AppCompatActivity {
|
||||
getSupportActionBar().setHomeButtonEnabled(true);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
if (toolbar != null) {
|
||||
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
onBackPressed();
|
||||
}
|
||||
});
|
||||
}
|
||||
toolbar.setNavigationOnClickListener(v -> onBackPressed());
|
||||
}
|
||||
|
||||
public static class PrefsFragment extends PreferenceFragment implements
|
||||
|
@ -40,33 +40,24 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.MissingResourceException;
|
||||
import java.text.Collator;
|
||||
import org.kiwix.kiwixmobile.utils.files.FileWriter;
|
||||
|
||||
public class LanguageUtils {
|
||||
|
||||
public static final String TAG_KIWIX = "kiwix";
|
||||
|
||||
private static HashMap<String, Locale> mLocaleMap;
|
||||
|
||||
private List<LanguageContainer> mLanguageList;
|
||||
|
||||
private List<String> mLocaleLanguageCodes;
|
||||
|
||||
private Context mContext;
|
||||
|
||||
public LanguageUtils(Context context) {
|
||||
|
||||
mContext = context;
|
||||
|
||||
mLanguageList = new ArrayList<LanguageContainer>();
|
||||
|
||||
mLocaleLanguageCodes = new ArrayList<String>();
|
||||
|
||||
getLanguageCodesFromAssets();
|
||||
|
||||
setupLanguageList();
|
||||
|
||||
sortLanguageList();
|
||||
sortLanguageList(context.getResources().getConfiguration().locale);
|
||||
}
|
||||
|
||||
public static void handleLocaleChange(Context context) {
|
||||
@ -134,12 +125,15 @@ public class LanguageUtils {
|
||||
}
|
||||
|
||||
// Sort the language list by the language name
|
||||
private void sortLanguageList() {
|
||||
private void sortLanguageList(Locale locale) {
|
||||
|
||||
Collator localeCollator = Collator.getInstance(locale);
|
||||
localeCollator.setStrength(Collator.SECONDARY);
|
||||
|
||||
Collections.sort(mLanguageList, new Comparator<LanguageContainer>() {
|
||||
@Override
|
||||
public int compare(LanguageContainer a, LanguageContainer b) {
|
||||
return a.getLanguageName().compareToIgnoreCase(b.getLanguageName());
|
||||
return localeCollator.compare(a.getLanguageName(), b.getLanguageName());
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -150,7 +144,6 @@ public class LanguageUtils {
|
||||
|
||||
for (Locale s : Locale.getAvailableLocales()) {
|
||||
if (s.getLanguage().equals(Locale.getDefault().toString())) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -281,7 +274,7 @@ public class LanguageUtils {
|
||||
exceptions.put("gu", "fonts/Lohit-Gujarati.ttf");
|
||||
exceptions.put("my", "fonts/Parabaik.ttf");
|
||||
exceptions.put("or", "fonts/Lohit-Odia.ttf");
|
||||
// These scripts could be supported via more Lohit fonts if DevaVu doesn't
|
||||
// These scripts could be supported via more Lohit fonts if DejaVu doesn't
|
||||
// support them. That is untested now as they aren't even in the language
|
||||
// menu:
|
||||
// * (no ISO code?) (Devanagari/Nagari) -- at 0% in translatewiki
|
||||
|
Loading…
x
Reference in New Issue
Block a user