mirror of
https://github.com/pierre42100/ComunicAndroid
synced 2024-11-23 13:59:29 +00:00
Added backward button on conversation fragment.
This commit is contained in:
parent
d2fbd4213e
commit
36cba023af
@ -188,6 +188,12 @@ public class MainActivity extends AppCompatActivity implements openConversationL
|
|||||||
//Get action id
|
//Get action id
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
//To go backward
|
||||||
|
if(id == android.R.id.home){
|
||||||
|
getSupportFragmentManager().popBackStack();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
//To search a user
|
//To search a user
|
||||||
if(id == R.id.action_search_user){
|
if(id == R.id.action_search_user){
|
||||||
searchUser();
|
searchUser();
|
||||||
|
@ -13,6 +13,7 @@ import android.util.ArrayMap;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
@ -305,6 +306,8 @@ public class ConversationFragment extends Fragment
|
|||||||
((MainActivity) getActivity())
|
((MainActivity) getActivity())
|
||||||
.setSelectedNavigationItem(R.id.main_bottom_navigation_conversations);
|
.setSelectedNavigationItem(R.id.main_bottom_navigation_conversations);
|
||||||
|
|
||||||
|
((MainActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
//Check for conversation information
|
//Check for conversation information
|
||||||
if(conversationInfo == null){
|
if(conversationInfo == null){
|
||||||
|
|
||||||
@ -333,6 +336,8 @@ public class ConversationFragment extends Fragment
|
|||||||
super.onPause();
|
super.onPause();
|
||||||
|
|
||||||
refreshRunnable.quitSafely();
|
refreshRunnable.quitSafely();
|
||||||
|
|
||||||
|
((MainActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user