|
|
|
|
@ -4,6 +4,8 @@ import android.os.Bundle |
|
|
|
|
import android.view.LayoutInflater |
|
|
|
|
import android.view.View |
|
|
|
|
import android.view.ViewGroup |
|
|
|
|
import android.widget.Toast |
|
|
|
|
import androidx.recyclerview.widget.GridLayoutManager |
|
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager |
|
|
|
|
import kotlinx.android.synthetic.main.fragment_new_session.* |
|
|
|
|
import kotlinx.coroutines.Dispatchers |
|
|
|
|
@ -14,6 +16,8 @@ import net.pokeranalytics.android.R |
|
|
|
|
import net.pokeranalytics.android.model.realm.Session |
|
|
|
|
import net.pokeranalytics.android.ui.adapter.NewSessionAdapter |
|
|
|
|
import net.pokeranalytics.android.ui.adapter.components.DynamicListAdapter |
|
|
|
|
import net.pokeranalytics.android.ui.adapter.components.DynamicRowCallback |
|
|
|
|
import net.pokeranalytics.android.ui.adapter.components.DynamicRowInterface |
|
|
|
|
import net.pokeranalytics.android.util.PokerAnalyticsFragment |
|
|
|
|
|
|
|
|
|
class NewSessionFragment : PokerAnalyticsFragment() { |
|
|
|
|
@ -43,21 +47,16 @@ class NewSessionFragment: PokerAnalyticsFragment() { |
|
|
|
|
val viewManager = LinearLayoutManager(requireContext()) |
|
|
|
|
val newSessionAdapter = DynamicListAdapter(newSession) |
|
|
|
|
|
|
|
|
|
newSessionAdapter.callback = { |
|
|
|
|
val bottomSheetFragment = openBottomSheet() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
recyclerView.apply { |
|
|
|
|
setHasFixedSize(true) |
|
|
|
|
layoutManager = viewManager |
|
|
|
|
adapter = newSessionAdapter |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Bottom sheet example |
|
|
|
|
/* |
|
|
|
|
GlobalScope.launch(Dispatchers.Main) { |
|
|
|
|
delay(2000) |
|
|
|
|
val bottomSheetFragment = openBottomSheet() |
|
|
|
|
delay(2000) |
|
|
|
|
bottomSheetFragment.dismiss() |
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|