Bimba.git

commit 9fa7e73c13ea5c57c9611987f09c4f3fbb39ab17

Author: Adam Pioterek <adam.pioterek@protonmail.ch>

selecting today’s page

 app/src/main/java/ml/adamsprogs/bimba/activities/StopActivity.kt | 4 +
 app/src/main/java/ml/adamsprogs/bimba/models/Departure.kt | 2 


diff --git a/app/src/main/java/ml/adamsprogs/bimba/activities/StopActivity.kt b/app/src/main/java/ml/adamsprogs/bimba/activities/StopActivity.kt
index d5e42fcc62ad95bd3b1764994eef3a4da6f9491e..6ebab7a4cf100215983971ffc6d4a0caef984d81 100644
--- a/app/src/main/java/ml/adamsprogs/bimba/activities/StopActivity.kt
+++ b/app/src/main/java/ml/adamsprogs/bimba/activities/StopActivity.kt
@@ -89,6 +89,8 @@
         container.addOnPageChangeListener(TabLayout.TabLayoutOnPageChangeListener(tabs))
         tabs.addOnTabSelectedListener(TabLayout.ViewPagerOnTabSelectedListener(container))
 
+        selectTodayPage()
+
         showFab()
 
         prepareOnDownloadListener()
@@ -192,7 +194,7 @@         //todo refresh
     }
 
     private fun selectTodayPage() {
-        tabs.getTabAt(sectionsPagerAdapter!!.todayTab())
+        tabs.getTabAt(sectionsPagerAdapter!!.todayTab())!!.select()
     }
 
     override fun onCreateOptionsMenu(menu: Menu): Boolean {




diff --git a/app/src/main/java/ml/adamsprogs/bimba/models/Departure.kt b/app/src/main/java/ml/adamsprogs/bimba/models/Departure.kt
index 4b757e56de207909889e9d8f49dc7f606ff9cb56..4839a43533b9db54f692fccfe6a8f61b4cc18e6b 100644
--- a/app/src/main/java/ml/adamsprogs/bimba/models/Departure.kt
+++ b/app/src/main/java/ml/adamsprogs/bimba/models/Departure.kt
@@ -47,7 +47,7 @@
             return rollDepartures(departures)
         }
 
-        fun rollDepartures(departures: Map<AgencyAndId, List<Departure>>): Map<AgencyAndId, List<Departure>> { //fixme doesn't roll night properly: (23),(23,00)
+        fun rollDepartures(departures: Map<AgencyAndId, List<Departure>>): Map<AgencyAndId, List<Departure>> { //todo it'd be nice to roll from tomorrow's real mode (Fri->Sat, Sat->Sun, Sun->Mon)
             val rolledDepartures = HashMap<AgencyAndId, List<Departure>>()
             departures.keys.forEach {
                 val (filtered, isFull) = filterDepartures(departures[it]!!)