From e9a5f29dcc25b035397f9f7ab0bf4f89c7a07c4f Mon Sep 17 00:00:00 2001 From: Cloudburst <18114966+C10udburst@users.noreply.github.com> Date: Sat, 11 Feb 2023 14:44:07 +0000 Subject: [PATCH] use let --- .../com/lagradost/cloudstream3/MainActivity.kt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt b/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt index 6127166c..ec032099 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt @@ -727,14 +727,15 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener { } else { setKey("jsdelivr_proxy_key", true) val parentView = findViewById(android.R.id.content) - Snackbar.make(parentView, R.string.jsdelivr_enabled, Snackbar.LENGTH_LONG) - .setAction(R.string.revert, v -> { + Snackbar.make(parentView, R.string.jsdelivr_enabled, Snackbar.LENGTH_LONG).let { snackbar -> + snackbar.setAction(R.string.revert) { v -> setKey("jsdelivr_proxy_key", false) - }) - .setBackgroundTint(colorFromAttribute(R.attr.primaryGrayBackground)) - .setTextColor(colorFromAttribute(R.attr.textColor)) - .setActionTextColor(colorFromAttribute(R.attr.colorPrimary)) - .show() + } + snackbar.setBackgroundTint(colorFromAttribute(R.attr.primaryGrayBackground)) + snackbar.setTextColor(colorFromAttribute(R.attr.textColor)) + snackbar.setActionTextColor(colorFromAttribute(R.attr.colorPrimary)) + snackbar.show() + } } }