Completed the migration of the whole app to the new Material Components color theming.

master
Severiano Jaramillo 2019-03-20 11:04:05 -06:00
parent 313ff06861
commit 5d8dc8ec39
10 changed files with 23 additions and 28 deletions

View File

@ -40,7 +40,7 @@
<activity
android:name=".activities.MainActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.Bitsy.NoActionBar"
android:theme="@style/Theme.Bitsy"
android:windowSoftInputMode="adjustPan"/>
<!-- Used to share Images like the QR code and the eReceipt -->
<provider

View File

@ -32,7 +32,7 @@ class MainActivity : ConnectedActivity() {
// Sets the theme to night mode if it has been selected by the user
if (PreferenceManager.getDefaultSharedPreferences(this)
.getBoolean(Constants.KEY_NIGHT_MODE_ACTIVATED, false)) {
setTheme(R.style.Theme_Bitsy_Dark_NoActionBar)
setTheme(R.style.Theme_Bitsy_Dark)
}
setContentView(R.layout.activity_main)

View File

@ -54,7 +54,7 @@ class HomeFragment : Fragment() {
// Sets the status and navigation bars background color to a dark blue or just dark
context?.let { context ->
val statusBarColor = ContextCompat.getColor(context,
if (!nightMode) R.color.colorPrimaryDark else R.color.colorStatusBarDark)
if (!nightMode) R.color.colorPrimaryVariant else R.color.colorStatusBarDark)
window?.statusBarColor = statusBarColor
window?.navigationBarColor = statusBarColor
}

View File

@ -354,8 +354,8 @@ class SendTransactionFragment : ConnectedFragment(), ZXingScannerView.ResultHand
cameraPreview.setFormats(listOf(BarcodeFormat.QR_CODE))
cameraPreview.setAspectTolerance(0.5f)
cameraPreview.setAutoFocus(true)
cameraPreview.setLaserColor(R.color.colorAccent)
cameraPreview.setMaskColor(R.color.colorAccent)
cameraPreview.setLaserColor(R.color.colorSecondary)
cameraPreview.setMaskColor(R.color.colorSecondary)
cameraPreview.setResultHandler(this)
cameraPreview.startCamera()

View File

@ -6,6 +6,7 @@ import android.os.Bundle
import android.os.Message
import android.widget.DatePicker
import androidx.fragment.app.DialogFragment
import com.google.android.material.picker.MaterialDatePickerDialog
import cy.agorise.bitsybitshareswallet.fragments.FilterOptionsDialog
import java.util.*
@ -58,7 +59,7 @@ class DatePickerFragment : DialogFragment(), DatePickerDialog.OnDateSetListener
val day = calendar.get(Calendar.DAY_OF_MONTH)
// Create a new instance of DatePickerDialog and return it
val datePicker = DatePickerDialog(activity!!, this, year, month, day)
val datePicker = MaterialDatePickerDialog(activity!!, this, year, month, day)
// Set maximum date allowed to today
datePicker.datePicker.maxDate = maxTime

View File

@ -2,5 +2,5 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@android:color/transparent"/>
<corners android:radius="4dp"/>
<stroke android:color="@color/colorAccent" android:width="1dp"/>
<stroke android:color="@color/colorSecondary" android:width="1dp"/>
</shape>

View File

@ -48,6 +48,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_different_section"
android:layout_marginEnd="@dimen/spacing_different_section"
app:boxBackgroundColor="?android:colorBackground"
app:layout_constraintTop_toBottomOf="@id/tvSubTitle"
app:layout_constraintBottom_toBottomOf="parent">

View File

@ -31,6 +31,7 @@
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fabReceiveTransaction"
style="@style/Widget.MaterialComponents.FloatingActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:fabSize="auto"
@ -79,7 +80,6 @@
app:layout_constraintBottom_toTopOf="@+id/tvSendTransaction"
app:layout_constraintVertical_chainStyle="packed"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fabSendTransactionCamera"
android:layout_width="wrap_content"

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#0099d6</color>
<color name="colorPrimaryDark">#006ba4</color>
<color name="colorAccent">#0099d6</color>
<color name="colorPrimaryVariant">#006ba4</color>
<color name="colorSecondary">#0099d6</color>
<!-- Dark theme -->
<color name="colorBackgroundFloating">#424242</color>

View File

@ -1,43 +1,36 @@
<resources>
<!-- Base application light theme. -->
<style name="Theme.Bitsy" parent="Theme.MaterialComponents.Light.DarkActionBar.Bridge">
<style name="Theme.Bitsy" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorPrimaryVariant">@color/colorPrimaryVariant</item>
<item name="colorSecondary">@color/colorSecondary</item>
<item name="colorOnSecondary">#fff</item>
<!--Custom attributes -->
<item name="android:fontFamily">@font/p_f_beau_sans_pro</item>
<item name="themedColorBackgroundFloating">@android:color/white</item>
<item name="android:statusBarColor">@color/colorPrimaryDark</item>
<item name="android:navigationBarColor">@color/colorPrimaryDark</item>
</style>
<style name="Theme.Bitsy.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:statusBarColor">@color/colorPrimaryVariant</item>
<item name="android:navigationBarColor">@color/colorPrimaryVariant</item>
</style>
<style name="Theme.Bitsy.AppBarOverlay" parent="ThemeOverlay.MaterialComponents.Dark.ActionBar"/>
<!-- Base application dark theme. -->
<!-- Bridge is still used cause there is an issue with the Transactions' FilterOptionsDialog Calendar -->
<style name="Theme.Bitsy.Dark" parent="Theme.MaterialComponents.Bridge">
<style name="Theme.Bitsy.Dark" parent="Theme.MaterialComponents.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorPrimaryVariant">@color/colorPrimaryVariant</item>
<item name="colorSecondary">@color/colorSecondary</item>
<item name="colorOnSecondary">#fff</item>
<!--Custom attributes -->
<item name="android:fontFamily">@font/p_f_beau_sans_pro</item>
<item name="themedColorBackgroundFloating">@color/colorBackgroundFloating</item>
<item name="android:statusBarColor">@color/colorStatusBarDark</item>
<item name="android:navigationBarColor">@color/colorStatusBarDark</item>
</style>
<style name="Theme.Bitsy.Dark.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<!-- Custom widget styles -->
<style name="SplashTheme" parent="Theme.Bitsy.NoActionBar">
<style name="SplashTheme" parent="Theme.Bitsy">
<item name="android:windowBackground">@drawable/splash_screen</item>
</style>