|
|
|
@ -20,6 +20,7 @@ import net.pokeranalytics.android.ui.extensions.setTextFormat |
|
|
|
import net.pokeranalytics.android.ui.view.rowrepresentable.CustomizableRowRepresentable |
|
|
|
import net.pokeranalytics.android.ui.view.rowrepresentable.CustomizableRowRepresentable |
|
|
|
import net.pokeranalytics.android.ui.view.rowrepresentable.StatDoubleRow |
|
|
|
import net.pokeranalytics.android.ui.view.rowrepresentable.StatDoubleRow |
|
|
|
import net.pokeranalytics.android.ui.view.rowrepresentable.StatRow |
|
|
|
import net.pokeranalytics.android.ui.view.rowrepresentable.StatRow |
|
|
|
|
|
|
|
import timber.log.Timber |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* An interface used to factor the configuration of RecyclerView.ViewHolder |
|
|
|
* An interface used to factor the configuration of RecyclerView.ViewHolder |
|
|
|
@ -262,15 +263,21 @@ enum class RowViewType(private var layoutRes: Int) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (row is StatDoubleRow) { |
|
|
|
if (row is StatDoubleRow) { |
|
|
|
|
|
|
|
Timber.d("${row}") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Timber.d("${row.computedStat1}") |
|
|
|
|
|
|
|
Timber.d("${row.computedStat2}") |
|
|
|
|
|
|
|
|
|
|
|
// Stat 1 |
|
|
|
// Stat 1 |
|
|
|
itemView.findViewById<AppCompatTextView?>(R.id.stat1Name)?.let { view -> |
|
|
|
itemView.findViewById<AppCompatTextView?>(R.id.stat1Name)?.let { view -> |
|
|
|
|
|
|
|
view.text = "" |
|
|
|
row.computedStat1?.stat?.resId?.let { |
|
|
|
row.computedStat1?.stat?.resId?.let { |
|
|
|
view.text = view.context.getString(it) |
|
|
|
view.text = view.context.getString(it) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
itemView.findViewById<AppCompatTextView?>(R.id.stat1Value)?.let { view -> |
|
|
|
itemView.findViewById<AppCompatTextView?>(R.id.stat1Value)?.let { view -> |
|
|
|
|
|
|
|
view.text = "" |
|
|
|
row.computedStat1?.format(view.context)?.let { |
|
|
|
row.computedStat1?.format(view.context)?.let { |
|
|
|
view.setTextFormat(it, itemView.context) |
|
|
|
view.setTextFormat(it, itemView.context) |
|
|
|
} |
|
|
|
} |
|
|
|
@ -278,12 +285,14 @@ enum class RowViewType(private var layoutRes: Int) { |
|
|
|
|
|
|
|
|
|
|
|
// Stat 2 |
|
|
|
// Stat 2 |
|
|
|
itemView.findViewById<AppCompatTextView?>(R.id.stat2Name)?.let { view -> |
|
|
|
itemView.findViewById<AppCompatTextView?>(R.id.stat2Name)?.let { view -> |
|
|
|
|
|
|
|
view.text = "" |
|
|
|
row.computedStat2?.stat?.resId?.let { |
|
|
|
row.computedStat2?.stat?.resId?.let { |
|
|
|
view.text = view.context.getString(it) |
|
|
|
view.text = view.context.getString(it) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
itemView.findViewById<AppCompatTextView?>(R.id.stat2Value)?.let { view -> |
|
|
|
itemView.findViewById<AppCompatTextView?>(R.id.stat2Value)?.let { view -> |
|
|
|
|
|
|
|
view.text = "" |
|
|
|
row.computedStat2?.format(view.context)?.let { |
|
|
|
row.computedStat2?.format(view.context)?.let { |
|
|
|
view.setTextFormat(it, itemView.context) |
|
|
|
view.setTextFormat(it, itemView.context) |
|
|
|
} |
|
|
|
} |
|
|
|
|