Switch to "home as up" button on new contact selection activity.

Fixes #3687
// FREEBIE
This commit is contained in:
Moxie Marlinspike 2015-07-20 17:29:41 -07:00
parent 905b4f0a6b
commit 1daea51cfb

View File

@ -17,7 +17,11 @@
package org.thoughtcrime.securesms;
import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import org.thoughtcrime.securesms.crypto.MasterSecret;
import org.thoughtcrime.securesms.database.DatabaseFactory;
import org.thoughtcrime.securesms.database.ThreadDatabase;
import org.thoughtcrime.securesms.recipients.RecipientFactory;
@ -33,6 +37,14 @@ public class NewConversationActivity extends ContactSelectionActivity {
private static final String TAG = NewConversationActivity.class.getSimpleName();
@Override
public void onCreate(Bundle bundle, MasterSecret masterSecret) {
super.onCreate(bundle, masterSecret);
action.setVisibility(View.GONE);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
public void onContactSelected(String number) {
Recipients recipients = RecipientFactory.getRecipientsFromString(this, number, true);
@ -54,4 +66,15 @@ public class NewConversationActivity extends ContactSelectionActivity {
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
super.onOptionsItemSelected(item);
switch (item.getItemId()) {
case android.R.id.home: super.onBackPressed(); return true;
}
return false;
}
}