diff options
author | TheScarastic <warabhishek@e.email> | 2022-05-05 12:21:28 +0530 |
---|---|---|
committer | TheScarastic <warabhishek@e.email> | 2022-05-05 12:22:12 +0530 |
commit | 1c6d37b90bbee7dbc5161df74e06fc9064186727 (patch) | |
tree | b2b385125042ec0c49e20580d378787e78e55b03 /app/src/main/java/foundation/e | |
parent | 7b8cbd55fcc82607964465f0746a610830df32f6 (diff) |
privacycentralapp: add toast to widget as well
Diffstat (limited to 'app/src/main/java/foundation/e')
-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 -> {} } |