Fix hide all tab
This commit is contained in:
parent
47e7c21f5d
commit
424fe8e585
@ -1412,6 +1412,11 @@ public class FilterTabsView extends FrameLayout {
|
||||
int idx1 = fromIndex - 1;
|
||||
int idx2 = toIndex - 1;
|
||||
int count = tabs.size() - 1;
|
||||
if (NekoConfig.hideAllTab) {
|
||||
idx1++;
|
||||
idx2++;
|
||||
count++;
|
||||
}
|
||||
if (idx1 < 0 || idx2 < 0 || idx1 >= count || idx2 >= count) {
|
||||
return;
|
||||
}
|
||||
@ -1474,7 +1479,7 @@ public class FilterTabsView extends FrameLayout {
|
||||
|
||||
@Override
|
||||
public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
|
||||
if (!isEditing || viewHolder.getAdapterPosition() == 0) {
|
||||
if (!isEditing || (!NekoConfig.hideAllTab && viewHolder.getAdapterPosition() == 0)) {
|
||||
return makeMovementFlags(0, 0);
|
||||
}
|
||||
return makeMovementFlags(ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT, 0);
|
||||
@ -1482,7 +1487,7 @@ public class FilterTabsView extends FrameLayout {
|
||||
|
||||
@Override
|
||||
public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder source, RecyclerView.ViewHolder target) {
|
||||
if (source.getAdapterPosition() == 0 || target.getAdapterPosition() == 0) {
|
||||
if (!NekoConfig.hideAllTab && (source.getAdapterPosition() == 0 || target.getAdapterPosition() == 0)) {
|
||||
return false;
|
||||
}
|
||||
adapter.swapElements(source.getAdapterPosition(), target.getAdapterPosition());
|
||||
|
@ -3509,7 +3509,7 @@ private int lastMeasuredTopPadding;
|
||||
}
|
||||
}
|
||||
id = filterTabsView.getCurrentTabId();
|
||||
boolean updateCurrentTab = false;
|
||||
boolean updateCurrentTab = NekoConfig.hideAllTab;
|
||||
if (id >= 0) {
|
||||
if (viewPages[0].selectedType != id) {
|
||||
updateCurrentTab = true;
|
||||
|
Loading…
Reference in New Issue
Block a user