summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/foundation/e/privacycentralapp/widget/WidgetCommandReceiver.kt12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/src/main/java/foundation/e/privacycentralapp/widget/WidgetCommandReceiver.kt b/app/src/main/java/foundation/e/privacycentralapp/widget/WidgetCommandReceiver.kt
index a4e3079..831c06f 100644
--- a/app/src/main/java/foundation/e/privacycentralapp/widget/WidgetCommandReceiver.kt
+++ b/app/src/main/java/foundation/e/privacycentralapp/widget/WidgetCommandReceiver.kt
@@ -20,14 +20,22 @@ package foundation.e.privacycentralapp.widget
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
+import android.widget.Toast
import foundation.e.privacycentralapp.PrivacyCentralApplication
+import foundation.e.privacycentralapp.R
class WidgetCommandReceiver : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
+ val privacyCentralApplication = (context?.applicationContext as? PrivacyCentralApplication)
when (intent?.action) {
ACTION_TOGGLE_PRIVACY -> {
- (context?.applicationContext as? PrivacyCentralApplication)
- ?.dependencyContainer?.getQuickPrivacyStateUseCase?.toggleReturnIsFirstActivation()
+ if (privacyCentralApplication?.dependencyContainer?.getQuickPrivacyStateUseCase?.toggleReturnIsFirstActivation() == true) {
+ Toast.makeText(
+ context,
+ context.getString(R.string.dashboard_first_ipscrambling_activation),
+ Toast.LENGTH_LONG
+ ).show()
+ }
}
else -> {}
}