Search in sources :

Example 1 with TabFragmentBottomDragListener

use of com.amaze.filemanager.ui.drag.TabFragmentBottomDragListener in project AmazeFileManager by TeamAmaze.

the class MainActivity method initBottomDragListener.

private void initBottomDragListener(boolean destroy) {
    View bottomPlaceholder = findViewById(R.id.placeholder_drag_bottom);
    if (destroy) {
        bottomPlaceholder.setOnDragListener(null);
        bottomPlaceholder.setVisibility(View.GONE);
    } else {
        bottomPlaceholder.setVisibility(View.VISIBLE);
        bottomPlaceholder.setOnDragListener(new TabFragmentBottomDragListener(() -> {
            getCurrentMainFragment().smoothScrollListView(false);
            return null;
        }, () -> {
            getCurrentMainFragment().stopSmoothScrollListView();
            return null;
        }));
    }
}
Also used : TabFragmentBottomDragListener(com.amaze.filemanager.ui.drag.TabFragmentBottomDragListener) SpeedDialView(com.leinardi.android.speeddial.SpeedDialView) View(android.view.View) FabWithLabelView(com.leinardi.android.speeddial.FabWithLabelView)

Example 2 with TabFragmentBottomDragListener

use of com.amaze.filemanager.ui.drag.TabFragmentBottomDragListener in project AmazeFileManager by TeamAmaze.

the class MainFragment method initTopAndEmptyAreaDragListeners.

public void initTopAndEmptyAreaDragListeners(boolean destroy) {
    if (destroy) {
        mToolbarContainer.setOnDragListener(null);
        listView.stopScroll();
        listView.setOnDragListener(null);
        nofilesview.setOnDragListener(null);
    } else {
        mToolbarContainer.setOnDragListener(new TabFragmentBottomDragListener(() -> {
            smoothScrollListView(true);
            return null;
        }, () -> {
            stopSmoothScrollListView();
            return null;
        }));
        listView.setOnDragListener(new RecyclerAdapterDragListener(adapter, null, mainFragmentViewModel.getDragAndDropPreference(), this));
        nofilesview.setOnDragListener(new RecyclerAdapterDragListener(adapter, null, mainFragmentViewModel.getDragAndDropPreference(), this));
    }
}
Also used : TabFragmentBottomDragListener(com.amaze.filemanager.ui.drag.TabFragmentBottomDragListener) RecyclerAdapterDragListener(com.amaze.filemanager.ui.drag.RecyclerAdapterDragListener)

Aggregations

TabFragmentBottomDragListener (com.amaze.filemanager.ui.drag.TabFragmentBottomDragListener)2 View (android.view.View)1 RecyclerAdapterDragListener (com.amaze.filemanager.ui.drag.RecyclerAdapterDragListener)1 FabWithLabelView (com.leinardi.android.speeddial.FabWithLabelView)1 SpeedDialView (com.leinardi.android.speeddial.SpeedDialView)1