Search in sources :

Example 1 with IndexTask

use of im.actor.sdk.controllers.pickers.file.search.IndexTask in project actor-platform by actorapp.

the class SearchFileFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    rootView = inflater.inflate(R.layout.picker_fragment_file_search, container, false);
    root = getArguments().getString("root");
    //        ViewGroup searchContainer = (ViewGroup) rootView.findViewById(R.id.search_container);
    View contentContainer = rootView.findViewById(R.id.content_container);
    status = (TextView) rootView.findViewById(R.id.status);
    // progress = new IndeterminateWrapper(pickerActivity);
    // progress.show();
    listView = (ListView) contentContainer.findViewById(R.id.list);
    listView.setOnScrollListener(this);
    adapter = new ExplorerAdapter(pickerActivity, items);
    listView.setAdapter(adapter);
    listView.setOnItemClickListener(pickerActivity);
    AlphaAnimation alphaAnimation = new AlphaAnimation(0, 1);
    alphaAnimation.setDuration(300);
    alphaAnimation.setInterpolator(new MaterialInterpolator());
    TranslateAnimation translateAnimation = new TranslateAnimation(0, 0, -150, 0);
    translateAnimation.setDuration(450);
    translateAnimation.setInterpolator(new MaterialInterpolator());
    //  searchContainer.startAnimation(translateAnimation);
    contentContainer.startAnimation(alphaAnimation);
    /**/
    pickerActivity.getSupportActionBar().setTitle(R.string.picker_file_search_activity_title);
    if (index.isEmpty()) {
        indexingTask = new IndexTask(new File(root)) {

            @Override
            public void onIndexingEnded(ArrayList<File> indexedItems) {
                index.clear();
                index.addAll(indexedItems);
                indexingTask = null;
                if (searchingTask != null) {
                    searchingTask.execute();
                } else {
                //  progress.hide();
                }
            }
        };
        //searchingProgressBar.progressiveStart();
        indexingTask.execute();
    } else {
    }
    return rootView;
}
Also used : MaterialInterpolator(im.actor.sdk.controllers.pickers.file.view.MaterialInterpolator) IndexTask(im.actor.sdk.controllers.pickers.file.search.IndexTask) TranslateAnimation(android.view.animation.TranslateAnimation) SearchView(android.support.v7.widget.SearchView) View(android.view.View) AbsListView(android.widget.AbsListView) TextView(android.widget.TextView) ListView(android.widget.ListView) File(java.io.File) AlphaAnimation(android.view.animation.AlphaAnimation)

Aggregations

SearchView (android.support.v7.widget.SearchView)1 View (android.view.View)1 AlphaAnimation (android.view.animation.AlphaAnimation)1 TranslateAnimation (android.view.animation.TranslateAnimation)1 AbsListView (android.widget.AbsListView)1 ListView (android.widget.ListView)1 TextView (android.widget.TextView)1 IndexTask (im.actor.sdk.controllers.pickers.file.search.IndexTask)1 MaterialInterpolator (im.actor.sdk.controllers.pickers.file.view.MaterialInterpolator)1 File (java.io.File)1