Bimba.git

commit a474e4a67fa0e0ae55a329a9464263e17c905c0d

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

todo: lanscape stopActivity

%!v(PANIC=String method: strings: negative Repeat count)


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/activities/LineSpecifyActivity.kt b/app/src/main/java/ml/adamsprogs/bimba/activities/LineSpecifyActivity.kt
index 1ee842fbd7c26bb2252840839092772f092cc0e6..5d7d949f83b9112fd606741d84d156d57990cd8a 100644
--- a/app/src/main/java/ml/adamsprogs/bimba/activities/LineSpecifyActivity.kt
+++ b/app/src/main/java/ml/adamsprogs/bimba/activities/LineSpecifyActivity.kt
@@ -37,14 +37,14 @@
         container.adapter = sectionsPagerAdapter
 
         for (i in 0 until tabs.tabCount) {
-            tabs.getTabAt(i)?.text = graphs[i].second
+            tabs.getTabAt(i)?.text = graphs[i].headsign
         }
 
         container.addOnPageChangeListener(TabLayout.TabLayoutOnPageChangeListener(tabs))
         tabs.addOnTabSelectedListener(TabLayout.ViewPagerOnTabSelectedListener(container))
     }
 
-    inner class SectionsPagerAdapter(fm: FragmentManager, private val graphs: Array<Pair<HashMap<Int, HashSet<Int>>, String>>) : FragmentPagerAdapter(fm) {
+    inner class SectionsPagerAdapter(fm: FragmentManager, private val graphs: Array<Timetable.TripGraph>) : FragmentPagerAdapter(fm) {
 
         override fun getItem(position: Int): Fragment {
             return PlaceholderFragment.newInstance(position + 1, graphs[position])
@@ -65,11 +65,14 @@
         companion object {
             private const val ARG_SECTION_NUMBER = "section_number"
 
-            fun newInstance(sectionNumber: Int, graph: Pair<HashMap<Int, HashSet<Int>>, String>): PlaceholderFragment {
+            fun newInstance(sectionNumber: Int, graph: Timetable.TripGraph): PlaceholderFragment {
                 val fragment = PlaceholderFragment()
                 val args = Bundle()
                 args.putInt(ARG_SECTION_NUMBER, sectionNumber)
-                args.putString("graph", graph.first.map { "${it.key}: ${it.value.joinToString(", ")}" }.joinToString("\n"))
+
+                //todo serialise graph // or draw and pass image
+                //args.putString("graph", graph.first.map { "${it.key}: ${it.value.joinToString(", ")}" }.joinToString("\n"))
+
                 fragment.arguments = args
                 return fragment
             }




diff --git a/app/src/main/res/layout/fragment_stop.xml b/app/src/main/res/layout/fragment_stop.xml
index 0e24c01dde58f17ff54d130b461c68c002d28298..4cadd826bbf25470cfb9f7417b425acadc0c9722 100644
--- a/app/src/main/res/layout/fragment_stop.xml
+++ b/app/src/main/res/layout/fragment_stop.xml
@@ -6,6 +6,7 @@     android:layout_width="match_parent"
     android:layout_height="match_parent"
     tools:context="ml.adamsprogs.bimba.activities.StopActivity$PlaceholderFragment">
 
+    <!-- todo landscape version -->
     <android.support.v7.widget.RecyclerView
         android:id="@+id/departuresList"
         android:layout_width="368dp"