Rename
This commit is contained in:
1 parent
b86d90021c
commit
6c0757c91b
972 files changed
+6885
-7321
No files matched your search
@@ -0,0 +1,39 @@
|
||||
package io.legato.kazusa.base
|
||||
|
||||
import androidx.lifecycle.LifecycleEventObserver
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||
import io.legato.kazusa.help.config.AppConfig
|
||||
|
||||
|
||||
abstract class BasePrefDialogFragment(
|
||||
) : BottomSheetDialogFragment() {
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
if (AppConfig.isEInkMode) {
|
||||
// dialog?.window?.let {
|
||||
// it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
|
||||
// val attr = it.attributes
|
||||
// attr.dimAmount = 0.0f
|
||||
// attr.windowAnimations = 0
|
||||
// it.attributes = attr
|
||||
// it.setBackgroundDrawableResource(R.color.transparent)
|
||||
// }
|
||||
|
||||
// 修改gravity的时机一般在子类的onStart方法中, 因此需要在onStart之后执行.
|
||||
lifecycle.addObserver(LifecycleEventObserver { _, event ->
|
||||
// if (event == Lifecycle.Event.ON_START) {
|
||||
// when (dialog?.window?.attributes?.gravity) {
|
||||
// Gravity.TOP -> view?.setBackgroundResource(R.drawable.bg_eink_border_bottom)
|
||||
// Gravity.BOTTOM -> view?.setBackgroundResource(R.drawable.bg_eink_border_top)
|
||||
// else -> {
|
||||
// val padding = 2.dpToPx();
|
||||
// view?.setPadding(padding, padding, padding, padding)
|
||||
// view?.setBackgroundResource(R.drawable.bg_eink_border_dialog)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user