|
|
|
@ -9,13 +9,13 @@ import kotlinx.android.synthetic.main.bottom_sheet_game.* |
|
|
|
import kotlinx.android.synthetic.main.fragment_bottom_sheet.view.* |
|
|
|
import kotlinx.android.synthetic.main.fragment_bottom_sheet.view.* |
|
|
|
import net.pokeranalytics.android.R |
|
|
|
import net.pokeranalytics.android.R |
|
|
|
import net.pokeranalytics.android.model.realm.Game |
|
|
|
import net.pokeranalytics.android.model.realm.Game |
|
|
|
import net.pokeranalytics.android.ui.adapter.components.DynamicListAdapter |
|
|
|
import net.pokeranalytics.android.ui.adapter.components.DataListAdapter |
|
|
|
import net.pokeranalytics.android.ui.adapter.components.DynamicRowDelegate |
|
|
|
import net.pokeranalytics.android.ui.adapter.components.DisplayableDataSource |
|
|
|
|
|
|
|
import net.pokeranalytics.android.ui.adapter.components.DisplayableDelegate |
|
|
|
import net.pokeranalytics.android.ui.adapter.components.DynamicRowInterface |
|
|
|
import net.pokeranalytics.android.ui.adapter.components.DynamicRowInterface |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class BottomSheetGameFragment : BottomSheetFragment(), DisplayableDelegate { |
|
|
|
class BottomSheetGameFragment : BottomSheetFragment(), DynamicRowDelegate { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private var game: Game = Game() |
|
|
|
private var game: Game = Game() |
|
|
|
|
|
|
|
|
|
|
|
@ -31,14 +31,18 @@ class BottomSheetGameFragment : BottomSheetFragment(), DynamicRowDelegate { |
|
|
|
dismiss() |
|
|
|
dismiss() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun adapterRows(): ArrayList<DynamicRowInterface> { |
|
|
|
override fun data(position: Int): DisplayableDataSource { |
|
|
|
val array = ArrayList<DynamicRowInterface>() |
|
|
|
return game |
|
|
|
array.add(TitleObject("Game 1")) |
|
|
|
} |
|
|
|
array.add(TitleObject("Game 2")) |
|
|
|
|
|
|
|
array.add(TitleObject("Game 3")) |
|
|
|
override fun onRowSelected(position: Int) { |
|
|
|
return array |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun size(): Int { |
|
|
|
|
|
|
|
return 1 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Init data |
|
|
|
* Init data |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@ -54,12 +58,12 @@ class BottomSheetGameFragment : BottomSheetFragment(), DynamicRowDelegate { |
|
|
|
LayoutInflater.from(requireContext()).inflate(R.layout.bottom_sheet_game, view?.bottomSheetContainer, true) |
|
|
|
LayoutInflater.from(requireContext()).inflate(R.layout.bottom_sheet_game, view?.bottomSheetContainer, true) |
|
|
|
|
|
|
|
|
|
|
|
val viewManager = LinearLayoutManager(requireContext()) |
|
|
|
val viewManager = LinearLayoutManager(requireContext()) |
|
|
|
val dataAdapter = DynamicListAdapter(this) |
|
|
|
val dataAdapter = DataListAdapter(this) |
|
|
|
|
|
|
|
|
|
|
|
gameNameRecyclerView.apply { |
|
|
|
gameNameRecyclerView.apply { |
|
|
|
setHasFixedSize(true) |
|
|
|
setHasFixedSize(true) |
|
|
|
layoutManager = viewManager |
|
|
|
layoutManager = viewManager |
|
|
|
//adapter = dataAdapter |
|
|
|
adapter = dataAdapter |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|