Add transparency options to subtitle (#281)

* feat: add state llistener to Xpandable

* feat: improve app restart process

* feat: support subtitle transparency
This commit is contained in:
TwistedUmbrellaX 2024-03-23 20:12:22 -04:00 committed by GitHub
parent 89e18b0e2f
commit 85ef4b3c12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 259 additions and 129 deletions

View file

@ -270,6 +270,32 @@ fun Activity.setNavigationTheme() {
}
}
fun Activity.reloadActivity() {
Refresh.all()
finish()
startActivity(Intent(this, this::class.java))
initActivity(this)
}
fun Context.restartApp(view: View) {
val mainIntent = Intent.makeRestartActivityTask(
packageManager.getLaunchIntentForPackage(this.packageName)!!.component
)
val component = ComponentName(this@restartApp.packageName, this@restartApp::class.qualifiedName!!)
Snackbar.make(view, R.string.restart_app, Snackbar.LENGTH_INDEFINITE).apply {
setAction(R.string.do_it) {
this.dismiss()
try {
startActivity(Intent().setComponent(component))
} catch (anything: Exception) {
startActivity(mainIntent)
}
Runtime.getRuntime().exit(0)
}
show()
}
}
open class BottomSheetDialogFragment : BottomSheetDialogFragment() {
override fun onStart() {
super.onStart()