Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import android.view.ViewGroup
import androidx.core.view.updatePadding
import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
import com.chicagoroboto.R
import com.chicagoroboto.databinding.SessionsBinding
import com.chicagoroboto.ext.getComponent
import com.chicagoroboto.ext.presentations
Expand Down Expand Up @@ -42,8 +41,6 @@ class SessionDateFragment : Fragment() {

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.pager.adapter = adapter
adapter.mediateTabs(binding.tabs, binding.pager)

binding.appBar.doOnApplyWindowInsets { view, insets, initialState ->
view.updatePadding(
Expand All @@ -64,12 +61,17 @@ class SessionDateFragment : Fragment() {
adapter.dates.addAll(it.dates)
adapter.notifyDataSetChanged()

// Set the current tab to today
if (it.dates.isNotEmpty()) {
val today = dateFormat.format(Date())
val index = adapter.dates.indexOfFirst { it.id == today }
if (index >= 0) {
binding.pager.setCurrentItem(index, false)
binding.pager.adapter = adapter
adapter.mediateTabs(binding.tabs, binding.pager)

if (savedInstanceState == null) {
// Set the current tab to today
if (it.dates.isNotEmpty()) {
val today = dateFormat.format(Date())
val index = adapter.dates.indexOfFirst { it.id == today }
if (index >= 0) {
binding.pager.setCurrentItem(index, false)
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion android/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
"-L-2S4rWWRVi2OlUEpRR" : {
"abstract" : "Mark Allison (author of https://blog.stylingandroid,com) has a deep love of VectorDrawable. He has spoken at conferences about how to construct and Animate them in his talk entitled \"Vector All The Things\".\n\nIn this all new talk, Mark will look at some of the features which have been added to VectorDrawable and its sibling AnimatedVectorDrawable since they first appeared in Android Lollipop 5.0 (API 21). There will be a dive in to fill windings which can cause some baffling rendering oddities, yet can be quite simple to fix once you recognise that fill windings are the cause; There will also be a look at the recently added gradient support; And, of course, there will be plenty of tricks and tips to help with your creation of fabulous VectorDrawables, and amazing Animations.",
"start_time": "2018-04-12T14:00:00-0500",
"end_time": "2018-04-1214:45:00-0500",
"end_time": "2018-04-12T14:45:00-0500",
"date" : "2018-04-12",
"accepted" : true,
"duration" : 40,
Expand Down