Show back button in chat activity
This commit is contained in:
parent
5d9a8fb8d7
commit
d37d17e5f2
|
@ -60,18 +60,20 @@ public class ChatActivity extends AppCompatActivity
|
||||||
setContentView(R.layout.activity_chat);
|
setContentView(R.layout.activity_chat);
|
||||||
ButterKnife.bind(this);
|
ButterKnife.bind(this);
|
||||||
|
|
||||||
setSupportActionBar(toolbar);
|
|
||||||
|
|
||||||
MercuryImApplication.getApplication().getAppComponent().inject(this);
|
MercuryImApplication.getApplication().getAppComponent().inject(this);
|
||||||
|
|
||||||
recyclerView.setAdapter(recyclerViewAdapter);
|
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
|
||||||
|
|
||||||
if (savedInstanceState == null) {
|
if (savedInstanceState == null) {
|
||||||
savedInstanceState = getIntent().getExtras();
|
savedInstanceState = getIntent().getExtras();
|
||||||
if (savedInstanceState == null) return;
|
if (savedInstanceState == null) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
// Show back arrow
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
|
recyclerView.setAdapter(recyclerViewAdapter);
|
||||||
|
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
|
||||||
String jidString = savedInstanceState.getString(EXTRA_JID);
|
String jidString = savedInstanceState.getString(EXTRA_JID);
|
||||||
if (jidString != null) {
|
if (jidString != null) {
|
||||||
jid = JidCreate.entityBareFromOrThrowUnchecked(jidString);
|
jid = JidCreate.entityBareFromOrThrowUnchecked(jidString);
|
||||||
|
@ -179,4 +181,11 @@ public class ChatActivity extends AppCompatActivity
|
||||||
chatViewModel.queryTextChanged(query);
|
chatViewModel.queryTextChanged(query);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onSupportNavigateUp() {
|
||||||
|
// Go back when left arrow is pressed in toolbar
|
||||||
|
onBackPressed();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue