diff --git a/app/src/main/java/com/example/nerbos/data/TransactionDao.kt b/app/src/main/java/com/example/nerbos/data/TransactionDao.kt index ce1a9db3b911612993363e6d50492612ee2c2712..29683aee64443d98d4a9bfd898ca249449efe82b 100644 --- a/app/src/main/java/com/example/nerbos/data/TransactionDao.kt +++ b/app/src/main/java/com/example/nerbos/data/TransactionDao.kt @@ -8,6 +8,7 @@ import androidx.room.OnConflictStrategy import androidx.room.Query import androidx.room.Update import com.example.nerbos.model.Transaction +import com.example.nerbos.model.TransactionCategory @Dao interface TransactionDao { @@ -22,4 +23,8 @@ interface TransactionDao { @Delete suspend fun deleteTransation(transaction: Transaction) + + @Query("SELECT SUM(nominal) FROM transaction_table WHERE userID = :userID AND category = :category") + fun getSum(userID: Int, category: TransactionCategory): LiveData<Float> + } \ No newline at end of file diff --git a/app/src/main/java/com/example/nerbos/fragments/statistic/StatisticFragment.kt b/app/src/main/java/com/example/nerbos/fragments/statistic/StatisticFragment.kt index 8eba3594b4d5a3cf449300f8a316cc6119c0ae5c..df203cb4033c734c10f9e352516adedef5014e70 100644 --- a/app/src/main/java/com/example/nerbos/fragments/statistic/StatisticFragment.kt +++ b/app/src/main/java/com/example/nerbos/fragments/statistic/StatisticFragment.kt @@ -3,12 +3,14 @@ package com.example.nerbos.fragments.statistic import android.graphics.Color import android.graphics.Typeface import android.os.Bundle -import android.util.Log import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.lifecycle.MediatorLiveData +import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModelProvider +import androidx.lifecycle.lifecycleScope import com.example.nerbos.R import com.example.nerbos.databinding.FragmentStatisticBinding import com.example.nerbos.model.TransactionCategory @@ -21,17 +23,17 @@ import com.github.mikephil.charting.data.PieDataSet import com.github.mikephil.charting.data.PieEntry import com.github.mikephil.charting.formatter.PercentFormatter import com.github.mikephil.charting.utils.MPPointF +import kotlinx.coroutines.launch +import java.text.NumberFormat +import java.util.Locale -/** - * A simple [Fragment] subclass. - * Use the [StatisticFragment.newInstance] factory method to - * create an instance of this fragment. - */ class StatisticFragment : Fragment() { private lateinit var transactionViewModel: TransactionViewModel private lateinit var authentication: Authentication private lateinit var pieChart: PieChart + private lateinit var binding: FragmentStatisticBinding + private val liveDataReady = MutableLiveData<Boolean>() private var sumIncome: Float = 0.0f private var sumOutcome : Float = 0.0f @@ -47,38 +49,134 @@ class StatisticFragment : Fragment() { savedInstanceState: Bundle? ): View { // Inflate the layout for this fragment - val binding = FragmentStatisticBinding.inflate(inflater, container, false) + binding = FragmentStatisticBinding.inflate(inflater, container, false) pieChart = binding.pieChart // Create an authentication object authentication = Authentication(requireContext()) // Set the view model for the transaction and set the user id transactionViewModel = ViewModelProvider(this)[TransactionViewModel::class.java] - transactionViewModel.setReadDataUserId(authentication.getNim()) - - // log all the transactions - transactionViewModel.readAllData!!.observe(viewLifecycleOwner) { transactions -> - transactions.forEach { - Log.d("Transaction", it.toString()) - if (it.category == TransactionCategory.INCOME) { - sumIncome += it.nominal - } else { - sumOutcome += it.nominal - } - } - } + + // Get the data from the database + getData() // Set up the pie chart pieChartSetup() - + // Display the pie chart + displayPieChart() return binding.root } + private fun getData() { + lifecycleScope.launch { + // Get the sum of income and outcome + val nim = authentication.getNim() + val income = transactionViewModel.getSums(nim, TransactionCategory.INCOME) + val outcome = transactionViewModel.getSums(nim, TransactionCategory.OUTCOME) + + // Use MediatorLiveData to observe both income and outcome + val result = MediatorLiveData<Float>().apply { + addSource(income) { value -> setValue(value) } + addSource(outcome) { value -> setValue(value) } + } + + // Observing the result + result.observe(viewLifecycleOwner) { + if (income.value != null && outcome.value != null) { + sumIncome = income.value!! + sumOutcome = outcome.value!! + liveDataReady.postValue(true) + } + } + } + } + // Display a pie chart of the income and outcome private fun pieChartSetup() { + // Set the pie chart: percentage, description, extra offsets + pieChart.setUsePercentValues(true) + pieChart.description.isEnabled = false + pieChart.setExtraOffsets(5f, 10f, 5f, 5f) + + // Set the pie chart: drag deceleration, hole, hole color + pieChart.setDragDecelerationFrictionCoef(0.95f) + pieChart.isDrawHoleEnabled = true + pieChart.setHoleColor(requireContext().getColor(R.color.primary_bg)) + + // Set the pie chart: transparent circle, hole color, hole radius, draw center text + pieChart.setTransparentCircleColor(requireContext().getColor(R.color.primary_bg)) + pieChart.setTransparentCircleAlpha(110) + pieChart.holeRadius = 42f + pieChart.transparentCircleRadius = 48f + pieChart.setDrawCenterText(true) + // Set the pie chart: legend and entry label + pieChart.legend.isEnabled = false + pieChart.setEntryLabelColor(Color.BLACK) + pieChart.setEntryLabelTextSize(12f) + + // Set the pie chart: rotation and highlight + pieChart.setRotationAngle(0f) + pieChart.isRotationEnabled = true + pieChart.isHighlightPerTapEnabled = true + } + + private fun setPieData(){ + // Set the pie chart: animation + pieChart.animateY(1400, Easing.EaseInOutQuad) + + // Set the pie chart: data + val entries: ArrayList<PieEntry> = ArrayList() + entries.add(PieEntry(sumIncome, resources.getString(R.string.income))) + entries.add(PieEntry(sumOutcome, resources.getString(R.string.outcome))) + + // Create a pie data set + val dataSet = PieDataSet(entries, resources.getString(R.string.pie_chart_title)) + + // Set the pie data set properties + dataSet.setDrawIcons(false) + dataSet.sliceSpace = 3f + dataSet.iconsOffset = MPPointF(0f, 40f) + dataSet.selectionShift = 5f + + // Set the pie data set: colors + val colors: ArrayList<Int> = ArrayList() + colors.add(requireContext().getColor(R.color.purple_200)) + colors.add(requireContext().getColor(R.color.red)) + dataSet.colors = colors + + // Set the pie data set: text size, text color, text typeface + val data = PieData(dataSet) + data.setValueFormatter(PercentFormatter()) + data.setValueTextSize(15f) + data.setValueTypeface(Typeface.DEFAULT_BOLD) + data.setValueTextColor(Color.BLACK) + pieChart.setData(data) + pieChart.highlightValues(null) + } + + private fun displayPieChart() { + // wait until the income and outcome are calculated + // Observe the LiveData object to update the pie chart when the data is ready + liveDataReady.observe(viewLifecycleOwner) { dataReady -> + if (dataReady) { + // Set the pie data + setPieData() + + // Invalidate the pie chart (refresh) + pieChart.invalidate() + + // Reset the sum of income and outcome + val incomeNumber = binding.totalIncomeNumber + val outcomeNumber = binding.totalOutcomeNumber + + // Update the text views with the formatted values + incomeNumber.text = NumberFormat.getCurrencyInstance(Locale(resources.getString(R.string.language_code), resources.getString(R.string.country_code))).format(sumIncome) + outcomeNumber.text = NumberFormat.getCurrencyInstance(Locale(resources.getString(R.string.language_code), resources.getString(R.string.country_code))).format(sumOutcome) + } + } } } \ No newline at end of file diff --git a/app/src/main/java/com/example/nerbos/repository/TransactionRepository.kt b/app/src/main/java/com/example/nerbos/repository/TransactionRepository.kt index 167b34ac67800ba787e7192bab4421ad3152a1f9..378a6f2e1af9fda80cf7a9e5d2f51c5367ce8c23 100644 --- a/app/src/main/java/com/example/nerbos/repository/TransactionRepository.kt +++ b/app/src/main/java/com/example/nerbos/repository/TransactionRepository.kt @@ -3,6 +3,7 @@ package com.example.nerbos.repository import androidx.lifecycle.LiveData import com.example.nerbos.model.Transaction import com.example.nerbos.data.TransactionDao +import com.example.nerbos.model.TransactionCategory import com.example.nerbos.service.Authentication class TransactionRepository(private val transactionDao: TransactionDao) { @@ -22,4 +23,8 @@ class TransactionRepository(private val transactionDao: TransactionDao) { fun setReadAllDataUserId(userID: Int){ readAllData = transactionDao.readAllData(userID) } + + fun getSum(userID: Int, category: TransactionCategory): LiveData<Float>{ + return transactionDao.getSum(userID, category) + } } \ No newline at end of file diff --git a/app/src/main/java/com/example/nerbos/viewmodel/TransactionViewModel.kt b/app/src/main/java/com/example/nerbos/viewmodel/TransactionViewModel.kt index 50081922b59de5349c14327404e84efdf8e8cca5..ed27c0a71f60129bf3fdd5443f84a60a97dac15a 100644 --- a/app/src/main/java/com/example/nerbos/viewmodel/TransactionViewModel.kt +++ b/app/src/main/java/com/example/nerbos/viewmodel/TransactionViewModel.kt @@ -6,6 +6,7 @@ import androidx.lifecycle.LiveData import androidx.lifecycle.viewModelScope import com.example.nerbos.model.Transaction import com.example.nerbos.data.TransactionDatabase +import com.example.nerbos.model.TransactionCategory import com.example.nerbos.repository.TransactionRepository import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -41,4 +42,8 @@ class TransactionViewModel(application: Application): AndroidViewModel(applicati repository.setReadAllDataUserId(userId) readAllData = repository.readAllData } + + fun getSums(userId: Int, category: TransactionCategory): LiveData<Float>{ + return repository.getSum(userId, category) + } } \ 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 index 8a9966c9694727aa195f1036c7838296f313ff57..f2c30fb6f6ed0c1150c1c9546eae3ec31f650df6 100644 --- a/app/src/main/res/layout-land/activity_main.xml +++ b/app/src/main/res/layout-land/activity_main.xml @@ -11,7 +11,6 @@ android:id="@+id/appBarLayout" android:layout_width="0dp" android:layout_height="wrap_content" - android:background="@color/primary_bg" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> @@ -45,16 +44,13 @@ android:layout_width="78dp" android:layout_height="0dp" - android:background="@color/primary_bg" + android:background="@color/navbar_bg" app:elevation="1dp" app:itemBackground="@color/navbar_bg" app:itemIconTint="@color/navbar_icon" - app:itemTextColor="@color/navbar_icon" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="1.0" app:layout_constraintTop_toBottomOf="@+id/appBarLayout" - app:layout_constraintVertical_bias="1.0" app:menu="@menu/bottom_navbar"> </com.google.android.material.navigation.NavigationView> diff --git a/app/src/main/res/layout-land/fragment_statistic.xml b/app/src/main/res/layout-land/fragment_statistic.xml new file mode 100644 index 0000000000000000000000000000000000000000..b810818485e21b56567ea789c689b1d4130f0717 --- /dev/null +++ b/app/src/main/res/layout-land/fragment_statistic.xml @@ -0,0 +1,126 @@ +<?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" + android:fillViewport="true" + android:background="@color/primary_bg" + tools:context=".fragments.statistic.StatisticFragment"> + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <TextView + android:id="@+id/titleChart" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="44dp" + android:gravity="center" + android:padding="10dp" + android:text="@string/pie_chart_title" + android:textAlignment="center" + android:textColor="@color/chart_title" + android:textSize="24sp" + android:textStyle="bold" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/pieChart" + app:layout_constraintTop_toTopOf="parent" /> + + <com.github.mikephil.charting.charts.PieChart + android:id="@+id/pieChart" + android:layout_width="300dp" + android:layout_height="300dp" + android:layout_marginStart="52dp" + android:layout_weight="1" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="0.5" /> + + <TextView + android:id="@+id/totalIncome" + android:layout_width="100dp" + android:layout_height="wrap_content" + android:layout_margin="3dp" + android:layout_marginStart="8dp" + android:layout_weight="1" + android:gravity="center" + android:padding="4dp" + android:text="@string/income" + android:textAlignment="center" + android:textColor="@color/chart_title" + app:drawableLeftCompat="@drawable/ic_circle" + app:drawableTint="@color/purple_200" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@+id/totalOutcome" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/pieChart" + app:layout_constraintTop_toBottomOf="@+id/titleChart" + app:layout_constraintVertical_bias="0.2" /> + + <TextView + android:id="@+id/totalOutcome" + android:layout_width="100dp" + android:layout_height="wrap_content" + android:layout_margin="3dp" + android:layout_weight="1" + android:gravity="center" + android:padding="4dp" + android:text="@string/outcome" + android:textAlignment="center" + android:textColor="@color/chart_title" + app:drawableLeftCompat="@drawable/ic_circle" + app:drawableTint="@color/red" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/totalIncome" + app:layout_constraintTop_toBottomOf="@+id/titleChart" + app:layout_constraintVertical_bias="0.2" /> + + <TextView + android:id="@+id/totalIncomeNumber" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="3dp" + android:layout_marginStart="20dp" + android:layout_marginTop="16dp" + android:layout_weight="1" + android:gravity="center" + android:padding="4dp" + android:text="@string/income" + android:textAlignment="center" + android:textColor="@color/chart_title" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@+id/totalOutcomeNumber" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/pieChart" + app:layout_constraintTop_toBottomOf="@+id/totalIncome" + app:layout_constraintVertical_bias="0.2" /> + + <TextView + android:id="@+id/totalOutcomeNumber" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="3dp" + android:layout_marginTop="24dp" + android:layout_weight="1" + android:gravity="center" + android:padding="4dp" + android:text="@string/outcome" + android:textAlignment="center" + android:textColor="@color/chart_title" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/totalIncomeNumber" + app:layout_constraintTop_toBottomOf="@+id/totalOutcome" + app:layout_constraintVertical_bias="0.200" /> + + </androidx.constraintlayout.widget.ConstraintLayout> + +</FrameLayout> \ No newline at end of file diff --git a/app/src/main/res/layout-land/fragment_user.xml b/app/src/main/res/layout-land/fragment_user.xml new file mode 100644 index 0000000000000000000000000000000000000000..05f64b5008a810ea923ad11127399d146e39a86d --- /dev/null +++ b/app/src/main/res/layout-land/fragment_user.xml @@ -0,0 +1,141 @@ +<?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=".fragments.user.UserFragment" + android:background="@color/primary_bg"> + + <!-- TODO: Update blank fragment layout --> + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/primary_bg"> + + <androidx.cardview.widget.CardView + android:id="@+id/logoutCard" + android:layout_width="400dp" + android:layout_height="310dp" + app:cardBackgroundColor="@color/login_card_bg" + app:cardCornerRadius="20dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent"> + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:padding="4dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="0.5"> + + <TextView + android:id="@+id/logoutTitle" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="15dp" + android:gravity="center_horizontal" + android:text="@string/welcome" + android:textColor="@color/white" + android:textSize="40sp" + android:visibility="visible" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <TextView + android:id="@+id/logoutDescription" + android:layout_width="341dp" + android:layout_height="wrap_content" + android:layout_marginTop="5dp" + android:gravity="center_horizontal" + android:text="@string/app_name_full" + android:textColor="@color/text_secondary" + android:textSize="20sp" + android:visibility="visible" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/logoutTitle" /> + + <androidx.cardview.widget.CardView + android:id="@+id/cardView4" + android:layout_width="330dp" + android:layout_height="50dp" + android:layout_gravity="center_horizontal" + app:cardBackgroundColor="@color/login_input_field" + app:cardCornerRadius="20dp" + app:layout_constraintBottom_toTopOf="@+id/cardView5" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.548" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/logoutDescription" + app:layout_constraintVertical_bias="0.361"> + + <TextView + android:id="@+id/textViewUser" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:text="" + android:textColor="@color/white" + android:textSize="20sp" /> + + </androidx.cardview.widget.CardView> + + <androidx.cardview.widget.CardView + android:id="@+id/cardView5" + android:layout_width="330dp" + android:layout_height="50dp" + android:layout_gravity="center_horizontal" + android:layout_marginTop="75dp" + app:cardBackgroundColor="@color/login_input_field" + app:cardCornerRadius="20dp" + app:layout_constraintBottom_toTopOf="@+id/button" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.548" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/logoutDescription" + app:layout_constraintVertical_bias="0.0"> + + <TextView + android:id="@+id/textViewEmail" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:text="" + android:textColor="@color/white" + android:textSize="20sp" /> + + </androidx.cardview.widget.CardView> + + <Button + android:id="@+id/button" + android:layout_width="130dp" + android:layout_height="55dp" + android:layout_gravity="center_horizontal" + android:layout_marginTop="135dp" + android:labelFor="@id/button" + android:text="@string/logout_title" + android:textColor="@color/white" + android:textSize="20sp" + app:backgroundTint="@color/dark_red" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.497" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/logoutDescription" + app:layout_constraintVertical_bias="0.1" /> + + </androidx.constraintlayout.widget.ConstraintLayout> + + </androidx.cardview.widget.CardView> + + </androidx.constraintlayout.widget.ConstraintLayout> +</FrameLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_statistic.xml b/app/src/main/res/layout/fragment_statistic.xml index 7e562b036d83f4113f8e311614cc3b505f9b8d82..ba705c87f7af0ed44241908f4128ca57beb58cb8 100644 --- a/app/src/main/res/layout/fragment_statistic.xml +++ b/app/src/main/res/layout/fragment_statistic.xml @@ -11,8 +11,9 @@ <RelativeLayout android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_marginTop="20dp" + android:layout_height="wrap_content" + android:layout_marginTop="0dp" + android:layout_gravity="center" tools:ignore="UselessParent"> <TextView @@ -21,7 +22,7 @@ android:layout_height="wrap_content" android:gravity="center" android:padding="10dp" - android:text="@string/pie_chart" + android:text="@string/pie_chart_title" android:textAlignment="center" android:textColor="@color/chart_title" android:textSize="25sp" @@ -40,6 +41,7 @@ android:layout_marginBottom="5dp" /> <LinearLayout + android:id="@+id/totalIncomeOutcome" android:layout_width="300dp" android:layout_height="wrap_content" android:layout_below="@+id/pieChart" @@ -58,7 +60,7 @@ android:padding="4dp" android:text="@string/income" android:textAlignment="center" - android:textColor="@color/white" + android:textColor="@color/chart_title" app:drawableTint="@color/purple_200" app:drawableLeftCompat="@drawable/ic_circle" /> @@ -72,11 +74,47 @@ android:padding="4dp" android:text="@string/outcome" android:textAlignment="center" - android:textColor="@color/white" + android:textColor="@color/chart_title" app:drawableLeftCompat="@drawable/ic_circle" app:drawableTint="@color/red" /> </LinearLayout> + <LinearLayout + android:id="@+id/totalIncomeOutcomeNumber" + android:layout_width="300dp" + android:layout_height="wrap_content" + android:layout_below="@+id/totalIncomeOutcome" + android:layout_marginTop="15dp" + android:orientation="horizontal" + android:layout_centerHorizontal="true" + android:weightSum="2"> + + <TextView + android:id="@+id/totalIncomeNumber" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_margin="3dp" + android:layout_weight="1" + android:gravity="center" + android:padding="4dp" + android:text="@string/income" + android:textAlignment="center" + android:textColor="@color/chart_title" /> + + <TextView + android:id="@+id/totalOutcomeNumber" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_margin="3dp" + android:layout_weight="1" + android:gravity="center" + android:padding="4dp" + android:text="@string/outcome" + android:textAlignment="center" + android:textColor="@color/chart_title" /> + + </LinearLayout> + </RelativeLayout> </FrameLayout> \ 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 b9f39245f02ffbfb7aeeb029d7e07b644c1fc3ca..e702056a76d75222618a58d672ef2d14ae8feead 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -29,6 +29,6 @@ <color name="grey">#aaa</color> <color name="button_color">#1E573B</color> <color name="yellow">#FFEB3B</color> - <color name="chart_title">#AEACCC</color> + <color name="chart_title">#EAE9F6</color> </resources> \ 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 a0ce03409bf105f779d4f1c88d8cc52cb4639ff5..8238883239e177aab6c1d4abf47882760207137a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -51,8 +51,12 @@ <string name="maps">Maps</string> <string name="network_sensing_string">No Internet Connection Please check your connection and try again.</string> <string name="close_button">Close Button</string> - <string name="pie_chart">Pie Chart</string> + + <string name="pie_chart_title">Income vs Outcome Chart</string> + <string name="language_code">id</string> + <string name="country_code">ID</string> <string name="capture_button">Capture Button</string> <string name="gallery_button">Gallery Button</string> + </resources> \ No newline at end of file