Search in sources :

Example 1 with BackItem

use of im.actor.sdk.controllers.pickers.file.items.BackItem in project actor-platform by actorapp.

the class FilePickerActivity method onItemClick.

@Override
public void onItemClick(AdapterView<?> parent, View itemView, int position, long id) {
    ExplorerItem item = (ExplorerItem) parent.getItemAtPosition(position);
    if (item instanceof BackItem) {
        onBackPressed();
        return;
    }
    if (item.isDirectory()) {
        String path = item.getPath();
        Bundle bundle = new Bundle();
        bundle.putString("path", path);
        Fragment fragment = new ExplorerFragment();
        fragment.setArguments(bundle);
        getFragmentManager().beginTransaction().setCustomAnimations(R.animator.picker_fragment_explorer_enter, R.animator.picker_fragment_explorer_exit, R.animator.picker_fragment_explorer_return, R.animator.picker_fragment_explorer_out).replace(R.id.container, fragment).addToBackStack(path).commit();
    } else {
        selectItem(item, itemView);
        returnResult();
    }
}
Also used : ExplorerItem(im.actor.sdk.controllers.pickers.file.items.ExplorerItem) Bundle(android.os.Bundle) BackItem(im.actor.sdk.controllers.pickers.file.items.BackItem) Fragment(android.app.Fragment)

Aggregations

Fragment (android.app.Fragment)1 Bundle (android.os.Bundle)1 BackItem (im.actor.sdk.controllers.pickers.file.items.BackItem)1 ExplorerItem (im.actor.sdk.controllers.pickers.file.items.ExplorerItem)1