feature/players
Aurelien Hubert 6 years ago
parent dff498ffa5
commit 071a39c241
  1. 4
      app/src/main/java/net/pokeranalytics/android/ui/extensions/UIExtensions.kt
  2. 13
      app/src/main/java/net/pokeranalytics/android/ui/fragment/data/CustomFieldDataFragment.kt
  3. 4
      app/src/main/java/net/pokeranalytics/android/ui/fragment/data/PlayerDataFragment.kt

@ -94,7 +94,7 @@ fun PokerAnalyticsActivity.openContactMail(subjectStringRes: Int, filePath: Stri
// Open custom tab // Open custom tab
fun PokerAnalyticsActivity.openUrl(url: String) { fun PokerAnalyticsActivity.openUrl(url: String) {
val builder: CustomTabsIntent.Builder = CustomTabsIntent.Builder() val builder: CustomTabsIntent.Builder = CustomTabsIntent.Builder()
builder.setToolbarColor(ContextCompat.getColor(this, net.pokeranalytics.android.R.color.colorPrimary)) builder.setToolbarColor(ContextCompat.getColor(this, R.color.colorPrimary))
val customTabsIntent = builder.build() val customTabsIntent = builder.build()
customTabsIntent.launchUrl(this, Uri.parse(url)) customTabsIntent.launchUrl(this, Uri.parse(url))
} }
@ -124,7 +124,7 @@ fun showAlertDialog(
message?.let { message?.let {
builder.setMessage(message) builder.setMessage(message)
} }
builder.setPositiveButton(net.pokeranalytics.android.R.string.ok) { _, _ -> builder.setPositiveButton(R.string.ok) { _, _ ->
positiveAction?.invoke() positiveAction?.invoke()
} }

@ -139,16 +139,6 @@ class CustomFieldDataFragment : EditableDataFragment(), StaticRowRepresentableDa
} }
} }
/*
override fun editDescriptors(row: RowRepresentable): ArrayList<RowEditableDescriptor>? {
return when (row) {
SimpleRow.NAME -> row.editingDescriptors(mapOf("defaultValue" to this.customField.name))
is CustomFieldEntry -> row.editingDescriptors(mapOf("defaultValue" to row.value))
else -> null
}
}
*/
override fun onRowSelected(position: Int, row: RowRepresentable, fromAction: Boolean) { override fun onRowSelected(position: Int, row: RowRepresentable, fromAction: Boolean) {
when (row) { when (row) {
is CustomFieldEntry -> row.startEditing(null, this) is CustomFieldEntry -> row.startEditing(null, this)
@ -251,7 +241,6 @@ class CustomFieldDataFragment : EditableDataFragment(), StaticRowRepresentableDa
} }
} }
/** /**
* Update UI * Update UI
*/ */
@ -269,9 +258,7 @@ class CustomFieldDataFragment : EditableDataFragment(), StaticRowRepresentableDa
override fun onDataSaved() { override fun onDataSaved() {
super.onDataSaved() super.onDataSaved()
this.customField.cleanupEntries() this.customField.cleanupEntries()
} }
} }

@ -168,6 +168,10 @@ class PlayerDataFragment : EditableDataFragment(), StaticRowRepresentableDataSou
* Open picture dialog * Open picture dialog
*/ */
private fun openPictureDialog() { private fun openPictureDialog() {
val builder = AlertDialog.Builder(requireContext()) val builder = AlertDialog.Builder(requireContext())
val placesArray = ArrayList<CharSequence>() val placesArray = ArrayList<CharSequence>()

Loading…
Cancel
Save