|
|
@ -753,6 +753,16 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
Log.w(ex);
|
|
|
|
Log.w(ex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onItemsAdded(@NonNull RecyclerView recyclerView, int positionStart, int itemCount) {
|
|
|
|
|
|
|
|
iProperties.layoutChanged();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onItemsRemoved(@NonNull RecyclerView recyclerView, int positionStart, int itemCount) {
|
|
|
|
|
|
|
|
iProperties.layoutChanged();
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
rvMessage.setLayoutManager(llm);
|
|
|
|
rvMessage.setLayoutManager(llm);
|
|
|
|
|
|
|
|
|
|
|
@ -1005,16 +1015,10 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onScrolled(@NonNull RecyclerView rv, int dx, int dy) {
|
|
|
|
public void onScrolled(@NonNull RecyclerView rv, int dx, int dy) {
|
|
|
|
if (dy != 0) {
|
|
|
|
if (dy != 0) {
|
|
|
|
boolean down = (dy > 0 && rv.canScrollVertically(RecyclerView.FOCUS_DOWN));
|
|
|
|
boolean down = (dy > 0 && rv.canScrollVertically(1));
|
|
|
|
if (scrolling != down) {
|
|
|
|
if (scrolling != down) {
|
|
|
|
scrolling = down;
|
|
|
|
scrolling = down;
|
|
|
|
if (!accessibility &&
|
|
|
|
updateCompose();
|
|
|
|
(viewType == AdapterMessage.ViewType.UNIFIED ||
|
|
|
|
|
|
|
|
viewType == AdapterMessage.ViewType.FOLDER))
|
|
|
|
|
|
|
|
if (down)
|
|
|
|
|
|
|
|
fabCompose.hide();
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
fabCompose.show();
|
|
|
|
|
|
|
|
updateExpanded();
|
|
|
|
updateExpanded();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2126,11 +2130,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ("headers".equals(name)) {
|
|
|
|
|
|
|
|
scrolling = false;
|
|
|
|
|
|
|
|
updateExpanded();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -2210,9 +2209,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (value)
|
|
|
|
scrolling = false;
|
|
|
|
scrolling = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateExpanded();
|
|
|
|
updateExpanded();
|
|
|
|
if (value)
|
|
|
|
if (value)
|
|
|
|
handleExpand(message.id);
|
|
|
|
handleExpand(message.id);
|
|
|
@ -2412,6 +2409,24 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
}.execute(FragmentMessages.this, args, "message:lock");
|
|
|
|
}.execute(FragmentMessages.this, args, "message:lock");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void layoutChanged() {
|
|
|
|
|
|
|
|
rvMessage.post(new Runnable() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void run() {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
if (scrolling && !rvMessage.canScrollVertically(-1)) {
|
|
|
|
|
|
|
|
scrolling = false;
|
|
|
|
|
|
|
|
updateCompose();
|
|
|
|
|
|
|
|
updateExpanded();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
|
|
|
|
Log.e(ex);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void refresh() {
|
|
|
|
public void refresh() {
|
|
|
|
rvMessage.post(new Runnable() {
|
|
|
|
rvMessage.post(new Runnable() {
|
|
|
@ -4437,7 +4452,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
positions.remove(id);
|
|
|
|
positions.remove(id);
|
|
|
|
attachments.remove(id);
|
|
|
|
attachments.remove(id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
updateExpanded();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -6570,6 +6584,16 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void updateCompose() {
|
|
|
|
|
|
|
|
if (!accessibility &&
|
|
|
|
|
|
|
|
(viewType == AdapterMessage.ViewType.UNIFIED ||
|
|
|
|
|
|
|
|
viewType == AdapterMessage.ViewType.FOLDER))
|
|
|
|
|
|
|
|
if (scrolling)
|
|
|
|
|
|
|
|
fabCompose.hide();
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
fabCompose.show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void updateExpanded() {
|
|
|
|
private void updateExpanded() {
|
|
|
|
if (!getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
|
|
|
if (!getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|