Improve merchants' marker info window layout. Added proper padding and nice rounded corners with a 1dp border to improve visibility.
This commit is contained in:
parent
69c27d3092
commit
2e07bc512f
4 changed files with 16 additions and 7 deletions
|
@ -210,7 +210,7 @@ class MerchantsFragment : Fragment(), OnMapReadyCallback {
|
||||||
|
|
||||||
override fun getInfoWindow(marker: Marker?): View {
|
override fun getInfoWindow(marker: Marker?): View {
|
||||||
val infoWindowLayout: View = LayoutInflater.from(context).inflate(
|
val infoWindowLayout: View = LayoutInflater.from(context).inflate(
|
||||||
R.layout.map_pin_info_dialog, null)
|
R.layout.marker_info_window, null)
|
||||||
val tvName = infoWindowLayout.findViewById<TextView>(R.id.tvName)
|
val tvName = infoWindowLayout.findViewById<TextView>(R.id.tvName)
|
||||||
val tvAddress = infoWindowLayout.findViewById<TextView>(R.id.tvAddress)
|
val tvAddress = infoWindowLayout.findViewById<TextView>(R.id.tvAddress)
|
||||||
val tvPhone = infoWindowLayout.findViewById<TextView>(R.id.tvPhone)
|
val tvPhone = infoWindowLayout.findViewById<TextView>(R.id.tvPhone)
|
||||||
|
@ -230,9 +230,10 @@ class MerchantsFragment : Fragment(), OnMapReadyCallback {
|
||||||
else
|
else
|
||||||
tvPhone.visibility = View.GONE
|
tvPhone.visibility = View.GONE
|
||||||
|
|
||||||
if (selectedMerchant?.telegram != null)
|
if (selectedMerchant?.telegram != null) {
|
||||||
tvTelegram.text = selectedMerchant?.telegram
|
val telegram = "Telegram: ${selectedMerchant?.telegram}"
|
||||||
else
|
tvTelegram.text = telegram
|
||||||
|
} else
|
||||||
tvTelegram.visibility = View.GONE
|
tvTelegram.visibility = View.GONE
|
||||||
|
|
||||||
if (selectedMerchant?.website != null)
|
if (selectedMerchant?.website != null)
|
||||||
|
|
|
@ -29,7 +29,7 @@ fun FloatingActionButton.disable(colorResource: Int) {
|
||||||
/**
|
/**
|
||||||
* Easily create a toast message with less boilerplate code
|
* Easily create a toast message with less boilerplate code
|
||||||
*/
|
*/
|
||||||
fun Context.toast(message: CharSequence, duration: Int = Toast.LENGTH_LONG) {
|
fun Context.toast(message: CharSequence, duration: Int = Toast.LENGTH_SHORT) {
|
||||||
Toast.makeText(this, message, duration).show()
|
Toast.makeText(this, message, duration).show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||||
|
<corners android:radius="10dp" />
|
||||||
|
<solid android:color="?android:colorBackground" />
|
||||||
|
<stroke
|
||||||
|
android:color="?android:textColorPrimary"
|
||||||
|
android:width="1dp"/>
|
||||||
|
</shape>
|
|
@ -5,8 +5,8 @@
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:padding="4dp"
|
android:padding="12dp"
|
||||||
android:background="?android:colorBackground">
|
android:background="@drawable/marker_info_window_background">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvName"
|
android:id="@+id/tvName"
|
Loading…
Reference in a new issue