Some fixes

This commit is contained in:
tom79 2019-08-07 09:14:20 +02:00
parent bc5fd46f7e
commit 85f7ade670
3 changed files with 22 additions and 38 deletions

View File

@ -117,19 +117,17 @@ public class RetrieveMissingFeedsAsyncTask extends AsyncTask<Void, Void, Void> {
if (conversations != null && conversations.size() > 0) { if (conversations != null && conversations.size() > 0) {
for (Conversation conversation : conversations) { for (Conversation conversation : conversations) {
app.fedilab.android.client.Entities.Status status = conversation.getLast_status(); app.fedilab.android.client.Entities.Status status = conversation.getLast_status();
List<String> ppConversationStatic = new ArrayList<>(); if( status != null) {
List<String> ppConversation = new ArrayList<>(); List<String> ppConversation = new ArrayList<>();
for (Account account : conversation.getAccounts()) { for (Account account : conversation.getAccounts())
ppConversationStatic.add(account.getAvatar_static());
ppConversation.add(account.getAvatar()); ppConversation.add(account.getAvatar());
}
status.setConversationProfilePicture(ppConversation); status.setConversationProfilePicture(ppConversation);
status.setConversationProfilePictureStatic(ppConversationStatic);
status.setConversationId(conversation.getId()); status.setConversationId(conversation.getId());
tempStatus.add(status); tempStatus.add(status);
} }
} }
} }
}
if (tempStatus != null) if (tempStatus != null)
statuses.addAll(0, tempStatus); statuses.addAll(0, tempStatus);
@ -170,19 +168,17 @@ public class RetrieveMissingFeedsAsyncTask extends AsyncTask<Void, Void, Void> {
if (conversations != null && conversations.size() > 0) { if (conversations != null && conversations.size() > 0) {
for (Conversation conversation : conversations) { for (Conversation conversation : conversations) {
app.fedilab.android.client.Entities.Status status = conversation.getLast_status(); app.fedilab.android.client.Entities.Status status = conversation.getLast_status();
List<String> ppConversationStatic = new ArrayList<>(); if (status != null) {
List<String> ppConversation = new ArrayList<>(); List<String> ppConversation = new ArrayList<>();
for (Account account : conversation.getAccounts()) { for (Account account : conversation.getAccounts())
ppConversationStatic.add(account.getAvatar_static());
ppConversation.add(account.getAvatar()); ppConversation.add(account.getAvatar());
}
status.setConversationProfilePicture(ppConversation); status.setConversationProfilePicture(ppConversation);
status.setConversationProfilePictureStatic(ppConversationStatic);
status.setConversationId(conversation.getId()); status.setConversationId(conversation.getId());
tempStatus.add(status); tempStatus.add(status);
} }
} }
} }
}
if (tempStatus != null) if (tempStatus != null)
statuses.addAll(0, tempStatus); statuses.addAll(0, tempStatus);

View File

@ -141,7 +141,6 @@ public class Status implements Parcelable{
public Status(){} public Status(){}
private List<String> conversationProfilePicture; private List<String> conversationProfilePicture;
private List<String> conversationProfilePictureStatic;
private String webviewURL = null; private String webviewURL = null;
private boolean isBoostAnimated = false, isFavAnimated = false; private boolean isBoostAnimated = false, isFavAnimated = false;
@ -208,7 +207,6 @@ public class Status implements Parcelable{
dest.writeByte(this.isExpanded ? (byte) 1 : (byte) 0); dest.writeByte(this.isExpanded ? (byte) 1 : (byte) 0);
dest.writeInt(this.numberLines); dest.writeInt(this.numberLines);
dest.writeStringList(this.conversationProfilePicture); dest.writeStringList(this.conversationProfilePicture);
dest.writeStringList(this.conversationProfilePictureStatic);
dest.writeString(this.webviewURL); dest.writeString(this.webviewURL);
dest.writeByte(this.isBoostAnimated ? (byte) 1 : (byte) 0); dest.writeByte(this.isBoostAnimated ? (byte) 1 : (byte) 0);
dest.writeByte(this.isFavAnimated ? (byte) 1 : (byte) 0); dest.writeByte(this.isFavAnimated ? (byte) 1 : (byte) 0);
@ -275,7 +273,6 @@ public class Status implements Parcelable{
this.isExpanded = in.readByte() != 0; this.isExpanded = in.readByte() != 0;
this.numberLines = in.readInt(); this.numberLines = in.readInt();
this.conversationProfilePicture = in.createStringArrayList(); this.conversationProfilePicture = in.createStringArrayList();
this.conversationProfilePictureStatic = in.createStringArrayList();
this.webviewURL = in.readString(); this.webviewURL = in.readString();
this.isBoostAnimated = in.readByte() != 0; this.isBoostAnimated = in.readByte() != 0;
this.isFavAnimated = in.readByte() != 0; this.isFavAnimated = in.readByte() != 0;
@ -1614,11 +1611,4 @@ public class Status implements Parcelable{
this.imageURL = imageURL; this.imageURL = imageURL;
} }
public List<String> getConversationProfilePictureStatic() {
return conversationProfilePictureStatic;
}
public void setConversationProfilePictureStatic(List<String> conversationProfilePictureStatic) {
this.conversationProfilePictureStatic = conversationProfilePictureStatic;
}
} }

View File

@ -503,19 +503,17 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
List<Status> statusesConversations = new ArrayList<>(); List<Status> statusesConversations = new ArrayList<>();
if( conversations != null) { if( conversations != null) {
for (Conversation conversation : conversations) { for (Conversation conversation : conversations) {
app.fedilab.android.client.Entities.Status status = conversation.getLast_status(); Status status = conversation.getLast_status();
List<String> ppConversationStatic = new ArrayList<>(); if (status != null) {
List<String> ppConversation = new ArrayList<>();
for (Account account : conversation.getAccounts()) {
ppConversationStatic.add(account.getAvatar_static());
ppConversation.add(account.getAvatar());
}
status.setConversationProfilePicture(ppConversation);
status.setConversationProfilePictureStatic(ppConversationStatic);
status.setConversationId(conversation.getId()); status.setConversationId(conversation.getId());
List<String> ppConversation = new ArrayList<>();
for (Account account : conversation.getAccounts())
ppConversation.add(account.getAvatar());
status.setConversationProfilePicture(ppConversation);
statusesConversations.add(status); statusesConversations.add(status);
} }
} }
}
apiResponse.setStatuses(statusesConversations); apiResponse.setStatuses(statusesConversations);
} }
int previousPosition = this.statuses.size(); int previousPosition = this.statuses.size();