Show waiting for server earlier

pull/212/head
M66B 2 years ago
parent 2d84461bf7
commit 114e1c24f1

@ -6861,7 +6861,7 @@ public class FragmentMessages extends FragmentBase
(language_detection && !TextUtils.isEmpty(filter_language) && !outbox)); (language_detection && !TextUtils.isEmpty(filter_language) && !outbox));
boolean none = (items == 0 && initialized); boolean none = (items == 0 && initialized);
boolean searching = (viewType == AdapterMessage.ViewType.SEARCH && server && loading && items == 0); boolean searching = (viewType == AdapterMessage.ViewType.SEARCH && server && (!initialized || loading) && items == 0);
boolean filtered = (filter_active && viewType != AdapterMessage.ViewType.SEARCH); boolean filtered = (filter_active && viewType != AdapterMessage.ViewType.SEARCH);
pbWait.setVisibility(loading || tasks > 0 ? View.VISIBLE : View.GONE); pbWait.setVisibility(loading || tasks > 0 ? View.VISIBLE : View.GONE);
@ -6872,7 +6872,8 @@ public class FragmentMessages extends FragmentBase
if (BuildConfig.DEBUG) if (BuildConfig.DEBUG)
updateDebugInfo(); updateDebugInfo();
Log.i("List state reason=" + reason + Log.i(" List state who=" + Helper.getWho(this) + "" +
" reason=" + reason +
" tasks=" + tasks + " loading=" + loading + " tasks=" + tasks + " loading=" + loading +
" items=" + items + " initialized=" + initialized + " items=" + items + " initialized=" + initialized +
" wait=" + (pbWait.getVisibility() == View.VISIBLE) + " wait=" + (pbWait.getVisibility() == View.VISIBLE) +

@ -1677,7 +1677,7 @@ public class Helper {
return layout.getOffsetForHorizontal(line, x); return layout.getOffsetForHorizontal(line, x);
} }
static String getRequestKey(Fragment fragment) { static String getWho(Fragment fragment) {
String who; String who;
try { try {
Class<?> cls = fragment.getClass(); Class<?> cls = fragment.getClass();
@ -1685,16 +1685,18 @@ public class Helper {
cls = cls.getSuperclass(); cls = cls.getSuperclass();
Field f = cls.getDeclaredField("mWho"); Field f = cls.getDeclaredField("mWho");
f.setAccessible(true); f.setAccessible(true);
who = (String) f.get(fragment); return (String) f.get(fragment);
} catch (Throwable ex) { } catch (Throwable ex) {
Log.w(ex); Log.w(ex);
String we = fragment.toString(); String we = fragment.toString();
int pa = we.indexOf('('); int pa = we.indexOf('(');
int sp = we.indexOf(' ', pa); int sp = we.indexOf(' ', pa);
who = we.substring(pa + 1, sp); return we.substring(pa + 1, sp);
} }
}
return fragment.getClass().getName() + ":result:" + who; static String getRequestKey(Fragment fragment) {
return fragment.getClass().getName() + ":result:" + getWho(fragment);
} }
static void clearViews(Object instance) { static void clearViews(Object instance) {

Loading…
Cancel
Save