|
|
|
@ -11,7 +11,6 @@ import com.google.android.material.bottomsheet.BottomSheetDialogFragment |
|
|
|
import kotlinx.android.synthetic.main.fragment_bottom_sheet.* |
|
|
|
import kotlinx.android.synthetic.main.fragment_bottom_sheet.* |
|
|
|
import net.pokeranalytics.android.R |
|
|
|
import net.pokeranalytics.android.R |
|
|
|
import net.pokeranalytics.android.ui.adapter.components.DynamicRowInterface |
|
|
|
import net.pokeranalytics.android.ui.adapter.components.DynamicRowInterface |
|
|
|
import net.pokeranalytics.android.ui.adapter.components.EditableDataDelegate |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum class BottomSheetType { |
|
|
|
enum class BottomSheetType { |
|
|
|
NONE, |
|
|
|
NONE, |
|
|
|
@ -29,15 +28,20 @@ interface BottomSheetInterface { |
|
|
|
fun clickOnAdd() |
|
|
|
fun clickOnAdd() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
interface BottomSheetDelegate { |
|
|
|
|
|
|
|
fun setValue(value: Any, row: DynamicRowInterface) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
open class BottomSheetFragment : BottomSheetDialogFragment(), BottomSheetInterface { |
|
|
|
open class BottomSheetFragment : BottomSheetDialogFragment(), BottomSheetInterface { |
|
|
|
|
|
|
|
|
|
|
|
lateinit var row: DynamicRowInterface |
|
|
|
lateinit var row: DynamicRowInterface |
|
|
|
lateinit var valueDelegate: EditableDataDelegate |
|
|
|
lateinit var valueDelegate: BottomSheetDelegate |
|
|
|
|
|
|
|
|
|
|
|
private var data: Any? = null |
|
|
|
private var data: Any? = null |
|
|
|
|
|
|
|
|
|
|
|
companion object { |
|
|
|
companion object { |
|
|
|
fun create( fragmentManager: FragmentManager?, row: DynamicRowInterface, valueDelegate: EditableDataDelegate, data: Any?): BottomSheetFragment { |
|
|
|
fun create( fragmentManager: FragmentManager?, row: DynamicRowInterface, valueDelegate: BottomSheetDelegate, data: Any?): BottomSheetFragment { |
|
|
|
|
|
|
|
|
|
|
|
val bottomSheetFragment = when (row.bottomSheetType) { |
|
|
|
val bottomSheetFragment = when (row.bottomSheetType) { |
|
|
|
BottomSheetType.BLINDS -> BottomSheetBlindsFragment() |
|
|
|
BottomSheetType.BLINDS -> BottomSheetBlindsFragment() |
|
|
|
|