Bimba.git

commit 559ed43418c4986244ee09fff1d98fd37c612bc5

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

fixed favourite full timetable is not interrupted by VM

 app/src/main/java/ml/adamsprogs/bimba/activities/StopActivity.kt | 5 +
 app/src/main/res/layout/activity_stop.xml | 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 9acc368cc6fb945f4483f201d345ed37758967f7..af4f356de1080e93dc56549c509832a671e4ecba 100644
--- a/app/src/main/java/ml/adamsprogs/bimba/activities/StopActivity.kt
+++ b/app/src/main/java/ml/adamsprogs/bimba/activities/StopActivity.kt
@@ -107,7 +107,8 @@         lastUpdated = Calendar.getInstance().timeInMillis
     }
 
     override fun onVmPrepared() {
-        if (favourite!!.isBackedByVm || ticked()) {
+        //fixme do we give up too fast?
+        if ((favourite!!.isBackedByVm || ticked()) && (timetableType == "departure")) {
             getFavouriteDepartures()
         }
     }
@@ -179,7 +180,7 @@             TimetableDownloader.RESULT_FINISHED -> getString(R.string.timetable_downloaded)
             else -> getString(R.string.error_try_later)
         }
         try {
-            Snackbar.make(findViewById(R.id.drawer_layout), message, Snackbar.LENGTH_LONG).show()
+            Snackbar.make(findViewById(R.id.stop_layout), message, Snackbar.LENGTH_LONG).show()
         } catch (e: IllegalArgumentException) {
         }
         timetable = Timetable.getTimetable(this, true)




diff --git a/app/src/main/res/layout/activity_stop.xml b/app/src/main/res/layout/activity_stop.xml
index 04e0beca509e43a93d80462822865d8ce6693505..069577f38984997e4c54e2918bef8d6506234a14 100644
--- a/app/src/main/res/layout/activity_stop.xml
+++ b/app/src/main/res/layout/activity_stop.xml
@@ -2,7 +2,7 @@ 
 <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/main_content"
+    android:id="@+id/stop_layout"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:fitsSystemWindows="true"