more crumbs
This commit is contained in:
parent
8924bdd240
commit
3101a32925
4 changed files with 23 additions and 11 deletions
|
|
@ -5,6 +5,7 @@ import android.content.Context.POWER_SERVICE
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
|
import android.os.Build.VERSION
|
||||||
import android.os.Build.VERSION_CODES
|
import android.os.Build.VERSION_CODES
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.Environment
|
import android.os.Environment
|
||||||
|
|
@ -158,14 +159,18 @@ class SettingsFragment : PreferenceFragmentCompat() {
|
||||||
version = findPreference("version")
|
version = findPreference("version")
|
||||||
version!!.summary = BuildConfig.VERSION_NAME
|
version!!.summary = BuildConfig.VERSION_NAME
|
||||||
|
|
||||||
val values = resources.getStringArray(R.array.language_values)
|
if(VERSION.SDK_INT < VERSION_CODES.TIRAMISU){
|
||||||
val entries = mutableListOf<String>()
|
val values = resources.getStringArray(R.array.language_values)
|
||||||
values.forEach {
|
val entries = mutableListOf<String>()
|
||||||
entries.add(Locale(it).getDisplayName(Locale(it)))
|
values.forEach {
|
||||||
|
entries.add(Locale(it).getDisplayName(Locale(it)))
|
||||||
|
}
|
||||||
|
language!!.entries = entries.toTypedArray()
|
||||||
|
val lang = if (values.contains(Locale.getDefault().language)) Locale.getDefault().language else "en"
|
||||||
|
editor.putString("app_language", lang)
|
||||||
|
}else{
|
||||||
|
language!!.isVisible = false
|
||||||
}
|
}
|
||||||
language!!.entries = entries.toTypedArray()
|
|
||||||
val lang = if (values.contains(Locale.getDefault().language)) Locale.getDefault().language else "en"
|
|
||||||
editor.putString("app_language", lang)
|
|
||||||
|
|
||||||
val packageName: String = requireContext().packageName
|
val packageName: String = requireContext().packageName
|
||||||
val pm = requireContext().applicationContext.getSystemService(POWER_SERVICE) as PowerManager
|
val pm = requireContext().applicationContext.getSystemService(POWER_SERVICE) as PowerManager
|
||||||
|
|
@ -239,7 +244,6 @@ class SettingsFragment : PreferenceFragmentCompat() {
|
||||||
language!!.summary = Locale(newValue.toString()).getDisplayLanguage(Locale(newValue.toString()))
|
language!!.summary = Locale(newValue.toString()).getDisplayLanguage(Locale(newValue.toString()))
|
||||||
editor.apply()
|
editor.apply()
|
||||||
AppCompatDelegate.setApplicationLocales(LocaleListCompat.forLanguageTags(newValue.toString()))
|
AppCompatDelegate.setApplicationLocales(LocaleListCompat.forLanguageTags(newValue.toString()))
|
||||||
if (Build.VERSION.SDK_INT >= VERSION_CODES.TIRAMISU) requireActivity().recreate()
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,9 +106,11 @@ class TerminalDownloadWorker(
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
outputFile.appendText("${it.out}\n")
|
if (it.out.length > 5000){
|
||||||
if (logDownloads && logFile.exists()){
|
outputFile.appendText("${it.out}\n")
|
||||||
logFile.appendText("${it.out}\n")
|
if (logDownloads && logFile.exists()){
|
||||||
|
logFile.appendText("${it.out}\n")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
notificationUtil.cancelDownloadNotification(itemId)
|
notificationUtil.cancelDownloadNotification(itemId)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,9 +91,12 @@
|
||||||
<item>lv</item>
|
<item>lv</item>
|
||||||
<item>nb</item>
|
<item>nb</item>
|
||||||
<item>pl</item>
|
<item>pl</item>
|
||||||
|
<item>pt</item>
|
||||||
<item>ru</item>
|
<item>ru</item>
|
||||||
|
<item>ro</item>
|
||||||
<item>sq</item>
|
<item>sq</item>
|
||||||
<item>tr</item>
|
<item>tr</item>
|
||||||
|
<item>ta</item>
|
||||||
<item>uk</item>
|
<item>uk</item>
|
||||||
<item>vi</item>
|
<item>vi</item>
|
||||||
<item>zh</item>
|
<item>zh</item>
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,12 @@
|
||||||
<locale android:name="lv"/>
|
<locale android:name="lv"/>
|
||||||
<locale android:name="nb-NO"/>
|
<locale android:name="nb-NO"/>
|
||||||
<locale android:name="pl"/>
|
<locale android:name="pl"/>
|
||||||
|
<locale android:name="pt_BR" />
|
||||||
<locale android:name="ru"/>
|
<locale android:name="ru"/>
|
||||||
|
<locale android:name="ro_RO"/>
|
||||||
<locale android:name="sq-AL"/>
|
<locale android:name="sq-AL"/>
|
||||||
<locale android:name="tr-TR"/>
|
<locale android:name="tr-TR"/>
|
||||||
|
<locale android:name="ta_IN"/>
|
||||||
<locale android:name="uk"/>
|
<locale android:name="uk"/>
|
||||||
<locale android:name="vi"/>
|
<locale android:name="vi"/>
|
||||||
<locale android:name="zh-CN"/>
|
<locale android:name="zh-CN"/>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue