diff --git a/app/build.gradle.kts b/app/build.gradle.kts index c6addfc1fc9d27b739545197e3f87b87096c938d..ecdc429f4a852e3be899ab452445a46e42338281 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -65,6 +65,7 @@ dependencies { implementation ("org.apache.poi:poi:5.2.4") implementation ("org.apache.poi:poi-ooxml:5.2.4") implementation("com.github.PhilJay:MPAndroidChart:v3.1.0") + implementation ("com.squareup.okhttp3:okhttp:4.9.1") implementation ("androidx.camera:camera-core:1.2.2") implementation ("androidx.camera:camera-camera2:1.2.2") diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d4c1f17d645f6a4c737b8b4c120800201ecccbc0..e9c84d7765dd6ba21990362be955cabb8dcc23b2 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -17,7 +17,6 @@ - <uses-permission android:name="android.permission.INTERNET"/> <application android:allowBackup="true" android:dataExtractionRules="@xml/data_extraction_rules" @@ -37,6 +36,7 @@ <activity android:name=".MainActivity" android:exported="false" /> + <activity android:name=".BondoManSplashScreen" android:exported="true" @@ -60,4 +60,5 @@ </application> + </manifest> \ No newline at end of file diff --git a/app/src/main/java/com/example/android_hit/MainActivity.kt b/app/src/main/java/com/example/android_hit/MainActivity.kt index f19ce2e6028e4f4b84ae3149267548a9b43afebf..73f3e81d64785e5ab39855308246917dd93efeda 100644 --- a/app/src/main/java/com/example/android_hit/MainActivity.kt +++ b/app/src/main/java/com/example/android_hit/MainActivity.kt @@ -1,10 +1,12 @@ package com.example.android_hit -//import androidx.appcompat.app.AlertDialog import android.app.AlertDialog import android.content.Intent +import android.content.res.Configuration +import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.util.Log +import android.view.View import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment @@ -49,30 +51,43 @@ class MainActivity : AppCompatActivity() { setContentView(binding.root) setCurrentFragment(Transaction(), HeaderTransaction()) - binding.bottomNavigation.setOnItemSelectedListener { - when (it.itemId) { - R.id.nav_transaction -> { -// if(!networkManager.value!!){ -// setCurrentFragment(NetworkError(), HeaderNetwork()) -// }else{ -// setCurrentFragment(Transaction(), HeaderTransaction()) -// } - setCurrentFragment(Transaction(), HeaderTransaction()) - } - R.id.nav_scan -> { - setCurrentFragment(Scan(), HeaderScan()) - } - R.id.nav_graphs -> { - setCurrentFragment(Graphs(), HeaderGraphs()) - } - R.id.nav_settings -> { - setCurrentFragment(Settings(), HeaderSettings()) + val orientation = resources.configuration.orientation + if (orientation == Configuration.ORIENTATION_PORTRAIT) { + binding.bottomNavigation?.setOnItemSelectedListener { + when (it.itemId) { + R.id.nav_transaction -> { + // if(!networkManager.value!!){ + // setCurrentFragment(NetworkError(), HeaderNetwork()) + // }else{ + // setCurrentFragment(Transaction(), HeaderTransaction()) + // } + setCurrentFragment(Transaction(), HeaderTransaction()) + } + + R.id.nav_scan -> { + setCurrentFragment(Scan(), HeaderScan()) + } + + R.id.nav_graphs -> { + setCurrentFragment(Graphs(), HeaderGraphs()) + } + + R.id.nav_settings -> { + setCurrentFragment(Settings(), HeaderSettings()) + } } - R.id.nav_twibbon ->{ - setCurrentFragment(FragmentTwibbon(),HeaderTwibbon()) + true + } + } else { + binding.navigationView?.setOnItemSelectedListener { item -> + when (item.itemId) { + R.id.nav_transaction -> setCurrentFragment(Transaction(), HeaderTransaction()) + R.id.nav_scan -> setCurrentFragment(Scan(), HeaderScan()) + R.id.nav_graphs -> setCurrentFragment(Graphs(), HeaderGraphs()) + R.id.nav_settings -> setCurrentFragment(Settings(), HeaderSettings()) } + true } - true } //Keluarin pop up kalo token dah abis, sama matiin background service diff --git a/app/src/main/java/com/example/android_hit/Scan.kt b/app/src/main/java/com/example/android_hit/Scan.kt index faa0d42b9d84f915ce8f866c5d6005eabfd7977f..addd17e967a5fadd8743102c2312c5ab64aa5356 100644 --- a/app/src/main/java/com/example/android_hit/Scan.kt +++ b/app/src/main/java/com/example/android_hit/Scan.kt @@ -2,6 +2,8 @@ package com.example.android_hit import android.Manifest import android.app.Activity +import android.app.AlertDialog +import android.content.DialogInterface import android.content.Intent import android.content.pm.PackageManager import android.graphics.Bitmap @@ -9,34 +11,43 @@ import android.graphics.ImageDecoder import android.net.Uri import android.os.Build import android.os.Bundle +import android.os.Handler +import android.os.Looper import android.provider.MediaStore +import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.Button import android.widget.ImageView +import android.widget.Toast import androidx.core.app.ActivityCompat import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment +import com.example.android_hit.api.RetrofitClient +import com.example.android_hit.data.ScanResponse +import com.example.android_hit.room.TransactionDB +import com.example.android_hit.room.TransactionEntity +import com.example.android_hit.utils.TokenManager +import okhttp3.MediaType.Companion.toMediaTypeOrNull +import okhttp3.MultipartBody +import okhttp3.RequestBody.Companion.toRequestBody +import retrofit2.Call +import retrofit2.Callback +import retrofit2.Response +import java.io.ByteArrayOutputStream +import java.io.File +import java.io.FileOutputStream -// TODO: Rename parameter arguments, choose names that match -// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER -private const val ARG_PARAM1 = "param1" -private const val ARG_PARAM2 = "param2" - -/** - * A simple [Fragment] subclass. - * Use the [Scan.newInstance] factory method to - * create an instance of this fragment. - */ class Scan : Fragment() { - // TODO: Rename and change types of parameters var pickedPhoto : Uri? = null var pickedBitMap : Bitmap? = null private val CAMERA_REQUEST_CODE = 1 private lateinit var btnCapture : Button private lateinit var btnPick : Button private lateinit var ivPicture : ImageView + private lateinit var sharedPref : TokenManager + @@ -52,8 +63,6 @@ class Scan : Fragment() { inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View? { - // Inflate the layout for this fragment - return inflater.inflate(R.layout.fragment_scan, container, false) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { @@ -62,7 +71,7 @@ class Scan : Fragment() { ivPicture = view.findViewById(R.id.captureImageView) btnPick = view.findViewById(R.id.pickImgBtn) btnCapture.isEnabled = true - + sharedPref = TokenManager(requireContext()) if(ActivityCompat.checkSelfPermission(requireContext(), android.Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED){ ActivityCompat.requestPermissions(requireActivity(), arrayOf(Manifest.permission.CAMERA), @@ -86,6 +95,13 @@ class Scan : Fragment() { if(requestCode == 101){ var pic : Bitmap? = data?.getParcelableExtra<Bitmap>("data") ivPicture.setImageBitmap(pic) + pickedBitMap = pic + val savedImageUri = saveImageToInternalStorage(pickedBitMap!!) + pickedPhoto = savedImageUri + Handler(Looper.getMainLooper()).postDelayed({ + showConfirmationDialog() + }, 700) + } if(requestCode == 2 && resultCode == Activity.RESULT_OK && data != null){ pickedPhoto = data.data @@ -93,14 +109,39 @@ class Scan : Fragment() { val source = ImageDecoder.createSource(requireContext().contentResolver, pickedPhoto!!) pickedBitMap = ImageDecoder.decodeBitmap(source) ivPicture.setImageBitmap(pickedBitMap) + Handler(Looper.getMainLooper()).postDelayed({ + showConfirmationDialog() + }, 700) }else{ pickedBitMap = MediaStore.Images.Media.getBitmap(requireContext().contentResolver, pickedPhoto) ivPicture.setImageBitmap(pickedBitMap) + Handler(Looper.getMainLooper()).postDelayed({ + showConfirmationDialog() + }, 700) + } } } + + private fun saveImageToInternalStorage(bitmap: Bitmap?): Uri? { + // Check for null + if (bitmap == null) { + return null + } + + // Save the bitmap to a file + val filename = "${System.currentTimeMillis()}.jpg" + val file = File(requireContext().externalCacheDir, filename) + val fileOutputStream = FileOutputStream(file) + bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fileOutputStream) + fileOutputStream.close() + + // Get the Uri of the file + return Uri.fromFile(file) + } + override fun onRequestPermissionsResult( requestCode: Int, permissions: Array<out String>, @@ -127,24 +168,79 @@ class Scan : Fragment() { startActivityForResult(galleryIntext, 2) } } - companion object { - /** - * 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 Scan. - */ - - // TODO: Rename and change types and number of parameters - @JvmStatic - fun newInstance(param1: String, param2: String) = - Scan().apply { - arguments = Bundle().apply { - putString(ARG_PARAM1, param1) - putString(ARG_PARAM2, param2) - } + private fun showConfirmationDialog() { + val alertDialogBuilder = AlertDialog.Builder(this.context) + alertDialogBuilder.apply { + setTitle("Confirmation") + setMessage("Are you sure to use this image?") + setPositiveButton("Yes") { dialogInterface: DialogInterface, _: Int -> + + + dialogInterface.dismiss() + + + // Ubah Bitmap menjadi ByteArrayOutputStream + val byteArrayOutputStream = ByteArrayOutputStream() + pickedBitMap?.compress(Bitmap.CompressFormat.JPEG, 100, byteArrayOutputStream) + // Ubah ByteArrayOutputStream menjadi byte array + val byteArray = byteArrayOutputStream.toByteArray() + + // Ubah byte array menjadi RequestBody + val requestBody = byteArray.toRequestBody("image/jpg".toMediaTypeOrNull()) + + // Gunakan requestBody ini untuk mengirim gambar melalui Retrofit + val token = sharedPref.getToken() + val file = File(pickedPhoto?.path) + val filePart = MultipartBody.Part.createFormData("file", file.name, requestBody) + val call = RetrofitClient.apiService.uploadNota("Bearer $token", filePart) + call.enqueue(object : Callback<ScanResponse> { + override fun onResponse(call: Call<ScanResponse>, response: Response<ScanResponse>) { + if (response.isSuccessful) { + val responseBody = response.body() + Log.e("POST Success", "Response: ${responseBody.toString()}") + Toast.makeText(requireContext(), "Upload Success", Toast.LENGTH_SHORT).show() + + // Get the items from the response + val items = responseBody?.items?.items + + // Get a reference to the database + val db = TransactionDB.getInstance(requireContext()) + val transactionDao = db.transactionDao + + // Loop through the items and convert them to transactions + items?.forEach { item -> + val amount = item.qty * item.price + val transaction = TransactionEntity( + title = item.name, + amount = amount.toInt(), + category = "Expense", + location = "Location", // Replace with actual location + timestamp = System.currentTimeMillis().toString() // Replace with actual timestamp + ) + + // Insert the transaction into the database + transactionDao.addTransaction(transaction) + } + + } else { + Log.e("POST Error", "Failed to make POST request: ${response.message()}") + Toast.makeText(requireContext(), "Upload Failed: ${response.message()}", Toast.LENGTH_SHORT).show() + } + } + override fun onFailure(call: Call<ScanResponse>, t: Throwable) { + Log.e("POST Error", "Failed to make POST request: ${t.message}") + } + }) } + setNegativeButton("No") { dialogInterface: DialogInterface, _: Int -> + dialogInterface.dismiss() + ivPicture.setImageBitmap(null) + } + setCancelable(false) + } + + val alertDialog = alertDialogBuilder.create() + alertDialog.show() } + } \ No newline at end of file diff --git a/app/src/main/java/com/example/android_hit/Settings.kt b/app/src/main/java/com/example/android_hit/Settings.kt index a770aae7f9b62756af0aee91b8a874a4acc1c176..cd1fb776c1030aef912f2ee20f5e5b43431e081c 100644 --- a/app/src/main/java/com/example/android_hit/Settings.kt +++ b/app/src/main/java/com/example/android_hit/Settings.kt @@ -217,9 +217,4 @@ class Settings : Fragment() { } - - - - - } \ No newline at end of file diff --git a/app/src/main/java/com/example/android_hit/Transaction.kt b/app/src/main/java/com/example/android_hit/Transaction.kt index c93df56bdb8e86df80b658921acd798af28aa84f..ee32b6d9397ed1c1096cd8a2c9997f2fd7fca007 100644 --- a/app/src/main/java/com/example/android_hit/Transaction.kt +++ b/app/src/main/java/com/example/android_hit/Transaction.kt @@ -14,6 +14,8 @@ import com.example.android_hit.databinding.FragmentTransactionBinding import com.example.android_hit.room.TransactionDB import com.example.android_hit.room.TransactionEntity import com.google.android.material.floatingactionbutton.FloatingActionButton +import java.text.NumberFormat +import java.util.Locale // TODO: Rename parameter arguments, choose names that match // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER @@ -97,9 +99,10 @@ class Transaction : Fragment() { list.addAll(database.transactionDao.getAllTransaction()) adapter.notifyDataSetChanged() val totalExpenseAmount = database.transactionDao.getTotalExpense() - binding.amountExpense.text = totalExpenseAmount.toString() + val currencyFormat = NumberFormat.getCurrencyInstance(Locale("id", "ID")) + binding.amountExpense.text = currencyFormat.format(totalExpenseAmount) val totalIncomeAmount = database.transactionDao.getTotalIncome() - binding.amountIncome.text = totalIncomeAmount.toString() + binding.amountIncome.text = currencyFormat.format(totalIncomeAmount) } override fun onResume() { diff --git a/app/src/main/java/com/example/android_hit/api/ApiService.kt b/app/src/main/java/com/example/android_hit/api/ApiService.kt index b5a69afdc173f3c83f0166289b1b6d307341cee3..8933b30ee2d9c8dfef7df28ca119b1e88fe8643d 100644 --- a/app/src/main/java/com/example/android_hit/api/ApiService.kt +++ b/app/src/main/java/com/example/android_hit/api/ApiService.kt @@ -2,12 +2,15 @@ package com.example.android_hit.api import com.example.android_hit.data.LoginPayload import com.example.android_hit.data.LoginResponse +import com.example.android_hit.data.ScanResponse import com.example.android_hit.data.TokenResponse +import okhttp3.MultipartBody import retrofit2.Call import retrofit2.http.Body import retrofit2.http.Header -import retrofit2.http.Headers +import retrofit2.http.Multipart import retrofit2.http.POST +import retrofit2.http.Part interface ApiService { @@ -18,4 +21,9 @@ interface ApiService { @POST("/api/auth/token") fun cekToken(@Header("Authorization") token: String): Call<TokenResponse> + @Multipart + @POST("/api/bill/upload") + fun uploadNota(@Header("Authorization") token: String, + @Part file: MultipartBody.Part): Call<ScanResponse> + } \ No newline at end of file diff --git a/app/src/main/java/com/example/android_hit/data/ScanResponse.kt b/app/src/main/java/com/example/android_hit/data/ScanResponse.kt new file mode 100644 index 0000000000000000000000000000000000000000..94b1062b4e4aeb855cddc8100cfa7fcf395b5f89 --- /dev/null +++ b/app/src/main/java/com/example/android_hit/data/ScanResponse.kt @@ -0,0 +1,13 @@ +package com.example.android_hit.data + +data class ScanResponse( + val items : Items +) +data class Items( + val items : List<Item> +) +data class Item( + val name : String, + val qty : Int, + val price : Double +) \ No newline at end of file diff --git a/app/src/main/java/com/example/android_hit/utils/TokenManager.kt b/app/src/main/java/com/example/android_hit/utils/TokenManager.kt index 7eb358d9745d69d296cb8fe60be588e80ffb52bd..461be58aa598d625c4f4d334d0f11ba89955a851 100644 --- a/app/src/main/java/com/example/android_hit/utils/TokenManager.kt +++ b/app/src/main/java/com/example/android_hit/utils/TokenManager.kt @@ -56,4 +56,9 @@ class TokenManager( context: Context) { fun deleteToken(){ editor.clear().apply() } + + fun getToken(): String? { + + return sharedPref.getString("TOKEN", null) + } } \ No newline at end of file diff --git a/app/src/main/res/drawable/rounded_background_gradient.xml b/app/src/main/res/drawable/rounded_background_gradient.xml index 11a47716004630dfb17e1d56b06599e2fab3258f..e73f03d5f0e7cf85d89803a5c3a031f8f4fdcdea 100644 --- a/app/src/main/res/drawable/rounded_background_gradient.xml +++ b/app/src/main/res/drawable/rounded_background_gradient.xml @@ -8,6 +8,8 @@ android:startColor="#B1B8D8" android:endColor="@color/white" android:gradientRadius="50%"/> - <corners android:radius="30dp"/> + <corners + android:topLeftRadius="30dp" + android:topRightRadius="30dp"/> </shape> \ No newline at end of file diff --git a/app/src/main/res/layout-land/activity_main.xml b/app/src/main/res/layout-land/activity_main.xml new file mode 100644 index 0000000000000000000000000000000000000000..7de35322adf041fa063c1f6d0be3967b963c67d7 --- /dev/null +++ b/app/src/main/res/layout-land/activity_main.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/primary_color_4" + tools:context=".MainActivity"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="horizontal" + > + + <com.google.android.material.navigationrail.NavigationRailView + android:id="@+id/navigation_view" + android:paddingTop="12dp" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:background="@color/secondary_color_2" + app:itemBackground="@color/secondary_color_2" + app:itemIconTint="@drawable/nav_item_color_selected" + app:itemTextColor="@color/primary_color_1" + app:labelVisibilityMode="labeled" + app:itemPaddingBottom="36dp" + app:menu="@menu/side_nav_menu" /> + + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + + + <FrameLayout + android:id="@+id/header_layout" + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <FrameLayout + android:id="@+id/frame_layout" + android:layout_width="match_parent" + android:layout_height="match_parent"/> + </LinearLayout> + + </LinearLayout> + +</RelativeLayout> \ No newline at end of file diff --git a/app/src/main/res/layout-land/fragment_detail_transaction.xml b/app/src/main/res/layout-land/fragment_detail_transaction.xml new file mode 100644 index 0000000000000000000000000000000000000000..429f1adc556073db835e06ba712cec7206a94112 --- /dev/null +++ b/app/src/main/res/layout-land/fragment_detail_transaction.xml @@ -0,0 +1,128 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout + 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" + android:orientation="vertical" + tools:context=".DetailTransaction"> + + <ScrollView + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="16dp" + android:layout_marginBottom="16dp" + android:orientation="vertical"> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:text="Title" + android:textColor="@color/primary_color_1" + android:textSize="16sp" /> + + <com.google.android.material.textfield.TextInputLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <EditText + android:id="@+id/inputTitle" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:inputType="textPersonName" + android:padding="12dp" /> + </com.google.android.material.textfield.TextInputLayout> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:text="How Much?" + android:textColor="@color/primary_color_1" + android:textSize="16sp" /> + + <com.google.android.material.textfield.TextInputLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <EditText + android:id="@+id/inputAmount" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:inputType="textPersonName" + android:padding="8dp" + android:textSize="36sp" /> + </com.google.android.material.textfield.TextInputLayout> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:text="Category" + android:textColor="@color/primary_color_1" + android:textSize="16sp" /> + + <RadioGroup + android:id="@+id/radioGroupCategory" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:orientation="horizontal"> + + <RadioButton + android:id="@+id/radioIncome" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginRight="24dp" + android:text="Income" + android:textSize="24sp" /> + + <RadioButton + android:id="@+id/radioExpense" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="24dp" + android:text="Expense" + android:textSize="24sp" /> + </RadioGroup> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:text="Location" + android:textColor="@color/primary_color_1" + android:textSize="16sp" /> + + <com.google.android.material.textfield.TextInputLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <EditText + android:id="@+id/inputLocation" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="12dp" /> + </com.google.android.material.textfield.TextInputLayout> + + <Button + android:id="@+id/buttonSave" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:layout_marginTop="48dp" + android:backgroundTint="@color/primary_color_1" + android:text="Save" + android:textColor="@color/white" /> + + </LinearLayout> + + </ScrollView> + +</RelativeLayout> \ No newline at end of file diff --git a/app/src/main/res/layout-land/fragment_graphs.xml b/app/src/main/res/layout-land/fragment_graphs.xml new file mode 100644 index 0000000000000000000000000000000000000000..1536bad50100b323228d9259f2b0f3fd383923fa --- /dev/null +++ b/app/src/main/res/layout-land/fragment_graphs.xml @@ -0,0 +1,133 @@ +<?xml version="1.0" encoding="utf-8"?> +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".Graphs"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="horizontal"> + + <LinearLayout + android:id="@+id/graph_container" + android:layout_width="0dp" + android:layout_height="match_parent" + android:layout_weight="1" + android:layout_marginHorizontal="12dp" + android:layout_marginBottom="8dp"> + + <com.github.mikephil.charting.charts.PieChart + android:id="@+id/pie_chart" + android:layout_width="match_parent" + android:layout_height="match_parent"> + </com.github.mikephil.charting.charts.PieChart> + + </LinearLayout> + + <LinearLayout + android:id="@+id/constraintLayout" + android:layout_width="200dp" + android:layout_height="match_parent" + android:orientation="vertical" + android:gravity="center" + android:layout_marginRight="12dp" + > + + <LinearLayout + android:id="@+id/containerIncome" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@drawable/background_rounded_purple" + android:paddingVertical="12dp" + android:paddingHorizontal="12dp" + android:layout_marginBottom="40dp" + > + + <ImageView + android:id="@+id/incomeIcon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="4dp" + android:src="@drawable/income" + android:layout_gravity="center_vertical" + /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + + <TextView + android:id="@+id/incomeText" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="8dp" + android:text="Income" + android:textSize="16sp"/> + + <TextView + android:id="@+id/incomeValueText" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="8dp" + android:text="Rp" + android:textSize="16sp" + android:textStyle="bold"/> + </LinearLayout> + + + </LinearLayout> + + <LinearLayout + android:id="@+id/containerExpense" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@drawable/background_rounded_peach" + android:paddingVertical="12dp" + android:paddingHorizontal="12dp" + > + + <ImageView + android:id="@+id/expenseIcon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/expense" + android:layout_marginStart="4dp" + android:layout_gravity="center_vertical" + /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + + <TextView + android:id="@+id/expenseText" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="8dp" + android:text="Expense" + android:textSize="16sp"/> + + <TextView + android:id="@+id/expenseValueText" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="8dp" + android:text="Rp" + android:textSize="16sp" + android:textStyle="bold"/> + </LinearLayout> + + + </LinearLayout> + + </LinearLayout> + + + </LinearLayout> + +</FrameLayout> \ No newline at end of file diff --git a/app/src/main/res/layout-land/fragment_scan.xml b/app/src/main/res/layout-land/fragment_scan.xml new file mode 100644 index 0000000000000000000000000000000000000000..550ff95d124acf0af793593cf619bb62824f9a27 --- /dev/null +++ b/app/src/main/res/layout-land/fragment_scan.xml @@ -0,0 +1,57 @@ +<?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=".Scan"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="horizontal"> + + <ImageView + android:id="@+id/captureImageView" + android:layout_width="0dp" + android:layout_height="match_parent" + android:layout_weight="1" + android:background="@drawable/iv_picture" + android:scaleType="centerCrop" + android:layout_marginHorizontal="12dp" + android:layout_marginBottom="12dp"/> + + <FrameLayout + android:layout_width="120dp" + android:layout_height="match_parent"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center"> + + <android.widget.Button + android:id="@+id/captureImgBtn" + android:layout_width="69dp" + android:layout_height="71dp" + android:background="@drawable/rounded_button" + android:text="" /> + + </LinearLayout> + + <Button + android:id="@+id/pickImgBtn" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal|bottom" + android:layout_marginBottom="12dp" + android:background="@android:color/transparent" + android:drawableTop="@drawable/gallery" + android:text="Gallery" + android:textColor="@color/primary_color_1" /> + + + </FrameLayout> + + + </LinearLayout> +</FrameLayout> \ No newline at end of file diff --git a/app/src/main/res/layout-land/fragment_settings.xml b/app/src/main/res/layout-land/fragment_settings.xml new file mode 100644 index 0000000000000000000000000000000000000000..65af9cafccf0f2e866469a2827ef12e69769bd8c --- /dev/null +++ b/app/src/main/res/layout-land/fragment_settings.xml @@ -0,0 +1,98 @@ +<?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=".Settings"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginHorizontal="16dp" + android:background="@drawable/rounded_background_gradient" + android:orientation="horizontal" + android:padding="16dp" + android:gravity="center"> + + <LinearLayout + android:layout_width="240dp" + android:layout_height="wrap_content" + android:orientation="vertical" + android:gravity="center"> + + <ImageView + android:id="@+id/iv_settings" + android:layout_width="140dp" + android:layout_height="140dp" + android:layout_centerInParent="true" + android:layout_marginTop="20dp" + android:src="@drawable/profile_icon" /> + + <TextView + android:id="@+id/emailTextView" + android:layout_marginHorizontal="16dp" + android:layout_marginVertical="16dp" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="123@gmail.com" + android:textColor="@color/primary1" + android:textAlignment="center"/> + </LinearLayout> + + + <ScrollView + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:gravity="center"> + + <Button + android:id="@+id/saveTransactionButton" + android:layout_marginHorizontal="16dp" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@drawable/rounded_background_transparent" + android:text="Save Transaction List" + android:layout_marginVertical="10dp" + android:textColor="@color/primary1" /> + + <Button + android:id="@+id/sendTransactionButton" + android:layout_marginHorizontal="16dp" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@drawable/rounded_background_transparent" + android:text="Send Transaction List" + android:layout_marginVertical="10dp" + android:textColor="@color/primary1" /> + + <Button + android:id="@+id/randomizeTransactionButton" + android:layout_marginHorizontal="16dp" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@drawable/rounded_background_transparent" + android:text="Randomize" + android:layout_marginVertical="10dp" + android:textColor="@color/primary1" /> + + <Button + android:id="@+id/logoutButton" + android:layout_marginHorizontal="16dp" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:drawableStart="@drawable/ic_launcher_foreground" + android:background="@drawable/rounded_background_transparent" + android:text="Logout" + android:layout_marginVertical="10dp" + android:textColor="@color/primary1" /> + + </LinearLayout> + </ScrollView> + + </LinearLayout> +</FrameLayout> \ No newline at end of file diff --git a/app/src/main/res/layout-land/fragment_transaction.xml b/app/src/main/res/layout-land/fragment_transaction.xml new file mode 100644 index 0000000000000000000000000000000000000000..ef8b5a5b559d95cfe047a58fa7fe1176cb4a7e16 --- /dev/null +++ b/app/src/main/res/layout-land/fragment_transaction.xml @@ -0,0 +1,144 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".Transaction"> + + <ScrollView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginTop="8dp"> + + <LinearLayout + android:id="@+id/expense_layout" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:layout_marginHorizontal="16dp"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:background="@drawable/rounded_income" + android:padding="16dp" + android:orientation="horizontal" + android:layout_marginRight="8dp"> + + <ImageView + android:layout_width="32dp" + android:layout_height="32dp" + android:src="@drawable/income" + android:scaleType="fitCenter" + android:layout_gravity="center_vertical" + android:layout_marginRight="12dp" + /> + + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical"> + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="Income" + android:textColor="@color/primary_color_1" + android:textStyle="normal" + android:textSize="16dp" + /> + + <TextView + android:id="@+id/amount_income" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textColor="@color/primary_color_1" + android:textStyle="bold" + android:textSize="16dp" + /> + </LinearLayout> + + </LinearLayout> + + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:background="@drawable/rounded_expense" + android:padding="16dp" + android:orientation="horizontal" + android:layout_marginLeft="8dp"> + + <ImageView + android:layout_width="32dp" + android:layout_height="32dp" + android:src="@drawable/expense" + android:scaleType="fitCenter" + android:layout_gravity="center_vertical" + android:layout_marginRight="12dp" + /> + + + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical"> + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="Expense" + android:textColor="@color/primary_color_1" + android:textStyle="normal" + android:textSize="16dp" + /> + + <TextView + android:id="@+id/amount_expense" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textColor="@color/primary_color_1" + android:textStyle="bold" + android:textSize="16dp" + /> + </LinearLayout> + </LinearLayout> + </LinearLayout> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Recently Transaction" + android:textSize="20dp" + android:textStyle="bold" + android:layout_marginTop="16dp" + android:textColor="@color/primary_color_1"/> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/rvTransaction" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingBottom="48dp"> + </androidx.recyclerview.widget.RecyclerView> + </LinearLayout> + </ScrollView> + + <com.google.android.material.floatingactionbutton.FloatingActionButton + android:id="@+id/fabAdd" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:layout_alignParentBottom="true" + android:layout_alignParentEnd="true" + app:srcCompat="@drawable/baseline_add_circle_24" + app:backgroundTint="@android:color/transparent" + app:fabSize="auto" + app:maxImageSize="60dp" + app:elevation="0dp" + app:layout_anchorGravity="bottom|end"/> + +</RelativeLayout> diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index cc272e40aa19c6f56d82ff76a1d8727d5f1e6710..22d7b9d424565cb7221ccfbd2282312d9c841698 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -27,7 +27,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" - android:background="?android:attr/windowBackground" + android:background="@color/secondary_color_2" app:itemBackground="@color/secondary_color_2" app:itemIconTint="@drawable/nav_item_color_selected" app:itemTextColor="@color/primary_color_1" diff --git a/app/src/main/res/layout/fragment_detail_transaction.xml b/app/src/main/res/layout/fragment_detail_transaction.xml index 78309f50deb3162e408883f082e46a0184a417bc..348b0f88eed34695cad30ff900794141e339d0a0 100644 --- a/app/src/main/res/layout/fragment_detail_transaction.xml +++ b/app/src/main/res/layout/fragment_detail_transaction.xml @@ -32,7 +32,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="textPersonName" - android:padding="8dp" /> + android:padding="12dp" /> </com.google.android.material.textfield.TextInputLayout> <TextView @@ -104,7 +104,7 @@ android:id="@+id/inputLocation" android:layout_width="match_parent" android:layout_height="wrap_content" - android:padding="8dp" /> + android:padding="12dp" /> </com.google.android.material.textfield.TextInputLayout> <Button diff --git a/app/src/main/res/layout/fragment_scan.xml b/app/src/main/res/layout/fragment_scan.xml index 6d6fa804e90fc93faa49a79fe52bd93559e4d393..6b3b2041270613ca3db118bbbe7aeb9cc277caff 100644 --- a/app/src/main/res/layout/fragment_scan.xml +++ b/app/src/main/res/layout/fragment_scan.xml @@ -5,55 +5,52 @@ android:layout_height="match_parent" tools:context=".Scan"> - <RelativeLayout + <LinearLayout android:layout_width="match_parent" - android:layout_height="match_parent"> - -<!-- <ImageView--> -<!-- android:id="@+id/iv_scan"--> -<!-- android:src="@drawable/baseline_document_scanner_24"--> -<!-- android:layout_width="200dp"--> -<!-- android:layout_height="200dp"--> -<!-- android:layout_centerInParent="true"/>--> + android:layout_height="match_parent" + android:orientation="vertical"> <ImageView android:id="@+id/captureImageView" - android:layout_width="350dp" - android:layout_height="450dp" - android:layout_centerInParent="true" + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" android:background="@drawable/iv_picture" - android:scaleType="centerCrop" /> - - <android.widget.Button - android:id="@+id/captureImgBtn" - android:layout_width="69dp" - android:layout_height="71dp" - - android:layout_alignParentEnd="true" - android:layout_alignParentBottom="true" - android:layout_marginVertical="33dp" - android:layout_marginEnd="168dp" - android:layout_marginBottom="35dp" - android:background="@drawable/rounded_button" - android:text="" /> - - <Button - android:id="@+id/pickImgBtn" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentStart="true" - android:layout_alignParentBottom="true" - android:layout_marginVertical="25dp" - android:layout_marginStart="24dp" - android:layout_marginEnd="55dp" - android:layout_marginBottom="24dp" - android:layout_toStartOf="@+id/captureImgBtn" - android:background="@android:color/transparent" - android:drawableTop="@drawable/gallery" - android:drawablePadding="0dp" - android:text="Gallery" - android:textColor="@color/primary_color_1" /> - - - </RelativeLayout> + android:scaleType="centerCrop" + android:layout_marginHorizontal="12dp"/> + + <FrameLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <Button + android:id="@+id/pickImgBtn" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:layout_marginStart="20dp" + android:background="@android:color/transparent" + android:drawableTop="@drawable/gallery" + android:text="Gallery" + android:textColor="@color/primary_color_1" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="120dp" + android:gravity="center"> + + <android.widget.Button + android:id="@+id/captureImgBtn" + android:layout_width="69dp" + android:layout_height="71dp" + android:background="@drawable/rounded_button" + android:text="" /> + + </LinearLayout> + + + </FrameLayout> + + + </LinearLayout> </FrameLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_settings.xml b/app/src/main/res/layout/fragment_settings.xml index 5ea7da0d2fee7b51e979e573b8ad2a900a9bd4fe..1f780855b46b78e88ff0d8cef73d944f874a2900 100644 --- a/app/src/main/res/layout/fragment_settings.xml +++ b/app/src/main/res/layout/fragment_settings.xml @@ -7,11 +7,10 @@ <LinearLayout android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="8dp" + android:layout_height="match_parent" android:layout_marginHorizontal="16dp" android:background="@drawable/rounded_background_gradient" - android:gravity="center" + android:gravity="center_horizontal" android:orientation="vertical"> <ImageView @@ -19,11 +18,13 @@ android:layout_width="180dp" android:layout_height="180dp" android:layout_centerInParent="true" - android:layout_marginVertical="10dp" + android:layout_marginTop="20dp" android:src="@drawable/profile_icon" /> <TextView android:id="@+id/emailTextView" + android:layout_marginHorizontal="16dp" + android:layout_marginVertical="16dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="123@gmail.com" @@ -34,6 +35,7 @@ android:id="@+id/saveTransactionButton" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_marginHorizontal="16dp" android:background="@drawable/rounded_background_transparent" android:text="Save Transaction List" android:layout_marginVertical="10dp" @@ -41,6 +43,7 @@ <Button android:id="@+id/sendTransactionButton" + android:layout_marginHorizontal="16dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/rounded_background_transparent" @@ -49,6 +52,7 @@ android:textColor="@color/primary1" /> <Button android:id="@+id/randomizeTransactionButton" + android:layout_marginHorizontal="16dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/rounded_background_transparent" @@ -58,6 +62,7 @@ <Button android:id="@+id/logoutButton" + android:layout_marginHorizontal="16dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:drawableStart="@drawable/ic_launcher_foreground" diff --git a/app/src/main/res/layout/fragment_transaction.xml b/app/src/main/res/layout/fragment_transaction.xml index 51d3b483fcfcd42447b9f44e5cad8a07e588232e..89b3de33ad259fa0b0824b05cf518e7c47b7669e 100644 --- a/app/src/main/res/layout/fragment_transaction.xml +++ b/app/src/main/res/layout/fragment_transaction.xml @@ -6,137 +6,128 @@ android:layout_height="match_parent" tools:context=".Transaction"> - <LinearLayout - android:id="@+id/expense_layout" + <ScrollView android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical" - android:layout_marginVertical="8dp" - android:layout_marginHorizontal="16dp"> + android:layout_height="match_parent" + android:layout_marginTop="8dp"> - <!-- LinearLayout untuk kolom --> <LinearLayout + android:id="@+id/expense_layout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="horizontal"> + android:orientation="vertical" + android:layout_marginHorizontal="16dp"> - <!-- Kolom biru --> <LinearLayout - android:layout_width="0dp" + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_weight="1" - android:background="@drawable/rounded_income" - android:padding="16dp" - android:orientation="horizontal" - android:layout_marginRight="8dp"> - - <ImageView - android:layout_width="32dp" - android:layout_height="32dp" - android:src="@drawable/income" - android:scaleType="fitCenter" - android:layout_gravity="center_vertical" - android:layout_marginRight="12dp" - /> - + android:orientation="horizontal"> <LinearLayout - android:layout_width="wrap_content" + android:layout_width="0dp" android:layout_height="wrap_content" - android:orientation="vertical"> - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="Income" - android:textColor="@color/primary_color_1" - android:textStyle="normal" - android:textSize="16dp" + android:layout_weight="1" + android:background="@drawable/rounded_income" + android:padding="16dp" + android:orientation="horizontal" + android:layout_marginRight="8dp"> + + <ImageView + android:layout_width="32dp" + android:layout_height="32dp" + android:src="@drawable/income" + android:scaleType="fitCenter" + android:layout_gravity="center_vertical" + android:layout_marginRight="12dp" /> - <!-- Teks kedua di dalam kolom biru --> - <TextView - android:id="@+id/amount_income" - android:layout_width="match_parent" + <LinearLayout + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textColor="@color/primary_color_1" - android:textStyle="bold" - android:textSize="16dp" - /> - </LinearLayout> - - </LinearLayout> - - <!-- Kolom kuning --> - <LinearLayout - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:background="@drawable/rounded_expense" - android:padding="16dp" - android:orientation="horizontal" - android:layout_marginRight="8dp"> - - <ImageView - android:layout_width="32dp" - android:layout_height="32dp" - android:src="@drawable/expense" - android:scaleType="fitCenter" - android:layout_gravity="center_vertical" - android:layout_marginRight="12dp" - /> + android:orientation="vertical"> + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="Income" + android:textColor="@color/primary_color_1" + android:textStyle="normal" + android:textSize="16dp" + /> + + <TextView + android:id="@+id/amount_income" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textColor="@color/primary_color_1" + android:textStyle="bold" + android:textSize="16dp" + /> + </LinearLayout> + </LinearLayout> <LinearLayout - android:layout_width="wrap_content" + android:layout_width="0dp" android:layout_height="wrap_content" - android:orientation="vertical"> - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="Expense" - android:textColor="@color/primary_color_1" - android:textStyle="normal" - android:textSize="16dp" + android:layout_weight="1" + android:background="@drawable/rounded_expense" + android:padding="16dp" + android:orientation="horizontal" + android:layout_marginLeft="8dp"> + + <ImageView + android:layout_width="32dp" + android:layout_height="32dp" + android:src="@drawable/expense" + android:scaleType="fitCenter" + android:layout_gravity="center_vertical" + android:layout_marginRight="12dp" /> - <!-- Teks kedua di dalam kolom biru --> - <TextView - android:id="@+id/amount_expense" - android:layout_width="match_parent" + + <LinearLayout + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textColor="@color/primary_color_1" - android:textStyle="bold" - android:textSize="16dp" - /> + android:orientation="vertical"> + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="Expense" + android:textColor="@color/primary_color_1" + android:textStyle="normal" + android:textSize="16dp" + /> + + <TextView + android:id="@+id/amount_expense" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textColor="@color/primary_color_1" + android:textStyle="bold" + android:textSize="16dp" + /> + </LinearLayout> </LinearLayout> </LinearLayout> - </LinearLayout> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="Recently Transaction" - android:textSize="20dp" - android:textStyle="bold" - android:layout_marginTop="16dp" - android:textColor="@color/primary_color_1"/> - - <ScrollView - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_marginTop="8dp"> - - <androidx.recyclerview.widget.RecyclerView - android:id="@+id/rvTransaction" - android:layout_width="match_parent" + <TextView + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingBottom="48dp"> - </androidx.recyclerview.widget.RecyclerView> - - </ScrollView> - </LinearLayout> - + android:text="Recently Transaction" + android:textSize="20dp" + android:textStyle="bold" + android:layout_marginTop="16dp" + android:textColor="@color/primary_color_1"/> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/rvTransaction" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:paddingBottom="48dp"> + </androidx.recyclerview.widget.RecyclerView> + </LinearLayout> + </ScrollView> - <!-- Tombol Add --> <com.google.android.material.floatingactionbutton.FloatingActionButton android:id="@+id/fabAdd" android:layout_width="wrap_content" @@ -148,6 +139,7 @@ app:backgroundTint="@android:color/transparent" app:fabSize="auto" app:maxImageSize="60dp" - app:elevation="0dp"/> + app:elevation="0dp" + app:layout_anchorGravity="bottom|end"/> </RelativeLayout> diff --git a/app/src/main/res/menu/side_nav_menu.xml b/app/src/main/res/menu/side_nav_menu.xml new file mode 100644 index 0000000000000000000000000000000000000000..a99b54a6082e8d6adf1c4966c1bf5032f6aa428b --- /dev/null +++ b/app/src/main/res/menu/side_nav_menu.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + <item + android:id="@+id/nav_transaction" + android:icon="@drawable/transaction_icon" + /> + <item + android:id="@+id/nav_scan" + android:icon="@drawable/scan_icon" + /> + <item + android:id="@+id/nav_graphs" + android:icon="@drawable/graphs_icon" + /> + <item + android:id="@+id/nav_settings" + android:icon="@drawable/settings_icon" + /> + +</menu> \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 8130206cff0c57ee531564f9aa653ad4c92ea6de..fd194862f96cc5afabca08f3b27f813053db3a6f 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -3,7 +3,7 @@ <color name="black">#FF000000</color> <color name="white">#FFFFFFFF</color> <color name="primary_color_1">#322F50</color> - <color name="primary_color_2">#B1D1D8</color> + <color name="primary_color_2">#B1B8D8</color> <color name="primary_color_3">#EFDAC7</color> <color name="primary_color_4">#F0F0F2</color> <color name="secondary_color_2">#DDDFEB</color>