diff --git a/app/src/main/java/com/modarb/android/network/ApiService.kt b/app/src/main/java/com/modarb/android/network/ApiService.kt index 21af20f..18ce6ff 100644 --- a/app/src/main/java/com/modarb/android/network/ApiService.kt +++ b/app/src/main/java/com/modarb/android/network/ApiService.kt @@ -8,10 +8,10 @@ import retrofit2.http.Body import retrofit2.http.POST interface ApiService { - @POST("/api/v1/users/auth/login") + @POST("/api/v1/user/auth/login") suspend fun loginUser(@Body loginRequest: LoginRequest): Response - @POST("/api/v1/users/auth/register") + @POST("/api/v1/user/auth/register") suspend fun registerUser(@Body registerRequest: RegisterRequest): Response } diff --git a/app/src/main/java/com/modarb/android/ui/home/ui/dashboard/DashboardFragment.kt b/app/src/main/java/com/modarb/android/ui/home/ui/dashboard/DashboardFragment.kt deleted file mode 100644 index 99e7386..0000000 --- a/app/src/main/java/com/modarb/android/ui/home/ui/dashboard/DashboardFragment.kt +++ /dev/null @@ -1,42 +0,0 @@ -package com.modarb.android.ui.home.ui.dashboard - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.TextView -import androidx.fragment.app.Fragment -import androidx.lifecycle.ViewModelProvider -import com.modarb.android.databinding.FragmentDashboardBinding - -class DashboardFragment : Fragment() { - - private var _binding: FragmentDashboardBinding? = null - - // This property is only valid between onCreateView and - // onDestroyView. - private val binding get() = _binding!! - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle? - ): View { - val dashboardViewModel = - ViewModelProvider(this).get(DashboardViewModel::class.java) - - _binding = FragmentDashboardBinding.inflate(inflater, container, false) - val root: View = binding.root - - val textView: TextView = binding.textDashboard - dashboardViewModel.text.observe(viewLifecycleOwner) { - textView.text = it - } - return root - } - - override fun onDestroyView() { - super.onDestroyView() - _binding = null - } -} \ No newline at end of file diff --git a/app/src/main/java/com/modarb/android/ui/home/ui/dashboard/DashboardViewModel.kt b/app/src/main/java/com/modarb/android/ui/home/ui/dashboard/DashboardViewModel.kt deleted file mode 100644 index 1980db3..0000000 --- a/app/src/main/java/com/modarb/android/ui/home/ui/dashboard/DashboardViewModel.kt +++ /dev/null @@ -1,13 +0,0 @@ -package com.modarb.android.ui.home.ui.dashboard - -import androidx.lifecycle.LiveData -import androidx.lifecycle.MutableLiveData -import androidx.lifecycle.ViewModel - -class DashboardViewModel : ViewModel() { - - private val _text = MutableLiveData().apply { - value = "This is dashboard Fragment" - } - val text: LiveData = _text -} \ No newline at end of file diff --git a/app/src/main/java/com/modarb/android/ui/home/ui/notifications/NotificationsFragment.kt b/app/src/main/java/com/modarb/android/ui/home/ui/notifications/NotificationsFragment.kt deleted file mode 100644 index 5cb1f42..0000000 --- a/app/src/main/java/com/modarb/android/ui/home/ui/notifications/NotificationsFragment.kt +++ /dev/null @@ -1,42 +0,0 @@ -package com.modarb.android.ui.home.ui.notifications - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.TextView -import androidx.fragment.app.Fragment -import androidx.lifecycle.ViewModelProvider -import com.modarb.android.databinding.FragmentNotificationsBinding - -class NotificationsFragment : Fragment() { - - private var _binding: FragmentNotificationsBinding? = null - - // This property is only valid between onCreateView and - // onDestroyView. - private val binding get() = _binding!! - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle? - ): View { - val notificationsViewModel = - ViewModelProvider(this).get(NotificationsViewModel::class.java) - - _binding = FragmentNotificationsBinding.inflate(inflater, container, false) - val root: View = binding.root - - val textView: TextView = binding.textNotifications - notificationsViewModel.text.observe(viewLifecycleOwner) { - textView.text = it - } - return root - } - - override fun onDestroyView() { - super.onDestroyView() - _binding = null - } -} \ No newline at end of file diff --git a/app/src/main/java/com/modarb/android/ui/home/ui/notifications/NotificationsViewModel.kt b/app/src/main/java/com/modarb/android/ui/home/ui/notifications/NotificationsViewModel.kt deleted file mode 100644 index 1cc8ac8..0000000 --- a/app/src/main/java/com/modarb/android/ui/home/ui/notifications/NotificationsViewModel.kt +++ /dev/null @@ -1,13 +0,0 @@ -package com.modarb.android.ui.home.ui.notifications - -import androidx.lifecycle.LiveData -import androidx.lifecycle.MutableLiveData -import androidx.lifecycle.ViewModel - -class NotificationsViewModel : ViewModel() { - - private val _text = MutableLiveData().apply { - value = "This is notifications Fragment" - } - val text: LiveData = _text -} \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_home.xml b/app/src/main/res/drawable/ic_home.xml new file mode 100644 index 0000000..6538309 --- /dev/null +++ b/app/src/main/res/drawable/ic_home.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_more.xml b/app/src/main/res/drawable/ic_more.xml new file mode 100644 index 0000000..769f60f --- /dev/null +++ b/app/src/main/res/drawable/ic_more.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_my_plan.xml b/app/src/main/res/drawable/ic_my_plan.xml new file mode 100644 index 0000000..2ff369e --- /dev/null +++ b/app/src/main/res/drawable/ic_my_plan.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_nutrition.xml b/app/src/main/res/drawable/ic_nutrition.xml new file mode 100644 index 0000000..684ee27 --- /dev/null +++ b/app/src/main/res/drawable/ic_nutrition.xml @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/app/src/main/res/drawable/ic_workouts.xml b/app/src/main/res/drawable/ic_workouts.xml new file mode 100644 index 0000000..a2d39de --- /dev/null +++ b/app/src/main/res/drawable/ic_workouts.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/layout/fragment_dashboard.xml b/app/src/main/res/layout/fragment_dashboard.xml deleted file mode 100644 index d60e7ca..0000000 --- a/app/src/main/res/layout/fragment_dashboard.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 9c4b1d7..9c619e9 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -319,8 +319,8 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/menu/bottom_nav_menu.xml b/app/src/main/res/menu/bottom_nav_menu.xml index 149f707..02794f6 100644 --- a/app/src/main/res/menu/bottom_nav_menu.xml +++ b/app/src/main/res/menu/bottom_nav_menu.xml @@ -6,21 +6,36 @@ android:id="@+id/navigation_home" app:showAsAction="ifRoom" android:enabled="true" - android:icon="@drawable/ic_home_black_24dp" + android:icon="@drawable/ic_home" android:title="@string/title_home" /> + android:id="@+id/navigation_my_plan" + android:icon="@drawable/ic_my_plan" + android:title="@string/my_trainer" /> + android:id="@+id/navigation_workouts" + android:icon="@drawable/ic_workouts" + android:title="@string/workouts" /> + + + + + \ No newline at end of file diff --git a/app/src/main/res/navigation/mobile_navigation.xml b/app/src/main/res/navigation/mobile_navigation.xml index d5c4ee1..281b54c 100644 --- a/app/src/main/res/navigation/mobile_navigation.xml +++ b/app/src/main/res/navigation/mobile_navigation.xml @@ -12,15 +12,29 @@ tools:layout="@layout/fragment_home" /> + android:id="@+id/navigation_workouts" + android:name="com.modarb.android.ui.home.ui.plan.fragments.MyPlanFragment" + android:label="@string/workouts" + tools:layout="@layout/fragment_my_plan" /> + + + + + + \ No newline at end of file