|
|
|
|
@ -9,10 +9,10 @@ import androidx.constraintlayout.widget.ConstraintLayout |
|
|
|
|
import androidx.recyclerview.widget.RecyclerView |
|
|
|
|
import kotlinx.android.synthetic.main.row_bottom_sheet_grid_title.view.* |
|
|
|
|
import kotlinx.android.synthetic.main.row_bottom_sheet_title.view.* |
|
|
|
|
import kotlinx.android.synthetic.main.row_header_title.view.* |
|
|
|
|
import kotlinx.android.synthetic.main.row_header_title_amount.view.* |
|
|
|
|
import kotlinx.android.synthetic.main.row_header_title_value.view.* |
|
|
|
|
import kotlinx.android.synthetic.main.row_history_session.view.* |
|
|
|
|
import kotlinx.android.synthetic.main.row_history_session_header.view.* |
|
|
|
|
import kotlinx.android.synthetic.main.row_stats_title_value.view.* |
|
|
|
|
import kotlinx.android.synthetic.main.row_title.view.* |
|
|
|
|
import kotlinx.android.synthetic.main.row_title_switch.view.* |
|
|
|
|
@ -29,19 +29,16 @@ import net.pokeranalytics.android.ui.view.rowrepresentable.HeaderRowRepresentabl |
|
|
|
|
* An interface used to factor the configuration of RecyclerView.ViewHolder |
|
|
|
|
*/ |
|
|
|
|
interface BindableHolder { |
|
|
|
|
|
|
|
|
|
fun bind(position: Int, row: RowRepresentable, adapter: RowRepresentableAdapter) { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum class RowViewType { |
|
|
|
|
HEADER, |
|
|
|
|
HEADER_TITLE_VALUE, |
|
|
|
|
HEADER_TITLE_AMOUNT, |
|
|
|
|
HEADER_TITLE_AMOUNT_BIG, |
|
|
|
|
HEADER_SESSION, |
|
|
|
|
HEADER_TITLE, |
|
|
|
|
EDIT_TEXT, |
|
|
|
|
TITLE, |
|
|
|
|
TITLE_ARROW, |
|
|
|
|
@ -138,10 +135,10 @@ enum class RowViewType { |
|
|
|
|
false |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
HEADER_SESSION -> { |
|
|
|
|
HEADER_TITLE -> { |
|
|
|
|
HeaderSessionViewHolder( |
|
|
|
|
LayoutInflater.from(parent.context).inflate( |
|
|
|
|
R.layout.row_history_session_header, |
|
|
|
|
R.layout.row_header_title, |
|
|
|
|
parent, |
|
|
|
|
false |
|
|
|
|
) |
|
|
|
|
@ -187,12 +184,12 @@ enum class RowViewType { |
|
|
|
|
BindableHolder { |
|
|
|
|
override fun bind(position: Int, row: RowRepresentable, adapter: RowRepresentableAdapter) { |
|
|
|
|
itemView.rowHeaderTitleValue_title.text = row.localizedTitle(itemView.context) |
|
|
|
|
adapter.dataSource?.let { |
|
|
|
|
adapter.dataSource.let { |
|
|
|
|
itemView.rowHeaderTitleValue_value.text = it.stringForRow(row, itemView.context) |
|
|
|
|
} |
|
|
|
|
// val listener = View.OnClickListener { |
|
|
|
|
// adapter.delegate?.onRowSelected(position, row) |
|
|
|
|
// } |
|
|
|
|
//val listener = View.OnClickListener { |
|
|
|
|
// adapter.delegate?.onRowSelected(position, row) |
|
|
|
|
//} |
|
|
|
|
//itemView.rowHeaderTitleValue_container.setOnClickListener(listener) |
|
|
|
|
itemView.rowHeaderTitleValue_separator.visibility = if (row.needSeparator) View.VISIBLE else View.GONE |
|
|
|
|
} |
|
|
|
|
|