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 @@ -108,7 +108,7 @@ class GalleryFragment :

private fun setupBottomSheet() {
if (bottomSheet == null) {
bottomSheet = GalleryFragmentBottomSheetDialog(this)
bottomSheet = GalleryFragmentBottomSheetDialog()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ import com.owncloud.android.databinding.FragmentGalleryBottomSheetBinding
import com.owncloud.android.utils.theme.ViewThemeUtils
import javax.inject.Inject

class GalleryFragmentBottomSheetDialog(private val actions: GalleryFragmentBottomSheetActions) :
class GalleryFragmentBottomSheetDialog :
BottomSheetDialogFragment(R.layout.fragment_gallery_bottom_sheet),
Injectable {
@Inject
lateinit var viewThemeUtils: ViewThemeUtils

private val actions: GalleryFragmentBottomSheetActions?
get() = parentFragment as? GalleryFragmentBottomSheetActions

private lateinit var binding: FragmentGalleryBottomSheetBinding
private var currentMediaState: MediaState = MediaState.MEDIA_STATE_DEFAULT

Expand Down Expand Up @@ -104,14 +107,14 @@ class GalleryFragmentBottomSheetDialog(private val actions: GalleryFragmentBotto
dismiss()
}
binding.btnSelectMediaFolder.setOnClickListener {
actions.selectMediaFolder()
actions?.selectMediaFolder()
dismiss()
}
}

private fun notifyStateChange() {
setupLayout()
actions.updateMediaContent(currentMediaState)
actions?.updateMediaContent(currentMediaState)
}

val currMediaState: MediaState
Expand Down
Loading