diff --git a/android/app/src/main/java/com/chatman/ChatFragment.java b/android/app/src/main/java/com/chatman/BotFragment.java similarity index 57% rename from android/app/src/main/java/com/chatman/ChatFragment.java rename to android/app/src/main/java/com/chatman/BotFragment.java index d9674387368c79d1dd460f093235555cb12c33de..842c3d926b6bcb4466467869856a0d87a4c7e28d 100644 --- a/android/app/src/main/java/com/chatman/ChatFragment.java +++ b/android/app/src/main/java/com/chatman/BotFragment.java @@ -3,46 +3,50 @@ package com.chatman; import android.content.Context; import android.net.Uri; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import android.support.v4.app.Fragment; -import android.support.v4.view.GravityCompat; -import android.support.v4.widget.DrawerLayout; -import android.support.v7.widget.LinearLayoutManager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import com.google.firebase.database.DataSnapshot; -import com.google.firebase.database.DatabaseError; -import com.google.firebase.database.ValueEventListener; - /** * A simple {@link Fragment} subclass. * Activities that contain this fragment must implement the - * {@link ChatFragment.OnFragmentInteractionListener} interface + * {@link BotFragment.OnFragmentInteractionListener} interface * to handle interaction events. - * Use the {@link ChatFragment#newInstance} factory method to + * Use the {@link BotFragment#newInstance} factory method to * create an instance of this fragment. */ -public class ChatFragment extends Fragment { +public class BotFragment extends Fragment { + // TODO: Rename parameter arguments, choose names that match // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER - private static final String ARG_NAMA = "nama"; - private static final String ARG_KEY = "key"; + private static final String ARG_PARAM1 = "param1"; + private static final String ARG_PARAM2 = "param2"; - private String nama; + // TODO: Rename and change types of parameters + private String mParam1; + private String mParam2; private OnFragmentInteractionListener mListener; - public ChatFragment() { + public BotFragment() { // Required empty public constructor } - public static ChatFragment newInstance(String param1) { - ChatFragment fragment = new ChatFragment(); + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment BotFragment. + */ + // TODO: Rename and change types and number of parameters + public static BotFragment newInstance(String param1, String param2) { + BotFragment fragment = new BotFragment(); Bundle args = new Bundle(); - args.putString(ARG_NAMA, param1); + args.putString(ARG_PARAM1, param1); + args.putString(ARG_PARAM2, param2); fragment.setArguments(args); return fragment; } @@ -51,33 +55,18 @@ public class ChatFragment extends Fragment { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments() != null) { - nama = getArguments().getString(ARG_NAMA); - } else { - nama = "Dummy"; + mParam1 = getArguments().getString(ARG_PARAM1); + mParam2 = getArguments().getString(ARG_PARAM2); } } @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { // Inflate the layout for this fragment - return inflater.inflate(R.layout.fragment_chat, container, false); - } - - @Override - public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { - super.onViewCreated(view, savedInstanceState); - ((MainActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true); - -// LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext()); -// linearLayoutManager.setReverseLayout(true); -// linearLayoutManager.setStackFromEnd(true); -// recycler.setLayoutManager(linearLayoutManager); -// getChatList(); -// adapter = new ChatAdapter(chatList); -// recycler.setAdapter(adapter); + return inflater.inflate(R.layout.fragment_bot, container, false); } - // TODO: Rename method, update argument and hook method into UI event public void onButtonPressed(Uri uri) { if (mListener != null) { @@ -116,4 +105,5 @@ public class ChatFragment extends Fragment { // TODO: Update argument type and name void onFragmentInteraction(Uri uri); } + } diff --git a/android/app/src/main/java/com/chatman/HomeFragment.java b/android/app/src/main/java/com/chatman/HomeFragment.java new file mode 100644 index 0000000000000000000000000000000000000000..98d8896d848a69079ea3babb34b4672f8ee8566a --- /dev/null +++ b/android/app/src/main/java/com/chatman/HomeFragment.java @@ -0,0 +1,159 @@ +package com.chatman; + +import android.content.Context; +import android.net.Uri; +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.chatman.adapter.ChatListAdapter; +import com.chatman.model.ChatList; + +import java.util.List; + + +/** + * A simple {@link Fragment} subclass. + * Activities that contain this fragment must implement the + * {@link HomeFragment.OnFragmentInteractionListener} interface + * to handle interaction events. + * Use the {@link HomeFragment#newInstance} factory method to + * create an instance of this fragment. + */ +public class HomeFragment extends Fragment { + + private RecyclerView recycler; + private ChatListAdapter adapter; + private List<ChatList> chatLists; + + private OnFragmentInteractionListener mListener; + + public HomeFragment() { + // Required empty public constructor + } + + public static HomeFragment newInstance() { + HomeFragment fragment = new HomeFragment(); + return fragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_home, container, false); + } + + // TODO: Rename method, update argument and hook method into UI event + public void onButtonPressed(Uri uri) { + if (mListener != null) { + mListener.onFragmentInteraction(uri); + } + } + + @Override + public void onAttach(Context context) { + super.onAttach(context); + if (context instanceof OnFragmentInteractionListener) { + mListener = (OnFragmentInteractionListener) context; + } else { + throw new RuntimeException(context.toString() + + " must implement OnFragmentInteractionListener"); + } + } + + @Override + public void onDetach() { + super.onDetach(); + mListener = null; + } + + /** + * This interface must be implemented by activities that contain this + * fragment to allow an interaction in this fragment to be communicated + * to the activity and potentially other fragments contained in that + * activity. + * <p> + * See the Android Training lesson <a href= + * "http://developer.android.com/training/basics/fragments/communicating.html" + * >Communicating with Other Fragments</a> for more information. + */ + public interface OnFragmentInteractionListener { + // TODO: Update argument type and name + void onFragmentInteraction(Uri uri); + } + + // // Todo: Ganti data dummmy jadi data asli ngambil dari database +// private List<ChatList> getChatLists() { +// chatLists = new ArrayList<>(); +// chatLists.add(new ChatList( +// R.drawable.priagung, +// "Priagung Satyagama", +// "Woi sini ke sekre 2 temani diriku yang kesepian" +// )); +// chatLists.add(new ChatList( +// R.drawable.rama, +// "Yusuf Rahmat Pratama", +// "Eh, gmn gmn?" +// )); +// chatLists.add(new ChatList( +// R.drawable.priagung, +// "Priagung Satyagama", +// "Woi sini ke sekre 2 temani diriku yang kesepian" +// )); +// chatLists.add(new ChatList( +// R.drawable.rama, +// "Yusuf Rahmat Pratama", +// "Eh, gmn gmn?" +// )); +// chatLists.add(new ChatList( +// R.drawable.priagung, +// "Priagung Satyagama", +// "Woi sini ke sekre 2 temani diriku yang kesepian" +// )); +// chatLists.add(new ChatList( +// R.drawable.rama, +// "Yusuf Rahmat Pratama", +// "Eh, gmn gmn?" +// )); +// chatLists.add(new ChatList( +// R.drawable.priagung, +// "Priagung Satyagama", +// "Woi sini ke sekre 2 temani diriku yang kesepian" +// )); +// chatLists.add(new ChatList( +// R.drawable.rama, +// "Yusuf Rahmat Pratama", +// "Eh, gmn gmn?" +// )); +// chatLists.add(new ChatList( +// R.drawable.priagung, +// "Priagung Satyagama", +// "Woi sini ke sekre 2 temani diriku yang kesepian" +// )); +// chatLists.add(new ChatList( +// R.drawable.rama, +// "Yusuf Rahmat Pratama", +// "Eh, gmn gmn?" +// )); +// chatLists.add(new ChatList( +// R.drawable.priagung, +// "Priagung Satyagama", +// "Woi sini ke sekre 2 temani diriku yang kesepian" +// )); +// chatLists.add(new ChatList( +// R.drawable.rama, +// "Yusuf Rahmat Pratama", +// "Eh, gmn gmn?" +// )); +// return chatLists; +// } +} diff --git a/android/app/src/main/java/com/chatman/MainActivity.java b/android/app/src/main/java/com/chatman/MainActivity.java index ec7c46dda222f78e476eae23c3a084df85df4983..932e33750140846eb71a723f7fa5a64553a87170 100644 --- a/android/app/src/main/java/com/chatman/MainActivity.java +++ b/android/app/src/main/java/com/chatman/MainActivity.java @@ -3,9 +3,13 @@ package com.chatman; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; +import android.net.Uri; import android.os.Bundle; +import android.support.annotation.NonNull; +import android.support.design.widget.BottomNavigationView; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; +import android.support.v4.app.Fragment; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; @@ -17,7 +21,9 @@ import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; +import android.widget.ImageView; +import com.bumptech.glide.Glide; import com.chatman.adapter.ChatListAdapter; import com.chatman.helper.PreferencesHelper; import com.chatman.model.ChatList; @@ -26,40 +32,62 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; -public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { +public class MainActivity extends AppCompatActivity implements + ProfileFragment.OnFragmentInteractionListener, + HomeFragment.OnFragmentInteractionListener, + BotFragment.OnFragmentInteractionListener { - private RecyclerView recycler; - private ChatListAdapter adapter; - private List<ChatList> chatLists; private Context context; + private BottomNavigationView bottomNavbar; + + private Fragment fragment; + + private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener + = new BottomNavigationView.OnNavigationItemSelectedListener() { + + @Override + public boolean onNavigationItemSelected(@NonNull MenuItem item) { + switch (item.getItemId()) { + case R.id.navigation_profile: + loadFragment(new ProfileFragment()); break; + case R.id.navigation_home: + loadFragment(new HomeFragment()); break; + case R.id.navigation_bot: + loadFragment(new BotFragment()); break; + } + + return true; + } + }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + toolbar.setTitle(""); + ImageView toolbarImage = findViewById(R.id.toolbar_image); + Glide.with(this).load(getImage("logo")).fitCenter().into(toolbarImage); setSupportActionBar(toolbar); context = this; // Recycler View - recycler = findViewById(R.id.chat_list_rv); - LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context); - linearLayoutManager.setReverseLayout(true); - linearLayoutManager.setStackFromEnd(true); - recycler.setLayoutManager(linearLayoutManager); - getChatLists(); - adapter = new ChatListAdapter(chatLists); - recycler.setAdapter(adapter); - - - DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); - ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( - this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); - drawer.addDrawerListener(toggle); - toggle.syncState(); - - NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); - navigationView.setNavigationItemSelectedListener(this); +// recycler = findViewById(R.id.chat_list_rv); +// LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context); +// linearLayoutManager.setReverseLayout(true); +// linearLayoutManager.setStackFromEnd(true); +// recycler.setLayoutManager(linearLayoutManager); +// getChatLists(); +// adapter = new ChatListAdapter(chatLists); +// recycler.setAdapter(adapter); + + + // Bottom Navigation Bar + bottomNavbar = findViewById(R.id.navigation); + bottomNavbar.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener); + + //Set laman pertama + loadFragment(new ProfileFragment()); } @Override @@ -72,113 +100,36 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On } } - @Override - public boolean onCreateOptionsMenu(Menu menu) { - // Inflate the menu; this adds items to the action bar if it is present. - getMenuInflater().inflate(R.menu.main, menu); - return true; - } +// @Override +// public boolean onCreateOptionsMenu(Menu menu) { +// // Inflate the menu; this adds items to the action bar if it is present. +// getMenuInflater().inflate(R.menu.main, menu); +// return true; +// } - @Override - public boolean onOptionsItemSelected(MenuItem item) { - // Handle action bar item clicks here. The action bar will - // automatically handle clicks on the Home/Up button, so long - // as you specify a parent activity in AndroidManifest.xml. - int id = item.getItemId(); - - //noinspection SimplifiableIfStatement - if (id == R.id.action_settings) { + + + public boolean loadFragment(Fragment fragment) { + //switching fragment + if (fragment != null) { + getSupportFragmentManager() + .beginTransaction() + .replace(R.id.fragment_container, fragment) + .commit(); return true; } - - return super.onOptionsItemSelected(item); + return false; } - @SuppressWarnings("StatementWithEmptyBody") - @Override - public boolean onNavigationItemSelected(MenuItem item) { - // Handle navigation view item clicks here. - int id = item.getItemId(); - Intent navigationBarIntent; - if (id == R.id.nav_side_logout) { - // Handle the camera action - navigationBarIntent = new Intent(MainActivity.this, AuthActivity.class); - PreferencesHelper.setUserFirebaseKey(this, ""); - PreferencesHelper.setUserName(this,""); - PreferencesHelper.setHasLogin(this, false); - - finish(); - startActivity(navigationBarIntent); - } + public int getImage(String imageName) { - DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); - drawer.closeDrawer(GravityCompat.START); - return true; + int drawableResourceId = this.getResources().getIdentifier(imageName, "drawable", this.getPackageName()); + + return drawableResourceId; } - // Todo: Ganti data dummmy jadi data asli ngambil dari database - private List<ChatList> getChatLists() { - chatLists = new ArrayList<>(); - chatLists.add(new ChatList( - R.drawable.priagung, - "Priagung Satyagama", - "Woi sini ke sekre 2 temani diriku yang kesepian" - )); - chatLists.add(new ChatList( - R.drawable.rama, - "Yusuf Rahmat Pratama", - "Eh, gmn gmn?" - )); - chatLists.add(new ChatList( - R.drawable.priagung, - "Priagung Satyagama", - "Woi sini ke sekre 2 temani diriku yang kesepian" - )); - chatLists.add(new ChatList( - R.drawable.rama, - "Yusuf Rahmat Pratama", - "Eh, gmn gmn?" - )); - chatLists.add(new ChatList( - R.drawable.priagung, - "Priagung Satyagama", - "Woi sini ke sekre 2 temani diriku yang kesepian" - )); - chatLists.add(new ChatList( - R.drawable.rama, - "Yusuf Rahmat Pratama", - "Eh, gmn gmn?" - )); - chatLists.add(new ChatList( - R.drawable.priagung, - "Priagung Satyagama", - "Woi sini ke sekre 2 temani diriku yang kesepian" - )); - chatLists.add(new ChatList( - R.drawable.rama, - "Yusuf Rahmat Pratama", - "Eh, gmn gmn?" - )); - chatLists.add(new ChatList( - R.drawable.priagung, - "Priagung Satyagama", - "Woi sini ke sekre 2 temani diriku yang kesepian" - )); - chatLists.add(new ChatList( - R.drawable.rama, - "Yusuf Rahmat Pratama", - "Eh, gmn gmn?" - )); - chatLists.add(new ChatList( - R.drawable.priagung, - "Priagung Satyagama", - "Woi sini ke sekre 2 temani diriku yang kesepian" - )); - chatLists.add(new ChatList( - R.drawable.rama, - "Yusuf Rahmat Pratama", - "Eh, gmn gmn?" - )); - return chatLists; + @Override + public void onFragmentInteraction(Uri uri){ + //you can leave it empty } } diff --git a/android/app/src/main/res/drawable/home.png b/android/app/src/main/res/drawable/home.png new file mode 100644 index 0000000000000000000000000000000000000000..c21d8511b0d8aa3e5645682f2d9c7fc076c08971 Binary files /dev/null and b/android/app/src/main/res/drawable/home.png differ diff --git a/android/app/src/main/res/drawable/ic_android_black_96dp.xml b/android/app/src/main/res/drawable/ic_android_black_96dp.xml new file mode 100644 index 0000000000000000000000000000000000000000..f8142bec89cbf1e8674353b01f59a8b60899e579 --- /dev/null +++ b/android/app/src/main/res/drawable/ic_android_black_96dp.xml @@ -0,0 +1,5 @@ +<vector android:height="96dp" android:tint="#233A63" + android:viewportHeight="24.0" android:viewportWidth="24.0" + android:width="96dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="#FF000000" android:pathData="M6,18c0,0.55 0.45,1 1,1h1v3.5c0,0.83 0.67,1.5 1.5,1.5s1.5,-0.67 1.5,-1.5L11,19h2v3.5c0,0.83 0.67,1.5 1.5,1.5s1.5,-0.67 1.5,-1.5L16,19h1c0.55,0 1,-0.45 1,-1L18,8L6,8v10zM3.5,8C2.67,8 2,8.67 2,9.5v7c0,0.83 0.67,1.5 1.5,1.5S5,17.33 5,16.5v-7C5,8.67 4.33,8 3.5,8zM20.5,8c-0.83,0 -1.5,0.67 -1.5,1.5v7c0,0.83 0.67,1.5 1.5,1.5s1.5,-0.67 1.5,-1.5v-7c0,-0.83 -0.67,-1.5 -1.5,-1.5zM15.53,2.16l1.3,-1.3c0.2,-0.2 0.2,-0.51 0,-0.71 -0.2,-0.2 -0.51,-0.2 -0.71,0l-1.48,1.48C13.85,1.23 12.95,1 12,1c-0.96,0 -1.86,0.23 -2.66,0.63L7.85,0.15c-0.2,-0.2 -0.51,-0.2 -0.71,0 -0.2,0.2 -0.2,0.51 0,0.71l1.31,1.31C6.97,3.26 6,5.01 6,7h12c0,-1.99 -0.97,-3.75 -2.47,-4.84zM10,5L9,5L9,4h1v1zM15,5h-1L14,4h1v1z"/> +</vector> diff --git a/android/app/src/main/res/drawable/ln_logo.png b/android/app/src/main/res/drawable/ln_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..c0b951fb2bbf3727fe2159423e9d80a19343fa99 Binary files /dev/null and b/android/app/src/main/res/drawable/ln_logo.png differ diff --git a/android/app/src/main/res/drawable/profile.png b/android/app/src/main/res/drawable/profile.png new file mode 100644 index 0000000000000000000000000000000000000000..104ec539a7b6ea272d3cd32cf39932c9413d79ac Binary files /dev/null and b/android/app/src/main/res/drawable/profile.png differ diff --git a/android/app/src/main/res/drawable/robotic.png b/android/app/src/main/res/drawable/robotic.png new file mode 100644 index 0000000000000000000000000000000000000000..fee4963c2d6bde2f7f3b5c159fdb5789d3439319 Binary files /dev/null and b/android/app/src/main/res/drawable/robotic.png differ diff --git a/android/app/src/main/res/layout/activity_main.xml b/android/app/src/main/res/layout/activity_main.xml index a61d8a6300f62056e6801f60f572b0e6e3515507..7332f150f8f1403072547bdd949e2f164211109f 100644 --- a/android/app/src/main/res/layout/activity_main.xml +++ b/android/app/src/main/res/layout/activity_main.xml @@ -13,13 +13,13 @@ android:layout_width="match_parent" android:layout_height="match_parent" /> - <android.support.design.widget.NavigationView - android:id="@+id/nav_view" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:layout_gravity="start" - android:fitsSystemWindows="true" - app:headerLayout="@layout/nav_header_main" - app:menu="@menu/activity_main_drawer" /> + <!--<android.support.design.widget.NavigationView--> + <!--android:id="@+id/nav_view"--> + <!--android:layout_width="wrap_content"--> + <!--android:layout_height="match_parent"--> + <!--android:layout_gravity="start"--> + <!--android:fitsSystemWindows="true"--> + <!--app:headerLayout="@layout/nav_header_main"--> + <!--app:menu="@menu/activity_main_drawer" />--> </android.support.v4.widget.DrawerLayout> diff --git a/android/app/src/main/res/layout/app_bar_main.xml b/android/app/src/main/res/layout/app_bar_main.xml index e73eece92bb515ae95b17297efddade946d6a4d0..7e1101de988e36814a783554a4faeb75abd9a134 100644 --- a/android/app/src/main/res/layout/app_bar_main.xml +++ b/android/app/src/main/res/layout/app_bar_main.xml @@ -16,8 +16,28 @@ android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" - android:background="?attr/colorPrimary" - app:popupTheme="@style/AppTheme.PopupOverlay" /> + android:background="@android:color/white" + app:popupTheme="@style/AppTheme.PopupOverlay"> + + <android.support.constraint.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:foregroundGravity="center"> + + <ImageView + android:id="@+id/toolbar_image" + android:layout_width="100dp" + android:layout_height="30dp" + android:layout_marginEnd="16dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent"/> + + + </android.support.constraint.ConstraintLayout> + + </android.support.v7.widget.Toolbar> </android.support.design.widget.AppBarLayout> diff --git a/android/app/src/main/res/layout/content_main.xml b/android/app/src/main/res/layout/content_main.xml index fc7f50ba721481994e6cc7416b36e1657dc76a9e..9ea0d2e694249ede260dbf8152f702c16ffd94d7 100644 --- a/android/app/src/main/res/layout/content_main.xml +++ b/android/app/src/main/res/layout/content_main.xml @@ -13,17 +13,22 @@ android:layout_width="match_parent" android:layout_height="match_parent" app:layout_constraintLeft_toLeftOf="parent" - app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toTopOf="parent" + android:layout_marginBottom="56dp"/> + - <!--<android.support.v7.widget.RecyclerView--> - <!--android:id="@+id/chat_list_rv"--> - <!--android:layout_width="match_parent"--> - <!--android:layout_height="match_parent"--> - <!--app:layout_constraintStart_toStartOf="parent"--> - <!--app:layout_constraintEnd_toEndOf="parent"--> - <!--app:layout_constraintTop_toTopOf="parent"--> - <!--app:layout_constraintBottom_toBottomOf="parent">--> <!--</android.support.v7.widget.RecyclerView>--> + <android.support.design.widget.BottomNavigationView + android:id="@+id/navigation" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="0dp" + android:layout_marginEnd="0dp" + android:background="?android:attr/windowBackground" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:menu="@menu/navigation" /> </android.support.constraint.ConstraintLayout> \ No newline at end of file diff --git a/android/app/src/main/res/layout/fragment_chat.xml b/android/app/src/main/res/layout/fragment_bot.xml similarity index 82% rename from android/app/src/main/res/layout/fragment_chat.xml rename to android/app/src/main/res/layout/fragment_bot.xml index ea2cfd74483d56f051511236933b9e86521cf07e..d530ae6f203fd6e89b42678291a1ad5e48838968 100644 --- a/android/app/src/main/res/layout/fragment_chat.xml +++ b/android/app/src/main/res/layout/fragment_bot.xml @@ -3,12 +3,12 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".ChatFragment"> + tools:context=".BotFragment"> <!-- TODO: Update blank fragment layout --> <TextView android:layout_width="match_parent" android:layout_height="match_parent" - android:text="@string/hello_blank_fragment" /> + android:text="Bot fragment" /> </FrameLayout> \ No newline at end of file diff --git a/android/app/src/main/res/layout/fragment_home.xml b/android/app/src/main/res/layout/fragment_home.xml new file mode 100644 index 0000000000000000000000000000000000000000..bfe64f4dbf9a7514040c68a1bc2492a4a365f321 --- /dev/null +++ b/android/app/src/main/res/layout/fragment_home.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + xmlns:app="http://schemas.android.com/apk/res-auto" + tools:context=".BotFragment"> + + <android.support.v7.widget.RecyclerView + android:id="@+id/chat_list_rv" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent"/> + +</android.support.constraint.ConstraintLayout> \ No newline at end of file diff --git a/android/app/src/main/res/menu/navigation.xml b/android/app/src/main/res/menu/navigation.xml new file mode 100644 index 0000000000000000000000000000000000000000..67329dd70d7d983b804fdef15da16e5ead260c6c --- /dev/null +++ b/android/app/src/main/res/menu/navigation.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + + + + <item + android:id="@+id/navigation_profile" + android:icon="@drawable/profile" + android:title="@string/navigation_profile" /> + + <item + android:id="@+id/navigation_home" + android:icon="@drawable/home" + android:title="@string/navigation_home" /> + + <item + android:id="@+id/navigation_bot" + android:icon="@drawable/robotic" + android:title="@string/navigation_bot" /> + + +</menu> diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 3c0a395c12fbc099c6d43b6aa834404162a38d6c..ba5a5b4cf63d82f5b95b21bbb5e563b185c3f2fc 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -22,5 +22,8 @@ <!-- TODO: Remove or change this placeholder text --> <string name="hello_blank_fragment">Hello blank fragment</string> + <string name="navigation_profile">Profile</string> + <string name="navigation_home">Home</string> + <string name="navigation_bot">Bot</string> </resources>