From ffb159d91829037f6b69587e00ed400151fa2a10 Mon Sep 17 00:00:00 2001 From: yansans <66671259+yansans@users.noreply.github.com> Date: Tue, 12 Mar 2024 14:54:04 +0700 Subject: [PATCH] feat: navbar init and fragment template --- app/build.gradle.kts | 2 ++ .../java/com/example/bondoyap/MainActivity.kt | 2 +- .../bondoyap/ui/graph/GraphFragment.kt | 31 ++++++++++++++++++ .../bondoyap/ui/graph/GraphViewModel.kt | 7 ++++ .../ScannerFragment.kt} | 16 +++++----- .../ScannerViewModel.kt} | 6 ++-- .../SettingsFragment.kt} | 16 +++++----- .../SettingsViewModel.kt} | 6 ++-- .../TransactionsFragment.kt} | 16 +++++----- .../TransactionsViewModel.kt} | 6 ++-- app/src/main/res/drawable/ic_gear.xml | 14 ++++++++ app/src/main/res/drawable/ic_pie.xml | 14 ++++++++ app/src/main/res/drawable/ic_receipt.xml | 26 +++++++++++++++ app/src/main/res/drawable/ic_scan.xml | 26 +++++++++++++++ app/src/main/res/layout/fragment_graph.xml | 13 ++++++++ ...notifications.xml => fragment_scanner.xml} | 2 +- ...ragment_home.xml => fragment_settings.xml} | 2 +- ...ashboard.xml => fragment_transactions.xml} | 2 +- app/src/main/res/menu/bottom_nav_menu.xml | 23 +++++++------ .../main/res/navigation/mobile_navigation.xml | 32 +++++++++++-------- app/src/main/res/values/strings.xml | 7 ++-- 21 files changed, 207 insertions(+), 62 deletions(-) create mode 100644 app/src/main/java/com/example/bondoyap/ui/graph/GraphFragment.kt create mode 100644 app/src/main/java/com/example/bondoyap/ui/graph/GraphViewModel.kt rename app/src/main/java/com/example/bondoyap/ui/{notifications/NotificationsFragment.kt => scanner/ScannerFragment.kt} (61%) rename app/src/main/java/com/example/bondoyap/ui/{home/HomeViewModel.kt => scanner/ScannerViewModel.kt} (64%) rename app/src/main/java/com/example/bondoyap/ui/{home/HomeFragment.kt => settings/SettingsFragment.kt} (63%) rename app/src/main/java/com/example/bondoyap/ui/{dashboard/DashboardViewModel.kt => settings/SettingsViewModel.kt} (63%) rename app/src/main/java/com/example/bondoyap/ui/{dashboard/DashboardFragment.kt => transactions/TransactionsFragment.kt} (61%) rename app/src/main/java/com/example/bondoyap/ui/{notifications/NotificationsViewModel.kt => transactions/TransactionsViewModel.kt} (61%) create mode 100644 app/src/main/res/drawable/ic_gear.xml create mode 100644 app/src/main/res/drawable/ic_pie.xml create mode 100644 app/src/main/res/drawable/ic_receipt.xml create mode 100644 app/src/main/res/drawable/ic_scan.xml create mode 100644 app/src/main/res/layout/fragment_graph.xml rename app/src/main/res/layout/{fragment_notifications.xml => fragment_scanner.xml} (93%) rename app/src/main/res/layout/{fragment_home.xml => fragment_settings.xml} (94%) rename app/src/main/res/layout/{fragment_dashboard.xml => fragment_transactions.xml} (94%) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index fbb759e..2d9392c 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -45,6 +45,8 @@ dependencies { implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1") implementation("androidx.navigation:navigation-fragment-ktx:2.6.0") implementation("androidx.navigation:navigation-ui-ktx:2.6.0") + implementation("androidx.legacy:legacy-support-v4:1.0.0") + implementation("androidx.fragment:fragment-ktx:1.6.2") testImplementation("junit:junit:4.13.2") androidTestImplementation("androidx.test.ext:junit:1.1.5") androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") diff --git a/app/src/main/java/com/example/bondoyap/MainActivity.kt b/app/src/main/java/com/example/bondoyap/MainActivity.kt index 5bab25b..8c2f8aa 100644 --- a/app/src/main/java/com/example/bondoyap/MainActivity.kt +++ b/app/src/main/java/com/example/bondoyap/MainActivity.kt @@ -25,7 +25,7 @@ class MainActivity : AppCompatActivity() { // Passing each menu ID as a set of Ids because each // menu should be considered as top level destinations. val appBarConfiguration = AppBarConfiguration(setOf( - R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_notifications)) + R.id.navigation_settings, R.id.navigation_transactions, R.id.navigation_scanner)) setupActionBarWithNavController(navController, appBarConfiguration) navView.setupWithNavController(navController) } diff --git a/app/src/main/java/com/example/bondoyap/ui/graph/GraphFragment.kt b/app/src/main/java/com/example/bondoyap/ui/graph/GraphFragment.kt new file mode 100644 index 0000000..fbb4a1d --- /dev/null +++ b/app/src/main/java/com/example/bondoyap/ui/graph/GraphFragment.kt @@ -0,0 +1,31 @@ +package com.example.bondoyap.ui.graph + +import androidx.fragment.app.viewModels +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import com.example.bondoyap.R + +class GraphFragment : Fragment() { + + companion object { + fun newInstance() = GraphFragment() + } + + private val viewModel: GraphViewModel by viewModels() + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + // TODO: Use the ViewModel + } + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + return inflater.inflate(R.layout.fragment_graph, container, false) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/bondoyap/ui/graph/GraphViewModel.kt b/app/src/main/java/com/example/bondoyap/ui/graph/GraphViewModel.kt new file mode 100644 index 0000000..100034f --- /dev/null +++ b/app/src/main/java/com/example/bondoyap/ui/graph/GraphViewModel.kt @@ -0,0 +1,7 @@ +package com.example.bondoyap.ui.graph + +import androidx.lifecycle.ViewModel + +class GraphViewModel : ViewModel() { + // TODO: Implement the ViewModel +} \ No newline at end of file diff --git a/app/src/main/java/com/example/bondoyap/ui/notifications/NotificationsFragment.kt b/app/src/main/java/com/example/bondoyap/ui/scanner/ScannerFragment.kt similarity index 61% rename from app/src/main/java/com/example/bondoyap/ui/notifications/NotificationsFragment.kt rename to app/src/main/java/com/example/bondoyap/ui/scanner/ScannerFragment.kt index adb6240..20427ed 100644 --- a/app/src/main/java/com/example/bondoyap/ui/notifications/NotificationsFragment.kt +++ b/app/src/main/java/com/example/bondoyap/ui/scanner/ScannerFragment.kt @@ -1,4 +1,4 @@ -package com.example.bondoyap.ui.notifications +package com.example.bondoyap.ui.scanner import android.os.Bundle import android.view.LayoutInflater @@ -7,11 +7,11 @@ import android.view.ViewGroup import android.widget.TextView import androidx.fragment.app.Fragment import androidx.lifecycle.ViewModelProvider -import com.example.bondoyap.databinding.FragmentNotificationsBinding +import com.example.bondoyap.databinding.FragmentScannerBinding -class NotificationsFragment : Fragment() { +class ScannerFragment : Fragment() { - private var _binding: FragmentNotificationsBinding? = null + private var _binding: FragmentScannerBinding? = null // This property is only valid between onCreateView and // onDestroyView. @@ -22,14 +22,14 @@ class NotificationsFragment : Fragment() { container: ViewGroup?, savedInstanceState: Bundle? ): View { - val notificationsViewModel = - ViewModelProvider(this).get(NotificationsViewModel::class.java) + val scannerViewModel = + ViewModelProvider(this).get(ScannerViewModel::class.java) - _binding = FragmentNotificationsBinding.inflate(inflater, container, false) + _binding = FragmentScannerBinding.inflate(inflater, container, false) val root: View = binding.root val textView: TextView = binding.textNotifications - notificationsViewModel.text.observe(viewLifecycleOwner) { + scannerViewModel.text.observe(viewLifecycleOwner) { textView.text = it } return root diff --git a/app/src/main/java/com/example/bondoyap/ui/home/HomeViewModel.kt b/app/src/main/java/com/example/bondoyap/ui/scanner/ScannerViewModel.kt similarity index 64% rename from app/src/main/java/com/example/bondoyap/ui/home/HomeViewModel.kt rename to app/src/main/java/com/example/bondoyap/ui/scanner/ScannerViewModel.kt index b26b13b..ba02a0b 100644 --- a/app/src/main/java/com/example/bondoyap/ui/home/HomeViewModel.kt +++ b/app/src/main/java/com/example/bondoyap/ui/scanner/ScannerViewModel.kt @@ -1,13 +1,13 @@ -package com.example.bondoyap.ui.home +package com.example.bondoyap.ui.scanner import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel -class HomeViewModel : ViewModel() { +class ScannerViewModel : ViewModel() { private val _text = MutableLiveData<String>().apply { - value = "This is home Fragment" + value = "This is Scanner Fragment" } val text: LiveData<String> = _text } \ No newline at end of file diff --git a/app/src/main/java/com/example/bondoyap/ui/home/HomeFragment.kt b/app/src/main/java/com/example/bondoyap/ui/settings/SettingsFragment.kt similarity index 63% rename from app/src/main/java/com/example/bondoyap/ui/home/HomeFragment.kt rename to app/src/main/java/com/example/bondoyap/ui/settings/SettingsFragment.kt index 986fc6f..17805dc 100644 --- a/app/src/main/java/com/example/bondoyap/ui/home/HomeFragment.kt +++ b/app/src/main/java/com/example/bondoyap/ui/settings/SettingsFragment.kt @@ -1,4 +1,4 @@ -package com.example.bondoyap.ui.home +package com.example.bondoyap.ui.settings import android.os.Bundle import android.view.LayoutInflater @@ -7,11 +7,11 @@ import android.view.ViewGroup import android.widget.TextView import androidx.fragment.app.Fragment import androidx.lifecycle.ViewModelProvider -import com.example.bondoyap.databinding.FragmentHomeBinding +import com.example.bondoyap.databinding.FragmentSettingsBinding -class HomeFragment : Fragment() { +class SettingsFragment : Fragment() { - private var _binding: FragmentHomeBinding? = null + private var _binding: FragmentSettingsBinding? = null // This property is only valid between onCreateView and // onDestroyView. @@ -22,14 +22,14 @@ class HomeFragment : Fragment() { container: ViewGroup?, savedInstanceState: Bundle? ): View { - val homeViewModel = - ViewModelProvider(this).get(HomeViewModel::class.java) + val settingsViewModel = + ViewModelProvider(this).get(SettingsViewModel::class.java) - _binding = FragmentHomeBinding.inflate(inflater, container, false) + _binding = FragmentSettingsBinding.inflate(inflater, container, false) val root: View = binding.root val textView: TextView = binding.textHome - homeViewModel.text.observe(viewLifecycleOwner) { + settingsViewModel.text.observe(viewLifecycleOwner) { textView.text = it } return root diff --git a/app/src/main/java/com/example/bondoyap/ui/dashboard/DashboardViewModel.kt b/app/src/main/java/com/example/bondoyap/ui/settings/SettingsViewModel.kt similarity index 63% rename from app/src/main/java/com/example/bondoyap/ui/dashboard/DashboardViewModel.kt rename to app/src/main/java/com/example/bondoyap/ui/settings/SettingsViewModel.kt index bded14e..02f1e62 100644 --- a/app/src/main/java/com/example/bondoyap/ui/dashboard/DashboardViewModel.kt +++ b/app/src/main/java/com/example/bondoyap/ui/settings/SettingsViewModel.kt @@ -1,13 +1,13 @@ -package com.example.bondoyap.ui.dashboard +package com.example.bondoyap.ui.settings import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel -class DashboardViewModel : ViewModel() { +class SettingsViewModel : ViewModel() { private val _text = MutableLiveData<String>().apply { - value = "This is dashboard Fragment" + value = "This is Settings Fragment" } val text: LiveData<String> = _text } \ No newline at end of file diff --git a/app/src/main/java/com/example/bondoyap/ui/dashboard/DashboardFragment.kt b/app/src/main/java/com/example/bondoyap/ui/transactions/TransactionsFragment.kt similarity index 61% rename from app/src/main/java/com/example/bondoyap/ui/dashboard/DashboardFragment.kt rename to app/src/main/java/com/example/bondoyap/ui/transactions/TransactionsFragment.kt index 9a5de06..a9a7d64 100644 --- a/app/src/main/java/com/example/bondoyap/ui/dashboard/DashboardFragment.kt +++ b/app/src/main/java/com/example/bondoyap/ui/transactions/TransactionsFragment.kt @@ -1,4 +1,4 @@ -package com.example.bondoyap.ui.dashboard +package com.example.bondoyap.ui.transactions import android.os.Bundle import android.view.LayoutInflater @@ -7,11 +7,11 @@ import android.view.ViewGroup import android.widget.TextView import androidx.fragment.app.Fragment import androidx.lifecycle.ViewModelProvider -import com.example.bondoyap.databinding.FragmentDashboardBinding +import com.example.bondoyap.databinding.FragmentTransactionsBinding -class DashboardFragment : Fragment() { +class TransactionsFragment : Fragment() { - private var _binding: FragmentDashboardBinding? = null + private var _binding: FragmentTransactionsBinding? = null // This property is only valid between onCreateView and // onDestroyView. @@ -22,14 +22,14 @@ class DashboardFragment : Fragment() { container: ViewGroup?, savedInstanceState: Bundle? ): View { - val dashboardViewModel = - ViewModelProvider(this).get(DashboardViewModel::class.java) + val transactionsViewModel = + ViewModelProvider(this).get(TransactionsViewModel::class.java) - _binding = FragmentDashboardBinding.inflate(inflater, container, false) + _binding = FragmentTransactionsBinding.inflate(inflater, container, false) val root: View = binding.root val textView: TextView = binding.textDashboard - dashboardViewModel.text.observe(viewLifecycleOwner) { + transactionsViewModel.text.observe(viewLifecycleOwner) { textView.text = it } return root diff --git a/app/src/main/java/com/example/bondoyap/ui/notifications/NotificationsViewModel.kt b/app/src/main/java/com/example/bondoyap/ui/transactions/TransactionsViewModel.kt similarity index 61% rename from app/src/main/java/com/example/bondoyap/ui/notifications/NotificationsViewModel.kt rename to app/src/main/java/com/example/bondoyap/ui/transactions/TransactionsViewModel.kt index df2228f..1a790c6 100644 --- a/app/src/main/java/com/example/bondoyap/ui/notifications/NotificationsViewModel.kt +++ b/app/src/main/java/com/example/bondoyap/ui/transactions/TransactionsViewModel.kt @@ -1,13 +1,13 @@ -package com.example.bondoyap.ui.notifications +package com.example.bondoyap.ui.transactions import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel -class NotificationsViewModel : ViewModel() { +class TransactionsViewModel : ViewModel() { private val _text = MutableLiveData<String>().apply { - value = "This is notifications Fragment" + value = "This is Transactions Fragment" } val text: LiveData<String> = _text } \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_gear.xml b/app/src/main/res/drawable/ic_gear.xml new file mode 100644 index 0000000..2516ac2 --- /dev/null +++ b/app/src/main/res/drawable/ic_gear.xml @@ -0,0 +1,14 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="512dp" + android:height="512dp" + android:viewportWidth="512" + android:viewportHeight="512"> + <path + android:pathData="M204.7,1.1c-12.4,3 -24.1,13.4 -28.2,25 -0.9,2.3 -2.8,11.9 -4.4,21.4 -3.9,23 -7.4,29.6 -18.9,35.2 -4.6,2.2 -6.9,2.7 -12.7,2.7 -6.1,-0.1 -9,-0.9 -23.5,-6.5 -16.4,-6.3 -16.5,-6.3 -27,-6.4 -9.7,-0 -11,0.2 -17,3.1 -3.6,1.7 -8.5,5.1 -11,7.7 -5.3,5.4 -49.3,80.7 -52.3,89.7 -2.6,7.6 -1.9,19.7 1.5,27.2 3.7,7.8 7.3,11.8 21.5,23.4 7,5.8 13.8,11.9 15.1,13.4 8.6,10.9 8.8,26.8 0.3,37.6 -1.1,1.4 -8,7.5 -15.3,13.6 -14.5,11.9 -17.7,15.5 -21.5,23.6 -3.5,7.5 -4.2,19.6 -1.7,27.2 1.1,3 12.2,23.4 24.9,45.3 25,43.4 27.5,46.8 38.5,52.1 6,2.9 7.3,3.1 17,3.1 10.5,-0.1 10.6,-0.1 27,-6.4 14.5,-5.6 17.4,-6.4 23.5,-6.5 11.7,-0.1 21.1,5.8 26.6,16.6 1.3,2.5 3.2,10.8 5,21.3 3.2,19.3 4.5,23.6 8.8,29.9 4.2,6.1 9.5,10.4 17.1,14l6.5,3.1 48.4,0.3c30.6,0.2 50.2,-0.1 53.3,-0.7 12.1,-2.6 21.8,-10.2 27.3,-21.4 2.8,-5.9 4,-10.4 6.4,-24.8 3.2,-19.6 5.4,-25.4 11.7,-30.9 6,-5.2 11.8,-7.4 19.9,-7.3 6.2,-0 9,0.8 23.5,6.4 16.4,6.3 16.5,6.3 27,6.4 9.7,-0 11,-0.2 17,-3.1 10.9,-5.3 13.5,-8.8 38.3,-51.6 12.4,-21.6 23.4,-41.1 24.4,-43.3 1.3,-2.9 1.7,-6.7 1.8,-14 0,-8.7 -0.3,-10.7 -2.6,-15.5 -3.9,-8.1 -7.2,-11.8 -22,-24 -14.3,-11.9 -18,-16.4 -20.4,-24.3 -1.9,-6.3 -1.9,-9.1 0,-15.4 2.4,-8 6.3,-12.7 20.4,-24.3 14.6,-12 18.1,-15.9 22,-24 2.3,-4.8 2.6,-6.8 2.6,-15.5 -0.1,-7.3 -0.5,-11.1 -1.8,-14 -1,-2.2 -12,-21.7 -24.4,-43.3 -24.8,-42.8 -27.4,-46.3 -38.3,-51.6 -6,-2.9 -7.3,-3.1 -17,-3.1 -10.5,0.1 -10.6,0.1 -27,6.4 -14.5,5.6 -17.4,6.4 -23.5,6.5 -11.7,0.1 -21.1,-5.8 -26.6,-16.6 -1.2,-2.4 -3.2,-10.8 -5,-21.1 -1.5,-9.4 -3.6,-19.2 -4.6,-21.9 -3.4,-9.6 -12.9,-19.1 -23,-23.3 -4.5,-1.9 -7.6,-2 -54.3,-2.2 -27.2,-0.1 -51.2,0.3 -53.3,0.8zM298,40.2c0,0.2 1.3,8 3,17.5 4.3,24.8 9.2,35.6 21.9,47.9 14.1,13.8 34.6,21.4 53.1,19.9 9.7,-0.8 12.4,-1.5 30.8,-8.2 8.4,-3.1 15.4,-5.4 15.5,-5.2 0.2,0.2 9.7,16.6 21.1,36.3 16.5,28.7 20.4,36.2 19.4,37.1 -0.7,0.6 -6.4,5.3 -12.5,10.4 -14.4,11.8 -20.2,18.4 -25.2,28.5 -5.6,11.1 -7.4,18.9 -7.4,31.6 0,12.7 1.8,20.5 7.4,31.6 5,10.1 10.8,16.7 25.2,28.5 6.1,5.1 11.8,9.8 12.5,10.4 1,0.9 -3,8.5 -19.4,37.1 -11.4,19.7 -20.9,36.1 -21.1,36.3 -0.1,0.2 -7.1,-2.1 -15.5,-5.2 -18.4,-6.7 -21.1,-7.4 -30.8,-8.2 -18.5,-1.5 -39.1,6.2 -53.2,19.8 -12.5,12.3 -17.6,23.3 -21.8,48 -1.7,9.5 -3,17.3 -3,17.4 0,0.2 -18.9,0.3 -42,0.3 -23.1,-0 -42,-0.1 -42,-0.3 0,-0.1 -1.3,-7.9 -3,-17.4 -4.2,-24.7 -9.1,-35.3 -21.7,-47.8 -14,-13.8 -34.7,-21.5 -53.3,-20 -9.7,0.8 -12.4,1.5 -30.8,8.2 -8.4,3.1 -15.4,5.4 -15.5,5.2 -3.1,-3.9 -41.5,-72.4 -41,-72.9 0.4,-0.4 6.2,-5.2 12.8,-10.7 14,-11.6 19.3,-17.3 24.3,-26.3 6,-10.7 8.4,-20.6 8.4,-34 0,-13.4 -2.4,-23.3 -8.4,-34 -5,-9 -10.3,-14.7 -24.3,-26.3 -6.6,-5.5 -12.4,-10.3 -12.8,-10.7 -0.5,-0.5 37.9,-69 41,-72.9 0.1,-0.2 7.1,2.1 15.5,5.2 20.7,7.6 22.7,8 34.8,8.1 12.5,-0 20.2,-1.8 31.5,-7.4 9.1,-4.5 16,-9.8 22.7,-17.7 9.1,-10.8 13.4,-21.6 16.8,-42.3 1.1,-6.9 2.3,-13.7 2.6,-15.3l0.6,-2.7 41.9,-0c23,-0 41.9,0.1 41.9,0.2z" + android:fillColor="#000000" + android:strokeColor="#00000000"/> + <path + android:pathData="M243.5,158.1c-14,1.8 -30.4,8.1 -43.4,16.7 -7.3,4.8 -20.6,18.2 -25.6,25.7 -22.8,34.6 -22.8,76.4 0,111 5,7.5 18.3,20.9 25.6,25.7 38.1,25.1 84.8,22.9 119.1,-5.6 30.1,-24.9 42.7,-67.1 31.1,-104.1 -11.1,-35.6 -40.3,-61.8 -76.1,-68.5 -8.2,-1.5 -23,-2 -30.7,-0.9zM273.5,200.1c17.5,5.4 32.9,20.9 38.7,38.9 2.9,9.1 2.9,24.9 0,34 -5.9,18.2 -21,33.3 -39.2,39.1 -9.2,3 -24,3 -33.5,0.1 -18.5,-5.7 -33.8,-20.8 -39.7,-39.2 -2.9,-9.1 -2.9,-24.9 0.1,-34 6.9,-21.7 26.9,-38.5 49.1,-41.3 5.9,-0.8 18.2,0.4 24.5,2.4z" + android:fillColor="#000000" + android:strokeColor="#00000000"/> +</vector> diff --git a/app/src/main/res/drawable/ic_pie.xml b/app/src/main/res/drawable/ic_pie.xml new file mode 100644 index 0000000..b876ce7 --- /dev/null +++ b/app/src/main/res/drawable/ic_pie.xml @@ -0,0 +1,14 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="512dp" + android:height="512dp" + android:viewportWidth="512" + android:viewportHeight="512"> + <path + android:pathData="M271,120.5l0,120.5 120.5,-0 120.5,-0 0,-12.3c0,-62.1 -23.4,-119.2 -66.5,-162.2 -43.1,-43.2 -99.9,-66.5 -162.2,-66.5l-12.3,-0 0,120.5zM325.5,34.1c58.8,11.9 110.8,52.6 137,107.1 9.3,19.5 16.4,43.7 18.1,62.6l0.7,7.2 -90.2,-0 -90.1,-0 0,-90.1 0,-90.2 7.2,0.7c4,0.4 11.8,1.6 17.3,2.7z" + android:fillColor="#000000" + android:strokeColor="#00000000"/> + <path + android:pathData="M203.5,62.1c-40.9,3.9 -85,21.8 -118,47.9 -37.5,29.7 -66.3,73.4 -78,118.6 -5.4,20.7 -6.9,33.1 -6.9,57.4 0,24.3 1.5,36.7 6.9,57.4 9.7,37.3 31.1,74.4 59,102.1 34.9,34.7 76.3,55.7 127,64.2 14.4,2.4 50.1,2.4 65,-0 33.7,-5.5 62.8,-16.6 90,-34.5 64.6,-42.3 102.5,-113.3 102.5,-192l0,-12.2 -105,-0 -105,-0 0,-105 0,-105 -14.2,0.1c-7.9,0.1 -18.3,0.6 -23.3,1zM211,170.7l0,78.8 -56,-56c-42.4,-42.4 -55.7,-56.2 -54.7,-57 0.7,-0.6 4.1,-3.1 7.4,-5.8 18.3,-14.1 44.8,-27 68.6,-33.3 8.7,-2.3 25.4,-5.2 30.5,-5.3l4.2,-0.1 0,78.7zM141,349.5c-34.9,34.9 -63.7,63.5 -64,63.5 -0.7,-0.1 -12.1,-15.5 -17,-23 -6.6,-10.3 -15.6,-29.4 -19.9,-42.5 -20.8,-62.8 -8.8,-130.3 32.2,-182.3l5,-6.4 63.6,63.6 63.6,63.6 -63.5,63.5zM419.6,308.2c-4.3,46.3 -30.1,95 -67.1,126.6 -72.4,61.9 -176.1,62.9 -251,2.4l-2.9,-2.3 66.9,-66.9 67,-67 93.9,-0 93.9,-0 -0.7,7.2z" + android:fillColor="#000000" + android:strokeColor="#00000000"/> +</vector> diff --git a/app/src/main/res/drawable/ic_receipt.xml b/app/src/main/res/drawable/ic_receipt.xml new file mode 100644 index 0000000..351fe03 --- /dev/null +++ b/app/src/main/res/drawable/ic_receipt.xml @@ -0,0 +1,26 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="512dp" + android:height="512dp" + android:viewportWidth="512" + android:viewportHeight="512"> + <path + android:pathData="M115.5,44.8c-7.6,2.6 -13.5,6.5 -18.9,12.1 -5.7,6.2 -9.1,13.3 -10.6,22.1 -0.7,4.6 -1,61 -0.8,191l0.3,184.5 2.3,4.2c4.2,8 14.3,12.1 22.8,9.3 2.1,-0.7 6.7,-4.1 10.5,-7.6 11,-10.3 17.6,-10.8 28.1,-1.8 2.9,2.4 7.8,5.7 10.8,7.2 4.9,2.4 6.6,2.7 16,2.7 9.4,-0 11.1,-0.3 16,-2.7 3,-1.5 7.9,-4.8 10.8,-7.2 9.8,-8.4 16.6,-8.4 26.4,-0 8,6.8 14.8,9.7 24.4,10.2 12.3,0.7 19.8,-2.2 30.7,-11.6 8.5,-7.4 15.1,-6.7 26.8,2.7 15.6,12.6 35,12.1 51.5,-1.3 10.7,-8.8 17.3,-8.3 28.5,1.9 7.7,7.1 12.6,9.1 19.3,8.1 5.8,-1 10.2,-4.1 13.4,-9.4l2.7,-4.7 0.3,-184.5c0.2,-127.4 -0.1,-186.5 -0.8,-191 -2.3,-14.2 -13,-28.1 -25.7,-33.2l-5.8,-2.3 -137,-0.2c-128,-0.2 -137.3,-0.1 -142,1.5zM390.3,65.1c4.9,1.3 10.5,6.3 12.8,11.4 1.8,3.8 1.9,12.1 1.9,185.8l0,181.9 -4.6,-4.1c-6.7,-5.9 -14,-8.4 -24.4,-8.4 -10.5,-0 -17.2,2.4 -25,8.9 -11.8,9.9 -19.1,10 -29.8,0.2 -12.7,-11.6 -33.7,-12.8 -46.9,-2.7 -2.3,1.7 -6,4.5 -8.2,6.1 -2.8,2.2 -5.5,3.2 -8.9,3.6 -5.6,0.5 -9.1,-1 -14.9,-6.3 -13.3,-12.3 -35.2,-13.7 -48.5,-3 -8.9,7.2 -11.8,8.8 -16.7,9.3 -5.6,0.5 -9.1,-1 -14.8,-6.4 -2.1,-2 -6.7,-5 -10.3,-6.7 -5.8,-2.9 -7.4,-3.2 -15.5,-3.2 -10.9,0.1 -18,2.5 -24.9,8.6l-4.6,4.1 0,-181.6c0,-162 0.2,-182.1 1.6,-185.4 2,-4.9 6,-9 10.9,-11.3 3.8,-1.8 9.6,-1.9 135.5,-1.9 88.7,-0 132.7,0.4 135.3,1.1z" + android:fillColor="#000000" + android:strokeColor="#00000000"/> + <path + android:pathData="M154.4,129.9c-4.4,2.7 -6,7.7 -4.1,12.4 3.1,7.2 -5,6.7 105.8,6.7 98.4,-0 99.7,-0 102.2,-2 3.8,-3 5.2,-8 3.3,-12.3 -2.9,-7.1 3.4,-6.7 -105.8,-6.7 -95.2,-0 -98.4,0.1 -101.4,1.9z" + android:fillColor="#000000" + android:strokeColor="#00000000"/> + <path + android:pathData="M154.4,193.9c-4.4,2.7 -6,7.7 -4.1,12.4 3.1,7.2 -5,6.7 105.8,6.7 98.4,-0 99.7,-0 102.2,-2 3.8,-3 5.2,-8 3.3,-12.3 -2.9,-7.1 3.4,-6.7 -105.8,-6.7 -95.2,-0 -98.4,0.1 -101.4,1.9z" + android:fillColor="#000000" + android:strokeColor="#00000000"/> + <path + android:pathData="M154.4,257.9c-4.4,2.7 -6,7.7 -4.1,12.4 3.1,7.2 -5,6.7 105.8,6.7 98.4,-0 99.7,-0 102.2,-2 3.8,-3 5.2,-8 3.3,-12.3 -2.9,-7.1 3.4,-6.7 -105.8,-6.7 -95.2,-0 -98.4,0.1 -101.4,1.9z" + android:fillColor="#000000" + android:strokeColor="#00000000"/> + <path + android:pathData="M154.4,321.9c-4.4,2.7 -6,7.7 -4.1,12.4 3.1,7.2 -5,6.7 105.8,6.7 98.4,-0 99.7,-0 102.2,-2 3.8,-3 5.2,-8 3.3,-12.3 -2.9,-7.1 3.4,-6.7 -105.8,-6.7 -95.2,-0 -98.4,0.1 -101.4,1.9z" + android:fillColor="#000000" + android:strokeColor="#00000000"/> +</vector> diff --git a/app/src/main/res/drawable/ic_scan.xml b/app/src/main/res/drawable/ic_scan.xml new file mode 100644 index 0000000..3e776a9 --- /dev/null +++ b/app/src/main/res/drawable/ic_scan.xml @@ -0,0 +1,26 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="512dp" + android:height="512dp" + android:viewportWidth="512" + android:viewportHeight="512"> + <path + android:pathData="M68.3,33.5c-17.5,4.8 -31.7,19.5 -35.3,36.8 -0.7,3.5 -1,20.3 -0.8,50.4 0.3,43.8 0.4,45.2 2.4,47.9 3.9,5.3 7.1,6.9 13.4,6.9 6.3,-0 9.5,-1.6 13.4,-6.9 2,-2.7 2.1,-4.3 2.6,-48.6 0.5,-44.3 0.6,-45.9 2.6,-48.6 1.1,-1.5 3.3,-3.7 4.8,-4.8 2.7,-2 4.2,-2.1 52.6,-2.6 48.4,-0.5 49.9,-0.6 52.6,-2.6 5.3,-3.9 6.9,-7.1 6.9,-13.4 0,-6.3 -1.6,-9.5 -6.9,-13.4 -2.7,-2.1 -4,-2.1 -52.9,-2.3 -40.8,-0.2 -51.2,0.1 -55.4,1.2z" + android:fillColor="#000000" + android:strokeColor="#00000000"/> + <path + android:pathData="M337.5,33.4c-11.8,5.1 -12.4,22.4 -1.1,28.9 1.5,0.9 15.1,1.3 51.8,1.7 48.2,0.5 49.7,0.6 52.4,2.6 1.5,1.1 3.7,3.3 4.8,4.8 2,2.7 2.1,4.3 2.6,48.6 0.5,44.3 0.6,45.9 2.6,48.6 3.9,5.3 7.1,6.9 13.4,6.9 6.3,-0 9.5,-1.6 13.4,-6.9 2,-2.7 2.1,-4.1 2.4,-47.9 0.2,-30.1 -0.1,-46.9 -0.8,-50.4 -3.7,-17.5 -17.9,-32.2 -35.7,-36.8 -8,-2.1 -101.1,-2.2 -105.8,-0.1z" + android:fillColor="#000000" + android:strokeColor="#00000000"/> + <path + android:pathData="M41.5,241.4c-6.7,2.9 -10.5,10.6 -9.1,18.1 0.9,4.7 5.9,10.2 10.4,11.5 2.6,0.8 68.9,1 215.4,0.8l211.7,-0.3 2.7,-2.1c5.3,-3.9 6.9,-7.1 6.9,-13.4 0,-6.3 -1.6,-9.5 -6.9,-13.4l-2.7,-2.1 -212.7,-0.2c-175.3,-0.2 -213.2,-0 -215.7,1.1z" + android:fillColor="#000000" + android:strokeColor="#00000000"/> + <path + android:pathData="M41.5,337.4c-3.7,1.7 -7,5.2 -8.4,8.9 -0.7,1.9 -1.1,18.2 -1.1,47.1 0,47.9 0.2,50.2 5.6,60.8 5.9,11.6 19.6,22 32.7,24.8 3.5,0.7 21.5,1 54.4,0.8 47.9,-0.3 49.2,-0.4 51.9,-2.4 5.3,-3.9 6.9,-7.1 6.9,-13.4 0,-6.3 -1.6,-9.5 -6.9,-13.4 -2.7,-2 -4.2,-2.1 -52.6,-2.6 -48.4,-0.5 -49.9,-0.6 -52.6,-2.6 -1.5,-1.1 -3.7,-3.3 -4.8,-4.8 -2,-2.7 -2.1,-4.3 -2.6,-48.6 -0.5,-44.3 -0.6,-45.9 -2.6,-48.6 -1.1,-1.5 -3.2,-3.7 -4.6,-4.7 -3.4,-2.5 -11.3,-3.2 -15.3,-1.3z" + android:fillColor="#000000" + android:strokeColor="#00000000"/> + <path + android:pathData="M458,337.1c-2.9,1.2 -6.7,4.6 -8.3,7.4 -0.9,1.4 -1.4,15.7 -1.7,47.7 -0.5,44.1 -0.6,45.7 -2.6,48.4 -1.1,1.5 -3.3,3.7 -4.8,4.8 -2.7,2 -4.2,2.1 -52.6,2.6 -48.4,0.5 -49.9,0.6 -52.6,2.6 -5.3,3.9 -6.9,7.1 -6.9,13.4 0,6.3 1.6,9.5 6.9,13.4 2.7,2 4,2.1 51.9,2.4 32.9,0.2 50.9,-0.1 54.4,-0.8 17.9,-3.8 33.6,-19.4 37.3,-37.5 0.7,-3.3 1,-21.2 0.8,-50.2 -0.3,-43.8 -0.4,-45.2 -2.4,-47.9 -1.1,-1.5 -3.2,-3.7 -4.6,-4.7 -3.1,-2.3 -11.1,-3.2 -14.8,-1.6z" + android:fillColor="#000000" + android:strokeColor="#00000000"/> +</vector> diff --git a/app/src/main/res/layout/fragment_graph.xml b/app/src/main/res/layout/fragment_graph.xml new file mode 100644 index 0000000..e325d1c --- /dev/null +++ b/app/src/main/res/layout/fragment_graph.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<FrameLayout 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" + tools:context=".ui.graph.GraphFragment"> + + <TextView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:text="Graph Fragment" /> + +</FrameLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_notifications.xml b/app/src/main/res/layout/fragment_scanner.xml similarity index 93% rename from app/src/main/res/layout/fragment_notifications.xml rename to app/src/main/res/layout/fragment_scanner.xml index d417935..0c94f94 100644 --- a/app/src/main/res/layout/fragment_notifications.xml +++ b/app/src/main/res/layout/fragment_scanner.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".ui.notifications.NotificationsFragment"> + tools:context=".ui.scanner.ScannerFragment"> <TextView android:id="@+id/text_notifications" diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_settings.xml similarity index 94% rename from app/src/main/res/layout/fragment_home.xml rename to app/src/main/res/layout/fragment_settings.xml index f3d9b08..b2193eb 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_settings.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".ui.home.HomeFragment"> + tools:context=".ui.settings.SettingsFragment"> <TextView android:id="@+id/text_home" diff --git a/app/src/main/res/layout/fragment_dashboard.xml b/app/src/main/res/layout/fragment_transactions.xml similarity index 94% rename from app/src/main/res/layout/fragment_dashboard.xml rename to app/src/main/res/layout/fragment_transactions.xml index 166ab0e..25c7c26 100644 --- a/app/src/main/res/layout/fragment_dashboard.xml +++ b/app/src/main/res/layout/fragment_transactions.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".ui.dashboard.DashboardFragment"> + tools:context=".ui.transactions.TransactionsFragment"> <TextView android:id="@+id/text_dashboard" diff --git a/app/src/main/res/menu/bottom_nav_menu.xml b/app/src/main/res/menu/bottom_nav_menu.xml index fb6d040..a0f1d4f 100644 --- a/app/src/main/res/menu/bottom_nav_menu.xml +++ b/app/src/main/res/menu/bottom_nav_menu.xml @@ -2,18 +2,23 @@ <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item - android:id="@+id/navigation_home" - android:icon="@drawable/ic_home_black_24dp" - android:title="@string/title_home" /> + android:id="@+id/navigation_transactions" + android:icon="@drawable/ic_receipt" + android:title="@string/title_transactions" /> <item - android:id="@+id/navigation_dashboard" - android:icon="@drawable/ic_dashboard_black_24dp" - android:title="@string/title_dashboard" /> + android:id="@+id/navigation_scanner" + android:icon="@drawable/ic_scan" + android:title="@string/title_scanner" /> <item - android:id="@+id/navigation_notifications" - android:icon="@drawable/ic_notifications_black_24dp" - android:title="@string/title_notifications" /> + android:id="@+id/navigation_graph" + android:icon="@drawable/ic_pie" + android:title="@string/title_graph" /> + + <item + android:id="@+id/navigation_settings" + android:icon="@drawable/ic_gear" + android:title="@string/title_settings" /> </menu> \ 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 eae370f..982e225 100644 --- a/app/src/main/res/navigation/mobile_navigation.xml +++ b/app/src/main/res/navigation/mobile_navigation.xml @@ -3,23 +3,29 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/mobile_navigation" - app:startDestination="@+id/navigation_home"> + app:startDestination="@+id/navigation_transactions"> <fragment - android:id="@+id/navigation_home" - android:name="com.example.bondoyap.ui.home.HomeFragment" - android:label="@string/title_home" - tools:layout="@layout/fragment_home" /> + android:id="@+id/navigation_transactions" + android:name="com.example.bondoyap.ui.transactions.TransactionsFragment" + android:label="@string/title_transactions" + tools:layout="@layout/fragment_transactions" /> <fragment - android:id="@+id/navigation_dashboard" - android:name="com.example.bondoyap.ui.dashboard.DashboardFragment" - android:label="@string/title_dashboard" - tools:layout="@layout/fragment_dashboard" /> + android:id="@+id/navigation_scanner" + android:name="com.example.bondoyap.ui.scanner.ScannerFragment" + android:label="@string/title_scanner" + tools:layout="@layout/fragment_scanner" /> <fragment - android:id="@+id/navigation_notifications" - android:name="com.example.bondoyap.ui.notifications.NotificationsFragment" - android:label="@string/title_notifications" - tools:layout="@layout/fragment_notifications" /> + android:id="@+id/navigation_graph" + android:name="com.example.bondoyap.ui.graph.GraphFragment" + android:label="@string/title_graph" + tools:layout="@layout/fragment_graph" /> + + <fragment + android:id="@+id/navigation_settings" + android:name="com.example.bondoyap.ui.settings.SettingsFragment" + android:label="@string/title_settings" + tools:layout="@layout/fragment_settings" /> </navigation> \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index aa3cab5..9617dd0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,6 +1,7 @@ <resources> <string name="app_name">BondoYap</string> - <string name="title_home">Home</string> - <string name="title_dashboard">Dashboard</string> - <string name="title_notifications">Notifications</string> + <string name="title_transactions">Transaksi</string> + <string name="title_scanner">Scanner</string> + <string name="title_graph">Graph</string> + <string name="title_settings">Pengaturan</string> </resources> \ No newline at end of file -- GitLab