Fix locale deprecation
This commit is contained in:
@@ -87,7 +87,7 @@ class ClientsFragment : Fragment() {
|
|||||||
override fun AlertDialog.Builder.prepare(listener: DialogInterface.OnClickListener) {
|
override fun AlertDialog.Builder.prepare(listener: DialogInterface.OnClickListener) {
|
||||||
val context = context
|
val context = context
|
||||||
val resources = resources
|
val resources = resources
|
||||||
val locale = resources.configuration.locale
|
val locale = resources.configuration.locales[0]
|
||||||
setTitle(getText(R.string.clients_stats_title).format(locale, arg.title))
|
setTitle(getText(R.string.clients_stats_title).format(locale, arg.title))
|
||||||
val format = NumberFormat.getIntegerInstance(locale)
|
val format = NumberFormat.getIntegerInstance(locale)
|
||||||
setMessage("%s\n%s\n%s".format(
|
setMessage("%s\n%s\n%s".format(
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ sealed class TetherManager(protected val parent: TetheringFragment) : Manager(),
|
|||||||
app.resources.getQuantityText(R.plurals.tethering_manage_wifi_clients, numClients).format(locale,
|
app.resources.getQuantityText(R.plurals.tethering_manage_wifi_clients, numClients).format(locale,
|
||||||
numClients)
|
numClients)
|
||||||
}
|
}
|
||||||
override val text get() = parent.resources.configuration.locale.let { locale ->
|
override val text get() = parent.resources.configuration.locales[0].let { locale ->
|
||||||
listOfNotNull(failureReason?.let { WifiApManager.failureReasonLookup(it) }, baseError, info.run {
|
listOfNotNull(failureReason?.let { WifiApManager.failureReasonLookup(it) }, baseError, info.run {
|
||||||
if (isEmpty()) null else joinToSpanned("\n") @TargetApi(30) { parcel ->
|
if (isEmpty()) null else joinToSpanned("\n") @TargetApi(30) { parcel ->
|
||||||
val info = SoftApInfo(parcel)
|
val info = SoftApInfo(parcel)
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ class WifiApDialogFragment : AlertDialogFragment<WifiApDialogFragment.Arg, WifiA
|
|||||||
override fun toString() = app.getString(R.string.wifi_ap_choose_disabled)
|
override fun toString() = app.getString(R.string.wifi_ap_choose_disabled)
|
||||||
}
|
}
|
||||||
override fun toString() = if (channel == 0) {
|
override fun toString() = if (channel == 0) {
|
||||||
val format = DecimalFormat("#.#", DecimalFormatSymbols.getInstance(app.resources.configuration.locale))
|
val format = DecimalFormat("#.#", DecimalFormatSymbols.getInstance(app.resources.configuration.locales[0]))
|
||||||
app.getString(R.string.wifi_ap_choose_G, arrayOf(
|
app.getString(R.string.wifi_ap_choose_G, arrayOf(
|
||||||
SoftApConfigurationCompat.BAND_2GHZ to 2.4,
|
SoftApConfigurationCompat.BAND_2GHZ to 2.4,
|
||||||
SoftApConfigurationCompat.BAND_5GHZ to 5,
|
SoftApConfigurationCompat.BAND_5GHZ to 5,
|
||||||
|
|||||||
@@ -69,6 +69,6 @@ class UpstreamsPreference(context: Context, attrs: AttributeSet) : Preference(co
|
|||||||
|
|
||||||
private fun onUpdate() = (context as LifecycleOwner).lifecycleScope.launchWhenStarted {
|
private fun onUpdate() = (context as LifecycleOwner).lifecycleScope.launchWhenStarted {
|
||||||
summary = context.getText(R.string.settings_service_upstream_monitor_summary).format(
|
summary = context.getText(R.string.settings_service_upstream_monitor_summary).format(
|
||||||
context.resources.configuration.locale, primary.charSequence, fallback.charSequence)
|
context.resources.configuration.locales[0], primary.charSequence, fallback.charSequence)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user