|
|
|
@ -44,6 +44,7 @@ import android.view.LayoutInflater;
|
|
|
|
|
import android.view.Menu;
|
|
|
|
|
import android.view.MenuInflater;
|
|
|
|
|
import android.view.MenuItem;
|
|
|
|
|
import android.view.MotionEvent;
|
|
|
|
|
import android.view.SubMenu;
|
|
|
|
|
import android.view.View;
|
|
|
|
|
import android.view.ViewGroup;
|
|
|
|
@ -298,8 +299,6 @@ public class FragmentMessages extends FragmentBase {
|
|
|
|
|
|
|
|
|
|
rvMessage.setAdapter(adapter);
|
|
|
|
|
|
|
|
|
|
new ItemTouchHelper(touchHelper).attachToRecyclerView(rvMessage);
|
|
|
|
|
|
|
|
|
|
bottom_navigation.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
|
|
|
|
@ -401,32 +400,29 @@ public class FragmentMessages extends FragmentBase {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
ActivityBase activity = (ActivityBase) getActivity();
|
|
|
|
|
activity.setSwipeListener(new SwipeListener.ISwipeListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public boolean onSwipeRight() {
|
|
|
|
|
boolean swipenav = prefs.getBoolean("swipenav", true);
|
|
|
|
|
if (!swipenav)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (previous != null)
|
|
|
|
|
navigate(previous, true);
|
|
|
|
|
return (previous != null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean onSwipeLeft() {
|
|
|
|
|
boolean swipenav = prefs.getBoolean("swipenav", true);
|
|
|
|
|
if (!swipenav)
|
|
|
|
|
boolean swipenav = prefs.getBoolean("swipenav", true);
|
|
|
|
|
if (swipenav) {
|
|
|
|
|
Log.i("Swipe navigation");
|
|
|
|
|
rvMessage.addOnItemTouchListener(new RecyclerView.OnItemTouchListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public boolean onInterceptTouchEvent(@NonNull RecyclerView rv, @NonNull MotionEvent ev) {
|
|
|
|
|
swipeListener.onTouch(null, ev);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (next != null)
|
|
|
|
|
navigate(next, false);
|
|
|
|
|
return (next != null);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
@Override
|
|
|
|
|
public void onTouchEvent(@NonNull RecyclerView rv, @NonNull MotionEvent ev) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else
|
|
|
|
|
new ItemTouchHelper(touchHelper).attachToRecyclerView(rvMessage);
|
|
|
|
|
} else {
|
|
|
|
|
new ItemTouchHelper(touchHelper).attachToRecyclerView(rvMessage);
|
|
|
|
|
|
|
|
|
|
selectionPredicate = new SelectionPredicateMessage(rvMessage);
|
|
|
|
|
|
|
|
|
|
selectionTracker = new SelectionTracker.Builder<>(
|
|
|
|
@ -819,6 +815,22 @@ public class FragmentMessages extends FragmentBase {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SwipeListener swipeListener = new SwipeListener(getContext(), new SwipeListener.ISwipeListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public boolean onSwipeRight() {
|
|
|
|
|
if (previous != null)
|
|
|
|
|
navigate(previous, true);
|
|
|
|
|
return (previous != null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean onSwipeLeft() {
|
|
|
|
|
if (next != null)
|
|
|
|
|
navigate(next, false);
|
|
|
|
|
return (next != null);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
private void onActionMove(String folderType) {
|
|
|
|
|
Bundle args = new Bundle();
|
|
|
|
|
args.putLong("account", account);
|
|
|
|
|