@@ -91,12 +91,14 @@ class AlbumsPickerActivity :
9191 captionText = resources.getText(R .string.media_picker_toolbar_title).toString()
9292 }
9393
94- folderPickerBinding.folderPickerBtnCopy.visibility = View .GONE
95- folderPickerBinding.folderPickerBtnMove.visibility = View .GONE
96- folderPickerBinding.folderPickerBtnChoose.visibility = View .GONE
97- folderPickerBinding.folderPickerBtnCancel.visibility = View .GONE
98- folderPickerBinding.chooseButtonSpacer.visibility = View .GONE
99- folderPickerBinding.moveOrCopyButtonSpacer.visibility = View .GONE
94+ folderPickerBinding.run {
95+ folderPickerBtnCopy.visibility = View .GONE
96+ folderPickerBtnMove.visibility = View .GONE
97+ folderPickerBtnChoose.visibility = View .GONE
98+ folderPickerBtnCancel.visibility = View .GONE
99+ chooseButtonSpacer.visibility = View .GONE
100+ moveOrCopyButtonSpacer.visibility = View .GONE
101+ }
100102 }
101103
102104 private fun createFragments () {
@@ -114,18 +116,22 @@ class AlbumsPickerActivity :
114116 }
115117
116118 private fun createGalleryFragment () {
117- val photoFragment = GalleryFragment ()
118- val bundle = Bundle ()
119- bundle.putParcelable(
120- OCFileListFragment .SEARCH_EVENT ,
121- SearchEvent (" image/%" , SearchRemoteOperation .SearchType .PHOTO_SEARCH )
122- )
123- bundle.putBoolean(EXTRA_FROM_ALBUM , true )
124- photoFragment.arguments = bundle
125-
126- val transaction = supportFragmentManager.beginTransaction()
127- transaction.add(R .id.fragment_container, photoFragment, TAG_LIST_OF_FOLDERS )
128- transaction.commit()
119+ val bundle = Bundle ().apply {
120+ putParcelable(
121+ OCFileListFragment .SEARCH_EVENT ,
122+ SearchEvent (" image/%" , SearchRemoteOperation .SearchType .PHOTO_SEARCH )
123+ )
124+ putBoolean(EXTRA_FROM_ALBUM , true )
125+ }
126+
127+ val fragment = GalleryFragment ().apply {
128+ arguments = bundle
129+ }
130+
131+ supportFragmentManager.beginTransaction().run {
132+ add(R .id.fragment_container, fragment, TAG_LIST_OF_FOLDERS )
133+ commit()
134+ }
129135 }
130136
131137 private val listOfFilesFragment: AlbumsFragment ?
@@ -173,21 +179,13 @@ class AlbumsPickerActivity :
173179 }
174180 }
175181
176- override fun showDetails (file : OCFile ? ) {
177- // not used at the moment
178- }
182+ override fun showDetails (file : OCFile ? ) = Unit
179183
180- override fun showDetails (file : OCFile ? , activeTab : Int ) {
181- // not used at the moment
182- }
184+ override fun showDetails (file : OCFile ? , activeTab : Int ) = Unit
183185
184- override fun onBrowsedDownTo (folder : OCFile ? ) {
185- // not used at the moment
186- }
186+ override fun onBrowsedDownTo (folder : OCFile ? ) = Unit
187187
188- override fun onTransferStateChanged (file : OCFile ? , downloading : Boolean , uploading : Boolean ) {
189- // not used at the moment
190- }
188+ override fun onTransferStateChanged (file : OCFile ? , downloading : Boolean , uploading : Boolean ) = Unit
191189
192190 companion object {
193191 private val EXTRA_ACTION = AlbumsPickerActivity ::class .java.canonicalName?.plus(" .EXTRA_ACTION" )
@@ -209,13 +207,9 @@ class AlbumsPickerActivity :
209207 }
210208 }
211209
212- override fun onRefresh (enforced : Boolean ) {
213- // do nothing
214- }
210+ override fun onRefresh (enforced : Boolean ) = Unit
215211
216- override fun onRefresh () {
217- // do nothing
218- }
212+ override fun onRefresh () = Unit
219213
220214 override fun onOptionsItemSelected (item : MenuItem ): Boolean {
221215 when (item.itemId) {
0 commit comments