Remove card layout hint for the board

hh
Laurent 6 years ago
parent efda21b684
commit 3f24ebdeed
  1. 13
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt

@ -11,7 +11,6 @@ import android.widget.EditText
import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.view.isEmpty
import androidx.core.view.size
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.chip.Chip
@ -23,8 +22,8 @@ import kotlinx.android.synthetic.main.row_hhsettings_player_setup.view.*
import kotlinx.android.synthetic.main.row_hhsettings_player_setup.view.position_button
import kotlinx.android.synthetic.main.row_hhsettings_player_setup.view.ps_hand_layout
import kotlinx.android.synthetic.main.row_hhsettings_player_setup_read.view.*
import kotlinx.android.synthetic.main.row_recycler.view.*
import kotlinx.android.synthetic.main.row_hhsettings_straddle.view.*
import kotlinx.android.synthetic.main.row_recycler.view.*
import net.pokeranalytics.android.R
import net.pokeranalytics.android.exceptions.PAIllegalStateException
import net.pokeranalytics.android.model.handhistory.Position
@ -287,7 +286,7 @@ class HandHistoryAdapter(
}
protected fun configureCardsLayout(layout: LinearLayout) {
protected fun configureCardsLayout(layout: LinearLayout, isBoard: Boolean) {
layout.removeAllViews()
val inflater = LayoutInflater.from(itemView.context)
@ -304,7 +303,7 @@ class HandHistoryAdapter(
layout.addView(cardView)
}
if (layout.isEmpty()) {
if (layout.isEmpty() && !isBoard) {
val hintView = TextView(itemView.context)
hintView.text = itemView.context.getString(R.string.hand)
layout.addView(hintView)
@ -486,7 +485,7 @@ class HandHistoryAdapter(
val streetCardsRow = row as StreetCardsRow
itemView.cardsLayout.tag = streetCardsRow.street.ordinal
configureCardsLayout(itemView.cardsLayout)
configureCardsLayout(itemView.cardsLayout, true)
}
}
@ -511,7 +510,7 @@ class HandHistoryAdapter(
positionButton.text = playerCardView.position.value
}
configureCardsLayout(itemView.handLayout)
configureCardsLayout(itemView.handLayout, false)
}
}
@ -533,7 +532,7 @@ class HandHistoryAdapter(
val positionSelected = adapter.dataSource.isSelected(position, row, PlayerSetupRow.Tag.POSITION.ordinal)
itemView.position_button.backgroundTintList = ColorStateList.valueOf(color(positionSelected))
configureCardsLayout(itemView.ps_hand_layout)
configureCardsLayout(itemView.ps_hand_layout, false)
}

Loading…
Cancel
Save