This commit is contained in:
Cloudburst 2023-02-11 14:44:07 +00:00
parent 98df2c2cff
commit e9a5f29dcc

View file

@ -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()
}
}
}