From 39ad3cca015f0066d9687ecbaf10b59ebd673ce6 Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Thu, 3 Jan 2019 16:36:20 -0600 Subject: [PATCH] Changed the colorSend and colorReceive colors and added their respective darker versions. Changed the toolbar and status bar color in both the Send and Receive Transaction Fragment to colorSend and colorReceive with their darker variants accordingly. --- .../bitsybitshareswallet/fragments/HomeFragment.kt | 8 +++++++- .../fragments/ReceiveTransactionFragment.kt | 9 +++++++++ .../fragments/SendTransactionFragment.kt | 9 +++++++++ app/src/main/res/values/colors.xml | 7 +++++-- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/HomeFragment.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/HomeFragment.kt index a531972..9cf3fea 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/HomeFragment.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/HomeFragment.kt @@ -3,9 +3,9 @@ package cy.agorise.bitsybitshareswallet.fragments import androidx.lifecycle.ViewModelProviders import android.os.Bundle import android.preference.PreferenceManager -import android.util.Log import android.view.* import androidx.appcompat.widget.Toolbar +import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentPagerAdapter @@ -29,8 +29,14 @@ class HomeFragment : Fragment() { ): View? { setHasOptionsMenu(true) + // Sets the toolbar background color to primaryColor and forces shows the Bitsy icon to the left val toolbar: Toolbar? = activity?.findViewById(R.id.toolbar) toolbar?.navigationIcon = resources.getDrawable(R.drawable.ic_bitsy_logo_2, null) + toolbar?.setBackgroundResource(R.color.colorPrimary) + + // Sets the status bar background color to a primaryColorDark + val window = activity?.window + window?.statusBarColor = ContextCompat.getColor(context!!, R.color.colorPrimaryDark) return inflater.inflate(R.layout.fragment_home, container, false) } diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/ReceiveTransactionFragment.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/ReceiveTransactionFragment.kt index 624ae61..b8a470b 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/ReceiveTransactionFragment.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/ReceiveTransactionFragment.kt @@ -15,6 +15,7 @@ import android.util.Log import android.view.* import android.widget.AdapterView import android.widget.Toast +import androidx.appcompat.widget.Toolbar import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment import androidx.lifecycle.Observer @@ -94,6 +95,14 @@ class ReceiveTransactionFragment : Fragment(), ServiceConnection { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { setHasOptionsMenu(true) + // Sets the toolbar background color to green + val toolbar: Toolbar? = activity?.findViewById(R.id.toolbar) + toolbar?.setBackgroundResource(R.color.colorReceive) + + // Sets the status bar background color to a dark green + val window = activity?.window + window?.statusBarColor = ContextCompat.getColor(context!!, R.color.colorReceiveDark) + return inflater.inflate(R.layout.fragment_receive_transaction, container, false) } diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/SendTransactionFragment.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/SendTransactionFragment.kt index bf402da..231faf9 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/SendTransactionFragment.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/SendTransactionFragment.kt @@ -13,6 +13,7 @@ import android.util.Log import android.view.* import android.widget.AdapterView import android.widget.Toast +import androidx.appcompat.widget.Toolbar import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment import androidx.lifecycle.Observer @@ -110,6 +111,14 @@ class SendTransactionFragment : Fragment(), ZXingScannerView.ResultHandler, Serv override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { setHasOptionsMenu(true) + // Sets the toolbar background color to red + val toolbar: Toolbar? = activity?.findViewById(R.id.toolbar) + toolbar?.setBackgroundResource(R.color.colorSend) + + // Sets the status bar background color to a dark red + val window = activity?.window + window?.statusBarColor = ContextCompat.getColor(context!!, R.color.colorSendDark) + return inflater.inflate(R.layout.fragment_send_transaction, container, false) } diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index cb1f062..e44bbef 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -13,7 +13,10 @@ #aaa #d0d0d0 #616161 - #669900 - #DC473A + #388E3C + #1B5E20 + #D32F2F + #B71C1C + #F44336 #2888