Skip to content

Commit

Permalink
Merge pull request #12168 from nextcloud/refactor/convert-FilePickerA…
Browse files Browse the repository at this point in the history
…ctivity-to-kt

Convert FilePickerActivity to Kotlin
  • Loading branch information
AndyScherzinger authored Nov 20, 2023
2 parents e4b9be1 + 1de7b5a commit ddad5eb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,29 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.owncloud.android.ui.activity

package com.owncloud.android.ui.activity;

import android.os.Bundle;
import android.view.View;

import com.owncloud.android.R;
import com.owncloud.android.ui.fragment.OCFileListFragment;

import androidx.fragment.app.FragmentTransaction;
import android.os.Bundle
import com.owncloud.android.R
import com.owncloud.android.ui.fragment.OCFileListFragment

/**
* File picker of remote files
*/
public class FilePickerActivity extends FolderPickerActivity {

@Override
public void onClick(View v) {
super.onClick(v);
}
class FilePickerActivity : FolderPickerActivity() {

@Override
protected void createFragments() {
OCFileListFragment listOfFiles = new OCFileListFragment();
Bundle args = new Bundle();
args.putBoolean(OCFileListFragment.ARG_ONLY_FOLDERS_CLICKABLE, true);
args.putBoolean(OCFileListFragment.ARG_HIDE_FAB, true);
args.putBoolean(OCFileListFragment.ARG_HIDE_ITEM_OPTIONS, true);
args.putBoolean(OCFileListFragment.ARG_SEARCH_ONLY_FOLDER, false);
args.putBoolean(OCFileListFragment.ARG_FILE_SELECTABLE, true);
args.putString(OCFileListFragment.ARG_MIMETYPE, getIntent().getStringExtra(OCFileListFragment.ARG_MIMETYPE));
listOfFiles.setArguments(args);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.add(R.id.fragment_container, listOfFiles, TAG_LIST_OF_FOLDERS);
transaction.commit();
override fun createFragments() {
val listOfFiles = OCFileListFragment()
val args = Bundle()
args.putBoolean(OCFileListFragment.ARG_ONLY_FOLDERS_CLICKABLE, true)
args.putBoolean(OCFileListFragment.ARG_HIDE_FAB, true)
args.putBoolean(OCFileListFragment.ARG_HIDE_ITEM_OPTIONS, true)
args.putBoolean(OCFileListFragment.ARG_SEARCH_ONLY_FOLDER, false)
args.putBoolean(OCFileListFragment.ARG_FILE_SELECTABLE, true)
args.putString(OCFileListFragment.ARG_MIMETYPE, intent.getStringExtra(OCFileListFragment.ARG_MIMETYPE))
listOfFiles.arguments = args
val transaction = supportFragmentManager.beginTransaction()
transaction.add(R.id.fragment_container, listOfFiles, TAG_LIST_OF_FOLDERS)
transaction.commit()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ open class FolderPickerActivity :
const val MOVE_OR_COPY = "MOVE_OR_COPY"
const val CHOOSE_LOCATION = "CHOOSE_LOCATION"
private val TAG = FolderPickerActivity::class.java.simpleName
protected const val TAG_LIST_OF_FOLDERS = "LIST_OF_FOLDERS"

const val TAG_LIST_OF_FOLDERS = "LIST_OF_FOLDERS"
}
}

0 comments on commit ddad5eb

Please sign in to comment.