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