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:
parent
89e18b0e2f
commit
85ef4b3c12
9 changed files with 259 additions and 129 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue