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.
This commit is contained in:
parent
fbb66864e5
commit
981a14723e
2 changed files with 11 additions and 15 deletions
|
@ -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
|
||||
|
|
|
@ -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"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAddress"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
tools:text="Carretera, Barra Vieja Km 37, 39936 Acapulco, Gro."
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"/>
|
||||
tools:text="Carretera, Barra Vieja Km 37, 39936 Acapulco, Gro."/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPhone"
|
||||
|
|
Loading…
Reference in a new issue