0

Me and a friend are trying to do a timetable of a train schedule , but we are now stuck in how to show the data from the Sqlite database. We can show the data, but not how we want it.

I did a sketch in paint to show what we want to do.

https://i.stack.imgur.com/5XUfV.png

When scrolling vertically above the "stations" table, both the "Stations" and the "Times" should scroll vertically, but when scrolling above "Times",only "Times" should scroll horizontally (stations should stay the same).

Does anyone have an idea of how we should do this (we are beginners in programming, and in android programming)?

Thanks :) !

edit:

I found an app that does what I want, this way is easier for everyone to understand

Google Play - Sydney Rail Beta

(it does not let me put 2 link, so I removed the http) i.stack.imgur.com/ktS8J.jpg

1 Answers1

0

For vertical scrolling you can use ScrollView ( http://developer.android.com/reference/android/widget/ScrollView.html )

I'm not sure why you need to scroll 'Times' when scrolling 'Stations', but you can use HorizontalScrollView modified in this way Synchronise ScrollView scroll positions - android

In OnScrollChanged method you can use scrollTo method of your HorizontalScrollView to scroll to desired position.

Community
  • 1
  • 1
marwinXXII
  • 1,456
  • 14
  • 21
  • Thanks for your reply! I need to scroll "Times" at the same time as "Stations", because when scrolling down in "stations" to see the stations below, the times you will see aligned with the Stations will no be the ones corresponding for the correct Stations. Forgive my English (not my main language) ! – user1382920 May 28 '12 at 13:50
  • ok, I just thought that you can update Times panel by clicking on station, but nevermind. – marwinXXII May 28 '12 at 17:22