mirror of https://github.com/M66B/FairEmail.git
parent
ce4734ca7d
commit
3202f22107
@ -1,36 +0,0 @@
|
|||||||
package eu.faircode.email;
|
|
||||||
|
|
||||||
import androidx.lifecycle.ViewModel;
|
|
||||||
import androidx.paging.PagedList;
|
|
||||||
|
|
||||||
public class ViewModelMessages extends ViewModel {
|
|
||||||
private PagedList<TupleMessageEx> messages = null;
|
|
||||||
|
|
||||||
void setMessages(PagedList<TupleMessageEx> messages) {
|
|
||||||
this.messages = messages;
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] getPrevNext(String thread) {
|
|
||||||
if (messages == null)
|
|
||||||
return new String[]{null, null};
|
|
||||||
|
|
||||||
boolean found = false;
|
|
||||||
TupleMessageEx prev = null;
|
|
||||||
TupleMessageEx next = null;
|
|
||||||
for (int i = 0; i < messages.size(); i++) {
|
|
||||||
TupleMessageEx item = messages.get(i);
|
|
||||||
if (item == null)
|
|
||||||
continue;
|
|
||||||
if (found) {
|
|
||||||
next = item;
|
|
||||||
messages.loadAround(i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (thread.equals(item.thread))
|
|
||||||
found = true;
|
|
||||||
else
|
|
||||||
prev = item;
|
|
||||||
}
|
|
||||||
return new String[]{prev == null ? null : prev.thread, next == null ? null : next.thread};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="24dp"
|
|
||||||
android:height="24dp"
|
|
||||||
android:alpha="0.5"
|
|
||||||
android:viewportWidth="24.0"
|
|
||||||
android:viewportHeight="24.0"
|
|
||||||
android:tint="?attr/colorControlNormal">
|
|
||||||
<path
|
|
||||||
android:fillColor="@android:color/white"
|
|
||||||
android:pathData="M6,18l8.5,-6L6,6v12zM16,6v12h2V6h-2z"/>
|
|
||||||
</vector>
|
|
@ -1,11 +0,0 @@
|
|||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="24dp"
|
|
||||||
android:height="24dp"
|
|
||||||
android:alpha="0.5"
|
|
||||||
android:viewportWidth="24.0"
|
|
||||||
android:viewportHeight="24.0"
|
|
||||||
android:tint="?attr/colorControlNormal">
|
|
||||||
<path
|
|
||||||
android:fillColor="@android:color/white"
|
|
||||||
android:pathData="M6,6h2v12L6,18zM9.5,12l8.5,6L18,6z"/>
|
|
||||||
</vector>
|
|
Loading…
Reference in new issue