mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-03 17:59:39 +02:00
use tri-state for archived
This commit is contained in:
parent
0a30ebdc5b
commit
c3556f01f2
4 changed files with 9 additions and 10 deletions
|
@ -447,11 +447,11 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( dcChat.getArchived()==0 ) {
|
if( dcChat.getArchived()==1 ) {
|
||||||
inflater.inflate(R.menu.conversation_archive, menu);
|
inflater.inflate(R.menu.conversation_unarchive, menu);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
inflater.inflate(R.menu.conversation_unarchive, menu);
|
inflater.inflate(R.menu.conversation_archive, menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
inflater.inflate(R.menu.conversation_delete, menu);
|
inflater.inflate(R.menu.conversation_delete, menu);
|
||||||
|
@ -558,7 +558,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleArchiveChat() {
|
private void handleArchiveChat() {
|
||||||
int doArchive = dcContext.getChat(chatId).getArchived() == 0 ? 1: 0;
|
int doArchive = dcContext.getChat(chatId).getArchived() == 1 ? 0: 1;
|
||||||
dcContext.archiveChat(chatId, doArchive);
|
dcContext.archiveChat(chatId, doArchive);
|
||||||
Toast.makeText(this, getString(R.string.done), Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, getString(R.string.done), Toast.LENGTH_SHORT).show();
|
||||||
if( doArchive == 1 ) {
|
if( doArchive == 1 ) {
|
||||||
|
|
|
@ -254,7 +254,7 @@ public class ConversationListItem extends RelativeLayout
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setStatusIcons(ThreadRecord thread) {
|
private void setStatusIcons(ThreadRecord thread) {
|
||||||
if (thread.isArchived())
|
if (thread.getArchived()==1)
|
||||||
{
|
{
|
||||||
// archived
|
// archived
|
||||||
this.archivedView.setVisibility(View.VISIBLE);
|
this.archivedView.setVisibility(View.VISIBLE);
|
||||||
|
|
|
@ -279,12 +279,11 @@ public class ApplicationDcContext extends DcContext {
|
||||||
Recipient recipient = getRecipient(chat);
|
Recipient recipient = getRecipient(chat);
|
||||||
long date = summary.getTimestamp();
|
long date = summary.getTimestamp();
|
||||||
int unreadCount = getFreshMsgCount(chatId);
|
int unreadCount = getFreshMsgCount(chatId);
|
||||||
boolean archived = chat.getArchived() != 0;
|
|
||||||
boolean verified = chat.isVerified();
|
boolean verified = chat.isVerified();
|
||||||
|
|
||||||
return new ThreadRecord(context, body, recipient, date,
|
return new ThreadRecord(context, body, recipient, date,
|
||||||
unreadCount, chatId,
|
unreadCount, chatId,
|
||||||
archived, verified, chat.isSendingLocations(), summary);
|
chat.getArchived(), verified, chat.isSendingLocations(), summary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class ThreadRecord {
|
||||||
private final String body;
|
private final String body;
|
||||||
|
|
||||||
private final int unreadCount;
|
private final int unreadCount;
|
||||||
private final boolean archived;
|
private final int archived;
|
||||||
private final boolean verified;
|
private final boolean verified;
|
||||||
private final boolean isSendingLocations;
|
private final boolean isSendingLocations;
|
||||||
private @Nullable final DcLot dcSummary;
|
private @Nullable final DcLot dcSummary;
|
||||||
|
@ -53,7 +53,7 @@ public class ThreadRecord {
|
||||||
public ThreadRecord(@NonNull Context context, @NonNull String body,
|
public ThreadRecord(@NonNull Context context, @NonNull String body,
|
||||||
@NonNull Recipient recipient, long dateReceived, int unreadCount,
|
@NonNull Recipient recipient, long dateReceived, int unreadCount,
|
||||||
long threadId,
|
long threadId,
|
||||||
boolean archived,
|
int archived,
|
||||||
boolean verified,
|
boolean verified,
|
||||||
boolean isSendingLocations,
|
boolean isSendingLocations,
|
||||||
@Nullable DcLot dcSummary)
|
@Nullable DcLot dcSummary)
|
||||||
|
@ -110,7 +110,7 @@ public class ThreadRecord {
|
||||||
return getDateReceived();
|
return getDateReceived();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isArchived() {
|
public int getArchived() {
|
||||||
return archived;
|
return archived;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue