|
|
|
@ -7,7 +7,6 @@ import android.view.ViewGroup |
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager |
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager |
|
|
|
import kotlinx.android.synthetic.main.fragment_stats.* |
|
|
|
import kotlinx.android.synthetic.main.fragment_stats.* |
|
|
|
import net.pokeranalytics.android.R |
|
|
|
import net.pokeranalytics.android.R |
|
|
|
import net.pokeranalytics.android.ui.view.rowrepresentable.MoreTabRow |
|
|
|
|
|
|
|
import net.pokeranalytics.android.ui.activity.BankrollActivity |
|
|
|
import net.pokeranalytics.android.ui.activity.BankrollActivity |
|
|
|
import net.pokeranalytics.android.ui.activity.SettingsActivity |
|
|
|
import net.pokeranalytics.android.ui.activity.SettingsActivity |
|
|
|
import net.pokeranalytics.android.ui.adapter.RowRepresentableAdapter |
|
|
|
import net.pokeranalytics.android.ui.adapter.RowRepresentableAdapter |
|
|
|
@ -15,6 +14,7 @@ import net.pokeranalytics.android.ui.adapter.RowRepresentableDelegate |
|
|
|
import net.pokeranalytics.android.ui.adapter.StaticRowRepresentableDataSource |
|
|
|
import net.pokeranalytics.android.ui.adapter.StaticRowRepresentableDataSource |
|
|
|
import net.pokeranalytics.android.ui.fragment.components.PokerAnalyticsFragment |
|
|
|
import net.pokeranalytics.android.ui.fragment.components.PokerAnalyticsFragment |
|
|
|
import net.pokeranalytics.android.ui.view.RowRepresentable |
|
|
|
import net.pokeranalytics.android.ui.view.RowRepresentable |
|
|
|
|
|
|
|
import net.pokeranalytics.android.ui.view.rowrepresentable.MoreTabRow |
|
|
|
|
|
|
|
|
|
|
|
class MoreFragment : PokerAnalyticsFragment(), StaticRowRepresentableDataSource, RowRepresentableDelegate { |
|
|
|
class MoreFragment : PokerAnalyticsFragment(), StaticRowRepresentableDataSource, RowRepresentableDelegate { |
|
|
|
|
|
|
|
|
|
|
|
@ -29,11 +29,16 @@ class MoreFragment : PokerAnalyticsFragment(), StaticRowRepresentableDataSource, |
|
|
|
fragment.arguments = bundle |
|
|
|
fragment.arguments = bundle |
|
|
|
return fragment |
|
|
|
return fragment |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val rowRepresentation: List<RowRepresentable> by lazy { |
|
|
|
|
|
|
|
val rows = ArrayList<RowRepresentable>() |
|
|
|
|
|
|
|
rows.addAll(MoreTabRow.values()) |
|
|
|
|
|
|
|
rows |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private lateinit var moreAdapter: RowRepresentableAdapter |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private var rowRepresentables: ArrayList<RowRepresentable> = ArrayList() |
|
|
|
private lateinit var moreAdapter: RowRepresentableAdapter |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Life Cycle |
|
|
|
// Life Cycle |
|
|
|
@ -50,7 +55,7 @@ class MoreFragment : PokerAnalyticsFragment(), StaticRowRepresentableDataSource, |
|
|
|
|
|
|
|
|
|
|
|
// Rows |
|
|
|
// Rows |
|
|
|
override fun adapterRows(): List<RowRepresentable>? { |
|
|
|
override fun adapterRows(): List<RowRepresentable>? { |
|
|
|
return rowRepresentables |
|
|
|
return rowRepresentation |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onRowSelected(position: Int, row: RowRepresentable, fromAction: Boolean) { |
|
|
|
override fun onRowSelected(position: Int, row: RowRepresentable, fromAction: Boolean) { |
|
|
|
@ -67,8 +72,6 @@ class MoreFragment : PokerAnalyticsFragment(), StaticRowRepresentableDataSource, |
|
|
|
* Init data |
|
|
|
* Init data |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private fun initData() { |
|
|
|
private fun initData() { |
|
|
|
rowRepresentables.addAll(MoreTabRow.values()) |
|
|
|
|
|
|
|
moreAdapter = RowRepresentableAdapter(this, this) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
@ -76,6 +79,8 @@ class MoreFragment : PokerAnalyticsFragment(), StaticRowRepresentableDataSource, |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private fun initUI() { |
|
|
|
private fun initUI() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
moreAdapter = RowRepresentableAdapter(this, this) |
|
|
|
|
|
|
|
|
|
|
|
val viewManager = LinearLayoutManager(requireContext()) |
|
|
|
val viewManager = LinearLayoutManager(requireContext()) |
|
|
|
|
|
|
|
|
|
|
|
recyclerView.apply { |
|
|
|
recyclerView.apply { |
|
|
|
|