mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-06-05 21:49:13 +02:00
Update calculator widget on locale change
This is required to toggle the digit separators automatically on locale change
This commit is contained in:
@@ -80,6 +80,14 @@
|
||||
android:resource="@xml/widget_info" />
|
||||
</receiver>
|
||||
|
||||
<receiver
|
||||
android:name=".receivers.LocaleChangeReceiver"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.LOCALE_CHANGED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<activity-alias
|
||||
android:name=".activities.SplashActivity.Red"
|
||||
android:enabled="false"
|
||||
|
@@ -0,0 +1,17 @@
|
||||
package com.simplemobiletools.calculator.receivers
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.simplemobiletools.calculator.extensions.updateWidgets
|
||||
|
||||
|
||||
class LocaleChangeReceiver : BroadcastReceiver() {
|
||||
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
if (Intent.ACTION_LOCALE_CHANGED == intent.action) {
|
||||
context.updateWidgets()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user