Skip to content

Commit

Permalink
Release 2.2.6.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaobozhen committed May 14, 2022
1 parent e99b84a commit 8cf488a
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,14 @@ abstract class BaseListControllerFragment<T : ViewBinding> : BaseFragment<T>(),

override fun onVisibilityChanged(visible: Boolean) {
super.onVisibilityChanged(visible)
if (visible) {
if (this != homeViewModel.controller) {
homeViewModel.controller = this
activity?.invalidateOptionsMenu()
}
if (visible && this != homeViewModel.controller) {
homeViewModel.controller = this
}
}

override fun onResume() {
super.onResume()
setHasOptionsMenu(isVisible)
scheduleAppbarRaisingStatus()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ class AppListFragment :
private lateinit var layoutManager: RecyclerView.LayoutManager

override fun init() {
setHasOptionsMenu(true)

appAdapter.also {
it.setOnItemClickListener { _, view, position ->
if (AntiShakeUtils.isInvalidClick(view)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class XmlBSDFragment : BaseBottomSheetViewDialogFragment<XmlBottomSheetView>() {
)
setPadding(24.dp, 16.dp, 24.dp, 0)
post {
maxPeekSize = (root.height * 0.67).toInt()
maxPeekSize = ((dialog?.window?.decorView?.height ?: 0) * 0.67).toInt()
}
}
root.setText(text)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ class SnapshotFragment : BaseListControllerFragment<FragmentSnapshotBinding>() {
private val packageQueue: Queue<Pair<String?, String?>> by lazy { LinkedList() }

override fun init() {
setHasOptionsMenu(true)

val context = (this.context as? BaseActivity<*>) ?: return
context.applicationContext.also {
val intent = Intent(it, ShootService::class.java).apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ClassifyBottomSheetDialogFragment : BaseBottomSheetViewDialogFragment<Clas

override fun init() {
root.post {
maxPeekSize = (root.height * 0.67).toInt()
maxPeekSize = ((dialog?.window?.decorView?.height ?: 0) * 0.67).toInt()
}
viewModel.dialogTitle.observe(viewLifecycleOwner) {
getHeaderView().title.text = it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class LibReferenceFragment :
private var searchUpdateJob: Job? = null

override fun init() {
setHasOptionsMenu(true)
val context = (context as? BaseActivity<*>) ?: return

binding.apply {
Expand Down

0 comments on commit 8cf488a

Please sign in to comment.