From 981a14723e406e2f098357dfc52b091113b895c4 Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Thu, 31 Jan 2019 15:42:36 -0600 Subject: [PATCH] In the MerchantsFragment's Map InfoWindows allow line wraps for both name and address and if a section has no data do not show a blank line but just hide it. --- .../fragments/MerchantsFragment.kt | 16 ++++++++-------- app/src/main/res/layout/marker_info_window.xml | 10 +++------- 2 files changed, 11 insertions(+), 15 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 5d31ee3..a5f5c58 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/MerchantsFragment.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/MerchantsFragment.kt @@ -519,23 +519,23 @@ class MerchantsFragment : Fragment(), OnMapReadyCallback, SearchView.OnSuggestio if (selectedMerchant != null) { tvName.text = selectedMerchant?.name - if (selectedMerchant?.address != null) + if (!selectedMerchant?.address.equals("")) tvAddress.text = selectedMerchant?.address else tvAddress.visibility = View.GONE - if (selectedMerchant?.phone != null) + if (!selectedMerchant?.phone.equals("")) tvPhone.text = selectedMerchant?.phone else tvPhone.visibility = View.GONE - if (selectedMerchant?.telegram != null) { + if (!selectedMerchant?.telegram.equals("")) { val telegram = "Telegram: ${selectedMerchant?.telegram}" tvTelegram.text = telegram } else tvTelegram.visibility = View.GONE - if (selectedMerchant?.website != null) + if (!selectedMerchant?.website.equals("")) tvWebsite.text = selectedMerchant?.website ?.removePrefix("http://")?.removePrefix("https://") else @@ -564,23 +564,23 @@ class MerchantsFragment : Fragment(), OnMapReadyCallback, SearchView.OnSuggestio if (selectedTeller != null) { tvName.text = selectedTeller?.gt_name - if (selectedTeller?.address != null) + if (!selectedTeller?.address.equals("")) tvAddress.text = selectedTeller?.address else tvAddress.visibility = View.GONE - if (selectedTeller?.phone != null) + if (!selectedTeller?.phone.equals("")) tvPhone.text = selectedTeller?.phone else tvPhone.visibility = View.GONE - if (selectedTeller?.telegram != null) { + if (!selectedTeller?.telegram.equals("")) { val telegram = "Telegram: ${selectedTeller?.telegram}" tvTelegram.text = telegram } else tvTelegram.visibility = View.GONE - if (selectedTeller?.url != null) + if (!selectedTeller?.url.equals("")) tvWebsite.text = selectedTeller?.url ?.removePrefix("http://")?.removePrefix("https://") else diff --git a/app/src/main/res/layout/marker_info_window.xml b/app/src/main/res/layout/marker_info_window.xml index 29afe3b..b344552 100644 --- a/app/src/main/res/layout/marker_info_window.xml +++ b/app/src/main/res/layout/marker_info_window.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:layout_width="match_parent" - android:layout_height="match_parent" + android:layout_height="wrap_content" android:padding="12dp" android:background="@drawable/marker_info_window_background"> @@ -13,18 +13,14 @@ android:layout_width="match_parent" android:layout_height="wrap_content" tools:text="Bambuddha Holistic Center" - android:textAppearance="@style/TextAppearance.Bitsy.Body1" - android:maxLines="1" - android:ellipsize="end"/> + android:textAppearance="@style/TextAppearance.Bitsy.Body1"/> + tools:text="Carretera, Barra Vieja Km 37, 39936 Acapulco, Gro."/>