mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 01:07:47 +00:00
Return to archive on back button press in archived convo
When the back/up/home button in the action bar is pressed in an archived conversation, return to the archive instead of the inbox. Closes #4770 // FREEBIE
This commit is contained in:
parent
8fb73a092d
commit
eebe227a20
@ -163,6 +163,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
|
|
||||||
public static final String RECIPIENTS_EXTRA = "recipients";
|
public static final String RECIPIENTS_EXTRA = "recipients";
|
||||||
public static final String THREAD_ID_EXTRA = "thread_id";
|
public static final String THREAD_ID_EXTRA = "thread_id";
|
||||||
|
public static final String IS_ARCHIVED_EXTRA = "is_archived";
|
||||||
public static final String TEXT_EXTRA = "draft_text";
|
public static final String TEXT_EXTRA = "draft_text";
|
||||||
public static final String DISTRIBUTION_TYPE_EXTRA = "distribution_type";
|
public static final String DISTRIBUTION_TYPE_EXTRA = "distribution_type";
|
||||||
|
|
||||||
@ -199,6 +200,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
private Recipients recipients;
|
private Recipients recipients;
|
||||||
private long threadId;
|
private long threadId;
|
||||||
private int distributionType;
|
private int distributionType;
|
||||||
|
private boolean archived;
|
||||||
private boolean isSecureText;
|
private boolean isSecureText;
|
||||||
private boolean isSecureVoice;
|
private boolean isSecureVoice;
|
||||||
private boolean isMmsEnabled = true;
|
private boolean isMmsEnabled = true;
|
||||||
@ -426,7 +428,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
//////// Event Handlers
|
//////// Event Handlers
|
||||||
|
|
||||||
private void handleReturnToConversationList() {
|
private void handleReturnToConversationList() {
|
||||||
Intent intent = new Intent(this, ConversationListActivity.class);
|
Intent intent = new Intent(this, (archived ? ConversationListArchiveActivity.class : ConversationListActivity.class));
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
finish();
|
finish();
|
||||||
@ -917,6 +919,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
|
|
||||||
recipients = RecipientFactory.getRecipientsForIds(this, getIntent().getLongArrayExtra(RECIPIENTS_EXTRA), true);
|
recipients = RecipientFactory.getRecipientsForIds(this, getIntent().getLongArrayExtra(RECIPIENTS_EXTRA), true);
|
||||||
threadId = getIntent().getLongExtra(THREAD_ID_EXTRA, -1);
|
threadId = getIntent().getLongExtra(THREAD_ID_EXTRA, -1);
|
||||||
|
archived = getIntent().getBooleanExtra(IS_ARCHIVED_EXTRA, false);
|
||||||
distributionType = getIntent().getIntExtra(DISTRIBUTION_TYPE_EXTRA, ThreadDatabase.DistributionTypes.DEFAULT);
|
distributionType = getIntent().getIntExtra(DISTRIBUTION_TYPE_EXTRA, ThreadDatabase.DistributionTypes.DEFAULT);
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
|
||||||
|
@ -57,6 +57,7 @@ public class ConversationListArchiveActivity extends PassphraseRequiredActionBar
|
|||||||
Intent intent = new Intent(this, ConversationActivity.class);
|
Intent intent = new Intent(this, ConversationActivity.class);
|
||||||
intent.putExtra(ConversationActivity.RECIPIENTS_EXTRA, recipients.getIds());
|
intent.putExtra(ConversationActivity.RECIPIENTS_EXTRA, recipients.getIds());
|
||||||
intent.putExtra(ConversationActivity.THREAD_ID_EXTRA, threadId);
|
intent.putExtra(ConversationActivity.THREAD_ID_EXTRA, threadId);
|
||||||
|
intent.putExtra(ConversationActivity.IS_ARCHIVED_EXTRA, true);
|
||||||
intent.putExtra(ConversationActivity.DISTRIBUTION_TYPE_EXTRA, distributionType);
|
intent.putExtra(ConversationActivity.DISTRIBUTION_TYPE_EXTRA, distributionType);
|
||||||
|
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user