diff options
author | Abhishek Aggarwal <warabhishek@e.email> | 2022-05-05 07:49:24 +0000 |
---|---|---|
committer | Abhishek Aggarwal <warabhishek@e.email> | 2022-05-05 07:49:24 +0000 |
commit | 7bfcbf2fa12ef72344cb2f58c73e43573dc1d304 (patch) | |
tree | b2b385125042ec0c49e20580d378787e78e55b03 /app/src/main/java/foundation/e/privacycentralapp | |
parent | 7b8cbd55fcc82607964465f0746a610830df32f6 (diff) | |
parent | 1c6d37b90bbee7dbc5161df74e06fc9064186727 (diff) |
Merge branch '5312-main-widget_toast' into 'main'
privacycentralapp: add toast to widget as well
See merge request e/privacy-central/privacycentralapp!53
Diffstat (limited to 'app/src/main/java/foundation/e/privacycentralapp')
-rw-r--r-- | app/src/main/java/foundation/e/privacycentralapp/widget/WidgetCommandReceiver.kt | 12 |
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 -> {} } |