Bimba.git

commit 2c61d7b87d057c7833f0974dfe17e2e70e12443b

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

fixed crash in StopActivity

 app/src/main/java/ml/adamsprogs/bimba/activities/StopActivity.kt | 3 
 app/src/main/res/layout/row_departure.xml | 24 -


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 c96770aac28a6e666db0e77f4df263fad2d63654..9acc368cc6fb945f4483f201d345ed37758967f7 100644
--- a/app/src/main/java/ml/adamsprogs/bimba/activities/StopActivity.kt
+++ b/app/src/main/java/ml/adamsprogs/bimba/activities/StopActivity.kt
@@ -183,7 +183,8 @@             Snackbar.make(findViewById(R.id.drawer_layout), message, Snackbar.LENGTH_LONG).show()
         } catch (e: IllegalArgumentException) {
         }
         timetable = Timetable.getTimetable(this, true)
-        refreshAdapterFromStop()
+        if (sourceType == SOURCE_TYPE_STOP)
+            refreshAdapterFromStop()
     }
 
     private fun selectTodayPage() {




diff --git a/app/src/main/res/layout/row_departure.xml b/app/src/main/res/layout/row_departure.xml
index 68ce350766a6552e8dc867f04d79a65ab603e243..30ff8bb41d1335b417de5513b6cb6e5e5cbf42e5 100644
--- a/app/src/main/res/layout/row_departure.xml
+++ b/app/src/main/res/layout/row_departure.xml
@@ -2,19 +2,19 @@ 
 <android.support.constraint.ConstraintLayout 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/departureRow"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     tools:layout_editor_absoluteX="0dp"
-    tools:layout_editor_absoluteY="25dp"
-    android:id="@+id/departureRow">
+    tools:layout_editor_absoluteY="25dp">
 
     <TextView
         android:id="@+id/lineNumber"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginBottom="8dp"
-        android:layout_marginEnd="8dp"
-        android:layout_marginStart="8dp"
+        android:layout_marginEnd="16dp"
+        android:layout_marginStart="16dp"
         android:layout_marginTop="8dp"
         android:text=""
         android:textAppearance="@style/TextAppearance.AppCompat.Title"
@@ -27,7 +27,7 @@              android:id="@+id/departureTypeIcon"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginEnd="16dp"
+        android:layout_marginEnd="8dp"
         android:layout_marginTop="8dp"
         android:contentDescription="@string/departure_type_icon_description"
         app:layout_constraintEnd_toEndOf="parent"
@@ -41,18 +41,16 @@         android:layout_marginStart="64dp"
         android:layout_marginTop="8dp"
         android:text="@string/departure_row_getting_departures"
         android:textAppearance="@style/TextAppearance.AppCompat.Headline"
-        app:layout_constraintStart_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toTopOf="parent" />
 
     <TextView
         android:id="@+id/departureDirection"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginBottom="8dp"
-        android:layout_marginStart="64dp"
+        android:layout_marginTop="8dp"
         android:text=""
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintStart_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="@+id/departureTime"
         app:layout_constraintTop_toBottomOf="@+id/departureTime" />
 
     <ImageView
@@ -60,11 +58,11 @@         android:id="@+id/departureInfoIcon"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginBottom="8dp"
-        android:layout_marginEnd="16dp"
+        android:layout_marginEnd="8dp"
         android:contentDescription="@string/departure_info"
         android:visibility="gone"
         app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintEnd_toStartOf="@+id/departureFloorIcon"
         app:srcCompat="@drawable/ic_info" />
 
     <ImageView
@@ -76,6 +74,6 @@         android:layout_marginEnd="8dp"
         android:contentDescription="@string/departure_floor"
         android:visibility="gone"
         app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintEnd_toStartOf="@+id/departureInfoIcon"
+        app:layout_constraintEnd_toEndOf="parent"
         app:srcCompat="@drawable/ic_low_floor" />
 </android.support.constraint.ConstraintLayout>
\ No newline at end of file