Bimba.git

commit 69fe211f7d555e696a6901b743bd6676b7dc79ee

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

bugfix: VM now swiched to timetable after connectivity lost on main screen

 .idea/misc.xml | 2 
 app/src/main/java/ml/adamsprogs/bimba/models/Favourite.kt | 3 
 app/src/main/java/ml/adamsprogs/bimba/models/FavouriteStorage.kt | 1 
 app/src/main/java/ml/adamsprogs/bimba/models/FavouritesAdapter.kt | 2 


diff --git a/.idea/misc.xml b/.idea/misc.xml
index ba7052b8197ddf8ba8756022d905d03055c7ad60..635999df1e86791ad3787e455b4524e4d8879b93 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -24,7 +24,7 @@         
       </value>
     </option>
   </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/build/classes" />
   </component>
   <component name="ProjectType">




diff --git a/app/src/main/java/ml/adamsprogs/bimba/models/Favourite.kt b/app/src/main/java/ml/adamsprogs/bimba/models/Favourite.kt
index a851642389c241189f85fecf8482a41aac7854bf..3fde22b5c600605f48991d54ef70a3bdad5b6409 100644
--- a/app/src/main/java/ml/adamsprogs/bimba/models/Favourite.kt
+++ b/app/src/main/java/ml/adamsprogs/bimba/models/Favourite.kt
@@ -132,7 +132,8 @@         }
         if (vmDepartures != null && requesterName == name) {
             vmDeparturesMap[requesterTimetable] = vmDepartures
             this.vmDepartures = vmDeparturesMap.flatMap { it.value } as ArrayList<Departure>
-        }
+        } else
+            this.vmDepartures = ArrayList()
         filterVmDepartures()
     }
 }




diff --git a/app/src/main/java/ml/adamsprogs/bimba/models/FavouriteStorage.kt b/app/src/main/java/ml/adamsprogs/bimba/models/FavouriteStorage.kt
index adee9273c35f60c60c229eb2cb6476988492d678..c385320d575062e8d3f85134702ad6f786df06e6 100644
--- a/app/src/main/java/ml/adamsprogs/bimba/models/FavouriteStorage.kt
+++ b/app/src/main/java/ml/adamsprogs/bimba/models/FavouriteStorage.kt
@@ -2,7 +2,6 @@ package ml.adamsprogs.bimba.models
 
 import android.content.Context
 import android.content.SharedPreferences
-import android.util.Log
 import com.google.gson.Gson
 import com.google.gson.JsonArray
 import com.google.gson.JsonObject




diff --git a/app/src/main/java/ml/adamsprogs/bimba/models/FavouritesAdapter.kt b/app/src/main/java/ml/adamsprogs/bimba/models/FavouritesAdapter.kt
index d05420a990e70fa4ba27780b7e72003abb0125a2..8c62986865d0808f53d12ac353416e220ed4ad92 100644
--- a/app/src/main/java/ml/adamsprogs/bimba/models/FavouritesAdapter.kt
+++ b/app/src/main/java/ml/adamsprogs/bimba/models/FavouritesAdapter.kt
@@ -20,7 +20,6 @@ import ml.adamsprogs.bimba.Declinator
 import ml.adamsprogs.bimba.activities.StopActivity
 import kotlin.collections.ArrayList
 
-//todo list to storage
 class FavouritesAdapter(val context: Context, var favourites: List<Favourite>, private val onMenuItemClickListener: FavouritesAdapter.OnMenuItemClickListener) :
         RecyclerView.Adapter<FavouritesAdapter.ViewHolder>() {
 
@@ -68,7 +67,6 @@                     return@thread
                 nextDepartureText = context.getString(Declinator.decline(interval), interval.toString())
                 nextDepartureLineText = context.getString(R.string.departure_to_line, nextDeparture.line, nextDeparture.direction)
             } else {
-                //fixme too early ?
                 nextDepartureText = context.getString(R.string.no_next_departure)
                 nextDepartureLineText = ""
             }