Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class FileListFragment : Fragment(), BreadcrumbLayout.Listener, FileListAdapter.
val activity = requireActivity() as AppCompatActivity
activity.setTitle(R.string.file_list_title)
activity.setSupportActionBar(binding.toolbar)
overlayActionMode = OverlayToolbarActionMode(binding.overlayToolbar)
overlayActionMode = OverlayToolbarActionMode(binding.overlayToolbar, binding.toolbar)
bottomActionMode = PersistentBarLayoutToolbarActionMode(
binding.persistentBarLayout, binding.bottomBarLayout, binding.bottomToolbar
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,21 @@ import androidx.core.view.isVisible
import me.zhanghai.android.files.util.fadeInUnsafe
import me.zhanghai.android.files.util.fadeOutUnsafe

class OverlayToolbarActionMode(bar: ViewGroup, toolbar: Toolbar) : ToolbarActionMode(bar, toolbar) {
class OverlayToolbarActionMode(
bar: ViewGroup,
toolbar: Toolbar,
private val siblingView: ViewGroup? = null
) : ToolbarActionMode(bar, toolbar) {
constructor(toolbar: Toolbar) : this(toolbar, toolbar)

constructor(toolbar: Toolbar, siblingView: ViewGroup) : this(toolbar, toolbar, siblingView)

init {
bar.isVisible = false
}

override fun show(bar: ViewGroup, animate: Boolean) {
siblingView?.descendantFocusability = ViewGroup.FOCUS_BLOCK_DESCENDANTS
if (animate) {
bar.fadeInUnsafe()
} else {
Expand All @@ -27,6 +34,7 @@ class OverlayToolbarActionMode(bar: ViewGroup, toolbar: Toolbar) : ToolbarAction
}

override fun hide(bar: ViewGroup, animate: Boolean) {
siblingView?.descendantFocusability = ViewGroup.FOCUS_BEFORE_DESCENDANTS
if (animate) {
bar.fadeOutUnsafe()
} else {
Expand Down