Created conversation list fragment

This commit is contained in:
Pierre 2017-12-06 18:46:49 +01:00
parent b89221ab94
commit 4e90fd9793
4 changed files with 41 additions and 1 deletions

View File

@ -17,6 +17,7 @@ import org.communiquons.android.comunic.client.data.Account.Account;
import org.communiquons.android.comunic.client.data.Account.AccountUtils;
import org.communiquons.android.comunic.client.data.DatabaseHelper;
import org.communiquons.android.comunic.client.data.friendsList.FriendRefreshLoopRunnable;
import org.communiquons.android.comunic.client.fragments.ConversationsListFragment;
import org.communiquons.android.comunic.client.fragments.FriendsListFragment;
import org.communiquons.android.comunic.client.fragments.UserInfosFragment;
@ -151,11 +152,16 @@ public class MainActivity extends AppCompatActivity {
openFriendsFragment();
return true;
//If the user choosed to show informations about him
//If the user chose to show information about him
case R.id.main_bottom_navigation_me_view:
openUserInfosFragment();
return true;
//If the user wants to switch to the conversation fragment
case R.id.main_bottom_navigation_conversations:
openConversationsListFragment();
return true;
}
//Selected element not found
@ -219,4 +225,15 @@ public class MainActivity extends AppCompatActivity {
transaction.addToBackStack(null);
transaction.commit();
}
/**
* Open the conversation list fragment
*/
void openConversationsListFragment(){
ConversationsListFragment conversationsListFragment = new ConversationsListFragment();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.replace(R.id.main_fragment, conversationsListFragment);
transaction.addToBackStack(null);
transaction.commit();
}
}

View File

@ -0,0 +1,17 @@
package org.communiquons.android.comunic.client.fragments;
import android.app.Fragment;
/**
* Conversation list fragment
*
* Display all the conversations list
*
* @author Pierre HUBERT
* Created by pierre on 12/6/17.
*/
public class ConversationsListFragment extends Fragment {
}

View File

@ -12,4 +12,9 @@
android:icon="@drawable/ic_menu_home"
/>
<item
android:id="@+id/main_bottom_navigation_conversations"
android:title="@string/navigation_bottom_conversations_item"
android:icon="@drawable/ic_menu_conversations"
/>
</menu>

View File

@ -27,4 +27,5 @@
<string name="popup_deletefriend_button_cancel">Cancel</string>
<string name="action_friends_accept_request">Accept</string>
<string name="user_image_description">User Image Account</string>
<string name="navigation_bottom_conversations_item">Conversations</string>
</resources>