diff --git a/app/src/main/java/com/example/bondoman/ui/hub/HubActivity.kt b/app/src/main/java/com/example/bondoman/ui/hub/HubActivity.kt index 121ebf8ed37bd761c53d10da5a403117b381a7c3..93606f9bb01849a58e91ed964a41602c598e1f71 100644 --- a/app/src/main/java/com/example/bondoman/ui/hub/HubActivity.kt +++ b/app/src/main/java/com/example/bondoman/ui/hub/HubActivity.kt @@ -4,10 +4,15 @@ import android.content.res.Configuration import android.os.Bundle import android.view.View import androidx.appcompat.app.AppCompatActivity +import androidx.constraintlayout.widget.ConstraintLayout +import androidx.constraintlayout.widget.ConstraintSet +import androidx.core.view.updateLayoutParams +import androidx.fragment.app.Fragment import androidx.lifecycle.ViewModelProvider +import androidx.navigation.NavController import androidx.navigation.findNavController +import androidx.navigation.fragment.NavHostFragment import androidx.navigation.ui.setupWithNavController -import androidx.viewbinding.ViewBinding import com.example.bondoman.R import com.example.bondoman.database.AppDatabase import com.example.bondoman.database.repository.TransactionRepository @@ -19,7 +24,7 @@ import com.google.android.material.bottomnavigation.BottomNavigationView import com.google.android.material.navigation.NavigationView class HubActivity : AppCompatActivity() { - private lateinit var viewBinding: ViewBinding + private lateinit var binding: ActivityHubBinding lateinit var transactionViewModel: TransactionViewModel override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -31,33 +36,39 @@ class HubActivity : AppCompatActivity() { transactionViewModel = ViewModelProvider(this, transactionModelFactory)[TransactionViewModel::class.java] - // Initialize navbar and fragments - val orientation = resources.configuration.orientation - if (orientation == Configuration.ORIENTATION_LANDSCAPE) { - viewBinding = ActivityHubLandscapeBinding.inflate(layoutInflater) - setContentView(viewBinding.root) + // Initialize binding + binding = ActivityHubBinding.inflate(layoutInflater) + setContentView(binding.root) - // Initialize header - (viewBinding as ActivityHubLandscapeBinding).headerContentLandscape.navBackButton.visibility = View.GONE + // Initialize header + binding.headerContent.navBackButton.visibility = View.GONE - val navView: NavigationView = (viewBinding as ActivityHubLandscapeBinding).navViewLandscape - val navController = findNavController(R.id.nav_host_fragment_activity_main) - navView.setupWithNavController(navController) - } else { - viewBinding = ActivityHubBinding.inflate(layoutInflater) - setContentView(viewBinding.root) + // Initialize navbars + val navController = findNavController(R.id.nav_host_fragment_activity_main) + binding.navView.setupWithNavController(navController) + binding.navViewLandscape.setupWithNavController(navController) - // Initialize header - (viewBinding as ActivityHubBinding).headerContent.navBackButton.visibility = View.GONE + // Setup orientation + val orientation = resources.configuration.orientation - val navView: BottomNavigationView = (viewBinding as ActivityHubBinding).navView - val navController = findNavController(R.id.nav_host_fragment_activity_main) - navView.setupWithNavController(navController) + if (orientation == Configuration.ORIENTATION_LANDSCAPE) { + binding.navView.visibility = View.GONE + binding.navViewLandscape.visibility = View.VISIBLE + } else { + binding.navViewLandscape.visibility = View.GONE + binding.navView.visibility = View.VISIBLE } } override fun onConfigurationChanged(newConfig: Configuration) { super.onConfigurationChanged(newConfig) - recreate() + + if(newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE){ + binding.navView.visibility = View.GONE + binding.navViewLandscape.visibility = View.VISIBLE + } else { + binding.navViewLandscape.visibility = View.GONE + binding.navView.visibility = View.VISIBLE + } } } \ No newline at end of file diff --git a/app/src/main/java/com/example/bondoman/ui/hub/addtransaction/AddTransactionFragment.kt b/app/src/main/java/com/example/bondoman/ui/hub/addtransaction/AddTransactionFragment.kt new file mode 100644 index 0000000000000000000000000000000000000000..4c8c7f777cfce5d550546279ff2810b394c0cd71 --- /dev/null +++ b/app/src/main/java/com/example/bondoman/ui/hub/addtransaction/AddTransactionFragment.kt @@ -0,0 +1,253 @@ +package com.example.bondoman.ui.hub.addtransaction + +import android.Manifest +import android.content.pm.PackageManager +import android.location.Location +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.TextView +import android.widget.Toast +import androidx.core.app.ActivityCompat +import androidx.core.content.ContextCompat +import androidx.fragment.app.Fragment +import androidx.lifecycle.ViewModelProvider +import com.example.bondoman.R +import com.example.bondoman.database.AppDatabase +import com.example.bondoman.database.entity.TransactionEntity +import com.example.bondoman.database.repository.TransactionRepository +import com.example.bondoman.databinding.ActivityTransactionBinding +import com.example.bondoman.databinding.FragmentAddTransactionBinding +import com.example.bondoman.viewmodel.transaction.LocationViewModel +import com.example.bondoman.viewmodel.transaction.LocationViewModelFactory +import com.example.bondoman.viewmodel.transaction.TransactionViewModel +import com.example.bondoman.viewmodel.transaction.TransactionViewModelFactory +import com.google.android.gms.location.FusedLocationProviderClient +import com.google.android.gms.location.LocationServices +import java.text.SimpleDateFormat +import java.util.Date +import java.util.Locale + +class AddTransactionFragment : Fragment() { + private lateinit var binding: FragmentAddTransactionBinding + private lateinit var transactionViewModel: TransactionViewModel + private var actionCode: Int = 0 + private var transactionId: Int = 0 + + private lateinit var fusedLocationClient: FusedLocationProviderClient + private lateinit var locationViewModel: LocationViewModel + private var savedLat: Double? = null + private var savedLng: Double? = null + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + super.onCreateView(inflater, container, savedInstanceState) + binding = FragmentAddTransactionBinding.inflate(layoutInflater) + + return binding.root + } + override fun onCreate(savedInstanceState: Bundle?){ + super.onCreate(savedInstanceState) +// +// binding = ActivityTransactionBinding.inflate(layoutInflater) +// +// // Initialize database +// val database = AppDatabase.getInstance(this) +// val transactionRepo = TransactionRepository(database.transactionDao) +// val transactionModelFactory = TransactionViewModelFactory(transactionRepo) +// transactionViewModel = ViewModelProvider(this, transactionModelFactory)[TransactionViewModel::class.java] +// +// // Location VM +// val locationModelFactory = LocationViewModelFactory() +// locationViewModel = ViewModelProvider(this, locationModelFactory)[LocationViewModel::class.java] +// locationViewModel.location.observe(this) { +// observeLocation(it) +// } +// +// // Initialize header +// binding.header.navTitle.text = getString(R.string.hub_nav_transaction) +// val backButton = binding.header.navBackButton +// backButton.setOnClickListener(::onBackClick) +// +// // Initialize category dropdown +// val spinner = binding.categoryInput +// spinner.setSelection(0, true); +// (spinner.selectedView as TextView).setTextColor(ContextCompat.getColor(this, R.color.black)) +// +// // Locate button +// val locateButton = binding.btnLocate +// locateButton.setOnClickListener(::onLocateClick) +// +// // Delete button +// val deleteButton = binding.btnDelete +// deleteButton.setOnClickListener(::onDeleteClick) +// +// // Initialize category dropdown +// val submitButton = binding.submitButton +// backButton.setOnClickListener(::onBackClick) +// submitButton.setOnClickListener(::onSubmitClick) +// +// // Initialize initial values +// val titleInitial = intent.getStringExtra(KEY_TITLE) +// val amountInitial = intent.getIntExtra(KEY_AMOUNT, 0) +// val categoryInitial = intent.getIntExtra(KEY_CATEGORY, 0) +// var locationInitial = intent.getStringExtra(KEY_LOCATION) +// +// binding.titleInput.setText(titleInitial) +// binding.amountInput.setText(amountInitial.toString()) +// binding.categoryInput.setSelection(categoryInitial, true) +// binding.locationText.text = locationInitial +// +// // Initialize category dropdown color +// (binding.categoryInput.selectedView as TextView).setTextColor(ContextCompat.getColor(this, R.color.black)) +// +// actionCode = intent.getIntExtra(KEY_ACTION, 0) +// transactionId = intent.getIntExtra(KEY_TRANSACTION_ID, 0) +// +// if(actionCode == ACTION_EDIT) binding.categoryInput.isEnabled = false +// +// fusedLocationClient = LocationServices.getFusedLocationProviderClient(this) + } + + private fun onDeleteClick(view: View) { +// locationViewModel.setLoc(null, null) + } + + private fun onLocateClick(view: View) { +// getLastLocation() + } + + private fun getLastLocation() { +// if (ActivityCompat.checkSelfPermission( +// this, +// Manifest.permission.ACCESS_FINE_LOCATION +// ) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission( +// this, +// Manifest.permission.ACCESS_COARSE_LOCATION +// ) != PackageManager.PERMISSION_GRANTED +// ) { +// ActivityCompat.requestPermissions(this, +// arrayOf( +// Manifest.permission.ACCESS_FINE_LOCATION, +// Manifest.permission.ACCESS_COARSE_LOCATION +// ), +// 1 +// ) +// +// if (ActivityCompat.checkSelfPermission( +// this, +// Manifest.permission.ACCESS_FINE_LOCATION +// ) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission( +// this, +// Manifest.permission.ACCESS_COARSE_LOCATION +// ) != PackageManager.PERMISSION_GRANTED) { +// +// return +// } +// } +// +// if (ActivityCompat.checkSelfPermission( +// this, +// Manifest.permission.ACCESS_FINE_LOCATION +// ) != PackageManager.PERMISSION_GRANTED) { +// ActivityCompat.requestPermissions(this, +// arrayOf( +// Manifest.permission.ACCESS_FINE_LOCATION +// ), +// 2 +// ) +// } +// +// fusedLocationClient.lastLocation +// .addOnSuccessListener { location: Location? -> +// locationViewModel.setLoc(location?.latitude, location?.longitude) +// } + } + + private fun observeLocation(loc: Pair<Double?, Double?>) { +// val (lat, lng) = loc +// savedLat = lat +// savedLng = lng +// +// if (lat != null && lng != null) { +// binding.locationText.text = loc.toString() +// } else { +// binding.locationText.text = getString(R.string.no_location_data) +// } + } + + // Header back button + private fun onBackClick(view: View) { +// requireActivity().onBackPressed() + } + + private fun onSubmitClick(view: View){ +// val title = binding.titleInput.text.toString() +// val category = binding.categoryInput.selectedItem.toString() +// val amount = binding.amountInput.text.toString() +// +// if (title.isEmpty()){ +// Toast.makeText(requireContext(), getString(R.string.transaction_add_toast_error_title), Toast.LENGTH_SHORT).show() +// } +// else if (amount.isEmpty()){ +// Toast.makeText(requireContext(), getString(R.string.transaction_add_toast_error_amount), Toast.LENGTH_SHORT).show() +// } +// else{ +// when (actionCode){ +// ACTION_ADD -> { +// transactionViewModel.insert( +// TransactionEntity( +// id = 0, +// title = title, +// category = category, +// amount = amount.toInt(), +// timestamp = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()).format( +// Date() +// ), +// latitude = savedLat, +// longitude = savedLng +// ) +// ) +// Toast.makeText(requireContext(), getString(R.string.transaction_add_toast_success), Toast.LENGTH_SHORT).show() +// } +// +// ACTION_EDIT -> { +// transactionViewModel.update( +// TransactionEntity( +// id = intent.getIntExtra(KEY_TRANSACTION_ID, 0), +// title = title, +// category = category, +// amount = amount.toInt(), +// timestamp = intent.getStringExtra(KEY_TIMESTAMP)!!, +// latitude = savedLat, +// longitude = savedLng +// ) +// ) +// Toast.makeText(requireContext(), getString(R.string.transaction_edit_toast_success), Toast.LENGTH_SHORT).show() +// } +// } +// onBackPressed() +// } + } + + companion object{ + const val KEY_TITLE = "Title" + const val KEY_AMOUNT = "Amount" + const val KEY_CATEGORY = "Category" + const val KEY_LOCATION = "Location" + + const val KEY_ACTION = "Action" + const val KEY_TRANSACTION_ID = "TransactionId" + const val KEY_TIMESTAMP = "Timestamp" + + const val ACTION_ADD = 0 + const val ACTION_EDIT = 1 + + const val CATEGORY_INCOME = 0 + const val CATEGORY_EXPENSES = 1 + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/bondoman/ui/hub/transaction/TransactionFragment.kt b/app/src/main/java/com/example/bondoman/ui/hub/transaction/TransactionFragment.kt index 860e0025e60c6081c3b6568e2d59ac4691b50d4b..2c9161df14e2397bc64b056623bc80f612ada5ea 100644 --- a/app/src/main/java/com/example/bondoman/ui/hub/transaction/TransactionFragment.kt +++ b/app/src/main/java/com/example/bondoman/ui/hub/transaction/TransactionFragment.kt @@ -10,13 +10,18 @@ import androidx.fragment.app.Fragment import androidx.lifecycle.lifecycleScope import androidx.recyclerview.widget.LinearLayoutManager import com.example.bondoman.R +import com.example.bondoman.databinding.ActivityHubBinding +import com.example.bondoman.databinding.ActivityHubLandscapeBinding import com.example.bondoman.databinding.FragmentTransactionBinding import com.example.bondoman.ui.hub.HubActivity +import com.example.bondoman.ui.hub.addtransaction.AddTransactionFragment import com.example.bondoman.ui.transaction.TransactionActivity import com.example.bondoman.viewmodel.transaction.TransactionViewModel class TransactionFragment : Fragment(){ private lateinit var binding: FragmentTransactionBinding + private lateinit var activityPortraitBinding: ActivityHubBinding + private lateinit var activityLandscapeBinding: ActivityHubLandscapeBinding private lateinit var tsViewModel: TransactionViewModel override fun onCreateView( @@ -36,7 +41,7 @@ class TransactionFragment : Fragment(){ tsViewModel = (requireActivity() as HubActivity).transactionViewModel viewLifecycleOwner.lifecycleScope.launchWhenStarted { - val header = requireActivity().findViewById<TextView>(R.id.nav_title) + val header = (requireActivity() as HubActivity).findViewById<TextView>(R.id.nav_title) header.text = getString(R.string.hub_nav_transaction) } @@ -46,8 +51,16 @@ class TransactionFragment : Fragment(){ } } +// private fun onAddClick(view: View){ +// val intent = Intent(requireContext(), TransactionActivity::class.java) +// startActivity(intent) +// } + private fun onAddClick(view: View){ - val intent = Intent(requireContext(), TransactionActivity::class.java) - startActivity(intent) + val transaction = requireActivity().supportFragmentManager.beginTransaction() + val fragment = AddTransactionFragment() + transaction.replace(R.id.nav_host_fragment_activity_main, fragment) + transaction.addToBackStack(null) + transaction.commit() } } \ No newline at end of file diff --git a/app/src/main/res/layout/activity_hub.xml b/app/src/main/res/layout/activity_hub.xml index 3b97449bd165b4aaf7d94803b087ae73a25575b8..0fdc1afb812c3cf721a7ca6a92473c865367dc8c 100644 --- a/app/src/main/res/layout/activity_hub.xml +++ b/app/src/main/res/layout/activity_hub.xml @@ -10,7 +10,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" + app:layout_constraintStart_toEndOf="@id/nav_view_landscape" app:layout_constraintTop_toTopOf="parent"> <include @@ -30,6 +30,17 @@ app:layout_constraintRight_toRightOf="parent" app:menu="@menu/menu_hub_bottom_nav" /> + <com.google.android.material.navigation.NavigationView + android:id="@+id/nav_view_landscape" + android:layout_width="70dp" + android:layout_height="match_parent" + android:background="?android:attr/windowBackground" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:menu="@menu/menu_hub_bottom_nav" + /> + <fragment android:id="@+id/nav_host_fragment_activity_main" android:name="androidx.navigation.fragment.NavHostFragment" @@ -37,7 +48,7 @@ android:layout_height="0dp" app:defaultNavHost="true" app:layout_constraintBottom_toTopOf="@id/nav_view" - app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintLeft_toRightOf="@id/nav_view_landscape" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toBottomOf="@+id/header" app:navGraph="@navigation/hub_navigation" /> diff --git a/app/src/main/res/layout/fragment_add_transaction.xml b/app/src/main/res/layout/fragment_add_transaction.xml new file mode 100644 index 0000000000000000000000000000000000000000..792fee7ccf17ac7b099680d74475fa331e479f8f --- /dev/null +++ b/app/src/main/res/layout/fragment_add_transaction.xml @@ -0,0 +1,151 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout + xmlns:app="http://schemas.android.com/apk/res-auto" + 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:background="?attr/background"> + + <ScrollView + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintTop_toTopOf="parent"> + + <LinearLayout + android:id="@+id/login_cluster" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginHorizontal="30dp" + android:layout_marginTop="20dp" + android:orientation="vertical"> + + <TextView + android:id="@+id/title_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/transaction_label_title" + android:textColor="?android:textColorPrimary" + android:textSize="10pt" /> + + <EditText + android:id="@+id/title_input" + android:layout_width="match_parent" + android:layout_height="16pt" + android:background="@color/gray" + android:ems="10" + android:inputType="text" + android:paddingHorizontal="10sp" + android:textColor="@color/black" /> + + <TextView + android:id="@+id/amount_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="5pt" + android:text="@string/transaction_label_amount" + android:textColor="?android:textColorPrimary" + android:textSize="10pt" /> + + <EditText + android:id="@+id/amount_input" + android:layout_width="match_parent" + android:layout_height="16pt" + android:background="@color/gray" + android:ems="10" + android:inputType="numberDecimal" + android:paddingHorizontal="10sp" + android:textColor="@color/black" /> + + <TextView + android:id="@+id/category_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="5pt" + android:text="@string/transaction_label_category" + android:textColor="?android:textColorPrimary" + android:textSize="10pt" /> + + <Spinner + android:id="@+id/category_input" + android:layout_width="match_parent" + android:layout_height="16pt" + android:background="@color/gray" + android:entries="@array/category_choices" /> + + <TextView + android:id="@+id/location_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="5pt" + android:text="@string/transaction_label_location" + android:textColor="?android:textColorPrimary" + android:textSize="10pt" /> + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <TextView + android:id="@+id/location_text" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:paddingHorizontal="0dp" + android:text="@string/no_location_data" + android:textColor="@color/black" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@+id/btnLocate" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <ImageButton + android:id="@+id/btnLocate" + android:layout_width="48dp" + android:layout_height="40dp" + android:adjustViewBounds="true" + android:backgroundTint="@color/purple_500" + android:contentDescription="@string/get_latest_location" + android:paddingHorizontal="5dp" + android:paddingVertical="10dp" + android:scaleType="centerInside" + app:layout_constraintBottom_toBottomOf="@+id/location_text" + app:layout_constraintEnd_toStartOf="@+id/btnDelete" + app:layout_constraintTop_toTopOf="@+id/location_text" + app:srcCompat="@drawable/ic_hub_location" + app:tint="@color/white" /> + + <ImageButton + android:id="@+id/btnDelete" + android:layout_width="48dp" + android:layout_height="40dp" + android:adjustViewBounds="true" + android:backgroundTint="@color/red" + android:contentDescription="@string/delete_location" + android:paddingHorizontal="5dp" + android:paddingVertical="10dp" + android:scaleType="centerInside" + app:layout_constraintBottom_toBottomOf="@+id/btnLocate" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="@+id/btnLocate" + app:srcCompat="@drawable/ic_trash" + app:tint="@color/white" /> + + </androidx.constraintlayout.widget.ConstraintLayout> + + <Button + android:id="@+id/submit_button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:layout_marginTop="10pt" + android:layout_marginBottom="60dp" + android:text="@string/transaction_label_submit" /> + + </LinearLayout> + + </ScrollView> + +</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_scan.xml b/app/src/main/res/layout/fragment_scan.xml index 4d56e0d9535751fae3b7e28577aae031c85a812f..b41fe01cf251c62d6cfa3ac9888b78ef2fc503ff 100644 --- a/app/src/main/res/layout/fragment_scan.xml +++ b/app/src/main/res/layout/fragment_scan.xml @@ -4,7 +4,8 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".ui.hub.scan.ScanFragment"> + tools:context=".ui.hub.scan.ScanFragment" + android:background="?attr/background"> <androidx.camera.view.PreviewView android:id="@+id/viewFinder" diff --git a/app/src/main/res/layout/fragment_settings.xml b/app/src/main/res/layout/fragment_settings.xml index 76c0fba574571cf1cf6bce1811063c147be50790..774eef39214c96bcccc8343c89444e9e0c84b6c0 100644 --- a/app/src/main/res/layout/fragment_settings.xml +++ b/app/src/main/res/layout/fragment_settings.xml @@ -4,7 +4,8 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".ui.hub.settings.SettingsFragment"> + tools:context=".ui.hub.settings.SettingsFragment" + android:background="?attr/background"> <com.google.android.material.button.MaterialButton android:id="@+id/button_save_transaction" diff --git a/app/src/main/res/layout/fragment_stats.xml b/app/src/main/res/layout/fragment_stats.xml index 01af542cc2023f0eb2386abb72a8289336949223..f712137eaf2a542aaf9823b7a4cd1b546c6e1c50 100644 --- a/app/src/main/res/layout/fragment_stats.xml +++ b/app/src/main/res/layout/fragment_stats.xml @@ -4,7 +4,8 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".ui.hub.stats.StatsFragment"> + tools:context=".ui.hub.stats.StatsFragment" + android:background="?attr/background"> <com.github.mikephil.charting.charts.PieChart android:id="@+id/pieChart" diff --git a/app/src/main/res/layout/fragment_transaction.xml b/app/src/main/res/layout/fragment_transaction.xml index a82a41380a0dd8756bfd533d41f984f6fe854cc9..3cd0bc831ccb8bb3cf820dcc537bf8513763c835 100644 --- a/app/src/main/res/layout/fragment_transaction.xml +++ b/app/src/main/res/layout/fragment_transaction.xml @@ -4,7 +4,8 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".ui.hub.transaction.TransactionFragment"> + tools:context=".ui.hub.transaction.TransactionFragment" + android:background="?attr/background"> <com.google.android.material.floatingactionbutton.FloatingActionButton android:id="@+id/add_transaction" diff --git a/app/src/main/res/layout/fragment_twibbon.xml b/app/src/main/res/layout/fragment_twibbon.xml index 92b5b90663d4e37a556dace740c07ce502e9ef11..dc1071a5cf06f035fcc7a10292298563fc690683 100644 --- a/app/src/main/res/layout/fragment_twibbon.xml +++ b/app/src/main/res/layout/fragment_twibbon.xml @@ -4,7 +4,8 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".ui.hub.twibbon.TwibbonFragment"> + tools:context=".ui.hub.twibbon.TwibbonFragment" + android:background="?attr/background"> <androidx.camera.view.PreviewView android:id="@+id/viewFinder" diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index a1c01f4a6eea8189e2f65ff7e3c4de8750814fca..38874c82718cc9edef41c7f3efc2f2360a8f5153 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -1,6 +1,6 @@ <resources xmlns:tools="http://schemas.android.com/tools"> <!-- Base application theme. --> - <style name="Theme.BondoMan" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> + <style name="Theme.BondoMan" parent="Theme.MaterialComponents.DayNight.NoActionBar"> <!-- Primary brand color. --> <item name="colorPrimary">@color/purple_200</item> <item name="colorPrimaryVariant">@color/purple_700</item> @@ -12,5 +12,6 @@ <!-- Status bar color. --> <item name="android:statusBarColor">?attr/colorPrimaryVariant</item> <!-- Customize your theme here. --> + <item name="background">@color/black</item> </style> </resources> \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 53c454ef290773897ca1ff0bc6e0de1c9400b71c..e25d3b98bc0198973ba5689df186f4cbbf8d78fb 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -12,5 +12,6 @@ <!-- Status bar color. --> <item name="android:statusBarColor">?attr/colorPrimaryVariant</item> <!-- Customize your theme here. --> + <item name="background">@color/white</item> </style> </resources> \ No newline at end of file