Added a dialog to explain what merchants and tellers are, which is opened in from the About option in the Merchants & Tellers's popup menu.

This commit is contained in:
Severiano Jaramillo 2019-01-26 16:25:59 -06:00
parent 227a52d032
commit 8aab7c03ac
4 changed files with 47 additions and 4 deletions

View file

@ -21,6 +21,7 @@ import androidx.core.content.ContextCompat
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProviders
import com.afollestad.materialdialogs.MaterialDialog
import com.afollestad.materialdialogs.customview.customView
import com.google.android.gms.maps.CameraUpdateFactory
import com.google.android.gms.maps.model.*
import com.google.maps.android.MarkerManager
@ -69,7 +70,7 @@ class MerchantsFragment : Fragment(), OnMapReadyCallback {
private var merchants = ArrayList<Merchant>()
private var tellers = ArrayList<Teller>()
private var showMerchantsMarkers = true
private var showTellerMarkers = false
private var showTellerMarkers = true
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
setHasOptionsMenu(true)
@ -116,9 +117,10 @@ class MerchantsFragment : Fragment(), OnMapReadyCallback {
val tvAbout = popupView?.findViewById<TextView>(R.id.tvAbout)
tvAbout?.setOnClickListener {
val context = context ?: return@setOnClickListener
MaterialDialog(context)
.message(text = "Anything")
.show()
MaterialDialog(context).show {
customView(R.layout.dialog_merchants_tellers_info, scrollable = true)
positiveButton(android.R.string.ok) { dismiss() }
}
}
mPopupWindow = PopupWindow(popupView, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)

View file

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:layout_marginEnd="@dimen/activity_horizontal_margin">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/title_merchants"
android:textAppearance="@style/TextAppearance.Bitsy.Body1"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="@string/msg__merchants_description"
android:textAppearance="@style/TextAppearance.Bitsy.Body2"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_same_topic"
android:text="@string/title_tellers"
android:textAppearance="@style/TextAppearance.Bitsy.Body1"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="@string/msg__tellers_description"
android:textAppearance="@style/TextAppearance.Bitsy.Body2"/>
</LinearLayout>

View file

@ -62,6 +62,8 @@
<string name="title_merchants">Comerciantes</string>
<string name="title_tellers">Tellers</string>
<string name="title_about">Acerca de</string>
<string name="msg__merchants_description">Los comerciantes PalmPay son la columna vertebral de la nueva economía Cripto. Si estás buscando por negocios que acepten Criptomonedas, entonces sólo usa la función de búsqueda o el mapa de abajo. Más comerciantes serán agregados aquí conforme los Embajadores PalmPay nos informen.</string>
<string name="msg__tellers_description">Los Tellers son personas que intercambian tu dinero en moneda fiduciaria a criptomonedas, y viceversa. Ellos también apoyan a los Comerciantes a cambiar sus Criptomonedas a moneda fiduciaria.</string>
<string name="msg__location_permission_necessary">El permiso de localización es necesario para mostrar tu ubicación actual en el mapa.</string>
<!-- Send Transaction -->

View file

@ -62,6 +62,8 @@
<string name="title_merchants">Merchants</string>
<string name="title_tellers">Tellers</string>
<string name="title_about">About</string>
<string name="msg__merchants_description">PalmPay merchants are the backbone of the new Crypto Economy. If you are looking for businesses that will accept your Cryptocurrency, then just use the Search and Map data below. More merchants will be added here as the PalmPay Ambassadors inform us.</string>
<string name="msg__tellers_description">Tellers are people who will exchange your fiat currencies with cryptocurrencies, and vice versa. They also assist Merchants with fiat settlement.</string>
<string name="msg__location_permission_necessary">Location permission is necessary to show your current location on the map.</string>
<!-- Send Transaction -->