From 1505a5642c8aad5c958aa04e21d75fddf4d8ed73 Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Wed, 30 Jan 2019 11:15:07 -0600 Subject: [PATCH] In MerchantsFragment, change the popup window background to transparent to match the maps theme. Hide the MyLocation button while the popup is open to avoid it making it hard to see the switches in the popup menu. Color the popup menu's switches to use the same green and yellow color as their corresponding pon markers. Move the popup window down to remove the overlapping with the Toolbar. --- .../fragments/MerchantsFragment.kt | 15 ++++++++++----- .../drawable/popup_menu_merchants_background.xml | 2 +- .../main/res/layout/item_merchant_suggestion.xml | 2 +- app/src/main/res/layout/popup_menu_merchants.xml | 2 ++ app/src/main/res/values/colors.xml | 3 ++- app/src/main/res/values/styles.xml | 10 ++++++++++ 6 files changed, 26 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/MerchantsFragment.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/MerchantsFragment.kt index 11c5200..268faa8 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/MerchantsFragment.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/MerchantsFragment.kt @@ -300,10 +300,12 @@ class MerchantsFragment : Fragment(), OnMapReadyCallback, SearchView.OnSuggestio override fun onOptionsItemSelected(item: MenuItem?): Boolean { if (item?.itemId == R.id.menu_filter) { // Try to show or dismiss the custom popup window with the merchants and tellers switches - if (mPopupWindow?.isShowing == false) - mPopupWindow?.showAsDropDown(toolbar, screenWidth, -20) - else - mPopupWindow?.dismiss() + if (mPopupWindow?.isShowing == false) { + mPopupWindow?.showAsDropDown(toolbar, screenWidth, 8) + if (mMap.isMyLocationEnabled) + mMap.uiSettings?.isMyLocationButtonEnabled = false + } else + dismissPopupWindow() return true } return super.onOptionsItemSelected(item) @@ -580,8 +582,11 @@ class MerchantsFragment : Fragment(), OnMapReadyCallback, SearchView.OnSuggestio } private fun dismissPopupWindow() { - if (mPopupWindow?.isShowing == true) + if (mPopupWindow?.isShowing == true) { mPopupWindow?.dismiss() + if (mMap.isMyLocationEnabled) + mMap.uiSettings?.isMyLocationButtonEnabled = true + } } override fun onPause() { diff --git a/app/src/main/res/drawable/popup_menu_merchants_background.xml b/app/src/main/res/drawable/popup_menu_merchants_background.xml index 620897d..2fe9c79 100644 --- a/app/src/main/res/drawable/popup_menu_merchants_background.xml +++ b/app/src/main/res/drawable/popup_menu_merchants_background.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/app/src/main/res/layout/item_merchant_suggestion.xml b/app/src/main/res/layout/item_merchant_suggestion.xml index 2936f1c..f57a64a 100644 --- a/app/src/main/res/layout/item_merchant_suggestion.xml +++ b/app/src/main/res/layout/item_merchant_suggestion.xml @@ -7,7 +7,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="8dp" - android:background="?android:colorBackground"> + android:background="#0000"> #D32F2F #B71C1C #2888 - #338888aa + #3999 + #6999 diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index ecac5ae..f77e935 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -48,6 +48,16 @@ ?android:attr/colorPrimary + + + +