Skip to content

Commit

Permalink
Lock screen rotation. Fix departures for-loop
Browse files Browse the repository at this point in the history
  • Loading branch information
dan1el committed Dec 11, 2012
1 parent 6da33a5 commit f53e2ef
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
23 changes: 12 additions & 11 deletions application/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="no.ruter.app.android" android:versionCode="1" android:versionName="1.0-SNAPSHOT">
package="no.ruter.app.android" android:versionCode="1" android:versionName="1.0-SNAPSHOT">

<application android:label="@string/app_name" android:theme="@android:style/Theme.Holo.Light.DarkActionBar">
<activity android:name=".MainViewActivity">'
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<application android:label="@string/app_name" android:theme="@android:style/Theme.Holo.Light.DarkActionBar">
<activity android:name=".MainViewActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

</manifest>

Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public long getItemId(int i) {
}

public View getView(int position, View view, ViewGroup parent) {
System.out.println("getView()");
View realtimeDataView = view;
if (realtimeDataView == null) {
LayoutInflater inflater = ((Activity) context).getLayoutInflater();
Expand All @@ -67,14 +68,14 @@ public View getView(int position, View view, ViewGroup parent) {
List<RealTimeData> departures = currentPlatform.getDepartures();

platformName.setText("Platform " + currentPlatform.getName()); // TODO: String resource
lineNumber.setText(departures.get(position).getLine() + " "); // TODO: XMLify
lineName.setText(departures.get(position).getDestination() + " ");
currentDeparture.setText(departures.get(position).getFormattedDepartureTime());
lineNumber.setText(departures.get(0).getLine() + " "); // TODO: XMLify
lineName.setText(departures.get(0).getDestination() + " ");
currentDeparture.setText(departures.get(0).getFormattedDepartureTime());

SpannableStringBuilder destinationSpannableStringBuilder = new SpannableStringBuilder();
String departuresString = "";

for (int i = 0; i < departures.size() && i < 5; i++) {
for (int i = 1; i < departures.size() && i < 5; i++) {
departuresString = departuresString.concat(departures.get(i).getLine() + " " +
departures.get(i).getDestination() + " " + departures.get(i).getFormattedDepartureTime() + " ");
}
Expand All @@ -85,7 +86,6 @@ public View getView(int position, View view, ViewGroup parent) {

while (matcher.find()) {
destinationSpannableStringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor("#FC6868")), matcher.start(), matcher.end(), 0);
System.out.println(matcher.group() + matcher.start() + matcher.end());
}

nextDepartures.setText(destinationSpannableStringBuilder);
Expand Down

0 comments on commit f53e2ef

Please sign in to comment.