|
|
|
|
@ -3,6 +3,8 @@ package net.pokeranalytics.android.ui.view |
|
|
|
|
import android.view.LayoutInflater |
|
|
|
|
import android.view.View |
|
|
|
|
import android.view.ViewGroup |
|
|
|
|
import androidx.appcompat.widget.AppCompatTextView |
|
|
|
|
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.* |
|
|
|
|
@ -48,6 +50,7 @@ enum class RowViewType { |
|
|
|
|
BOTTOM_SHEET_DATA, |
|
|
|
|
TITLE_GRID, |
|
|
|
|
ROW_SESSION, |
|
|
|
|
BUTTON, |
|
|
|
|
STAT; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -141,6 +144,15 @@ enum class RowViewType { |
|
|
|
|
false |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
BUTTON -> { |
|
|
|
|
ButtonViewHolder( |
|
|
|
|
LayoutInflater.from(parent.context).inflate( |
|
|
|
|
R.layout.row_button, |
|
|
|
|
parent, |
|
|
|
|
false |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
STAT -> StatsTitleValueViewHolder( |
|
|
|
|
LayoutInflater.from(parent.context).inflate( |
|
|
|
|
R.layout.row_stats_title_value, |
|
|
|
|
@ -307,6 +319,16 @@ enum class RowViewType { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
inner class ButtonViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView), |
|
|
|
|
BindableHolder { |
|
|
|
|
override fun bind(position: Int, row: RowRepresentable, adapter: RowRepresentableAdapter) { |
|
|
|
|
itemView.findViewById<AppCompatTextView>(R.id.title).text = row.localizedTitle(itemView.context) |
|
|
|
|
val listener = View.OnClickListener { |
|
|
|
|
adapter.delegate?.onRowSelected(position, row) |
|
|
|
|
} |
|
|
|
|
itemView.findViewById<ConstraintLayout>(R.id.container).setOnClickListener(listener) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
inner class HeaderSessionViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView), |
|
|
|
|
BindableHolder { |
|
|
|
|
@ -330,6 +352,4 @@ enum class RowViewType { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |