TripDetailsActivity: Relayout fare list to properly show fare/ticket names.

This commit is contained in:
Andreas Schildbach 2019-01-14 19:28:22 +01:00
parent f740de9af0
commit d675d9a282
5 changed files with 15 additions and 23 deletions

View file

@ -71,22 +71,10 @@
android:background="?android:attr/listDivider"
android:baselineAligned="true"
android:paddingBottom="@dimen/list_entry_padding_vertical_lax"
android:paddingLeft="@dimen/list_entry_padding_horizontal_lax"
android:paddingRight="@dimen/list_entry_padding_horizontal_lax"
android:paddingTop="@dimen/list_entry_padding_vertical_lax" >
<TableRow>
<TextView
android:id="@+id/directions_trip_details_fare_entry_network"
android:textSize="@dimen/font_size_large" />
<TextView
android:paddingLeft="@dimen/list_entry_padding_horizontal_lax"
android:text="@string/directions_trip_details_fare_entry_ticket"
android:textSize="@dimen/font_size_large" />
</TableRow>
</TableLayout>
android:paddingLeft="@dimen/list_entry_padding_horizontal_verylax"
android:paddingRight="@dimen/list_entry_padding_horizontal_verylax"
android:paddingTop="@dimen/list_entry_padding_vertical_lax"
android:stretchColumns="2" />
<TextView
android:id="@+id/directions_trip_details_footer"

View file

@ -3,18 +3,24 @@
<TextView
android:id="@+id/directions_trip_details_fare_entry_row_type"
android:textSize="@dimen/font_size_large" />
android:textSize="@dimen/font_size_normal"
android:textStyle="bold" />
<TextView
android:id="@+id/directions_trip_details_fare_entry_row_name"
android:paddingLeft="@dimen/list_entry_padding_horizontal_lax"
android:textSize="@dimen/font_size_normal" />
<TextView
android:id="@+id/directions_trip_details_fare_entry_row_fare"
android:gravity="right"
android:paddingLeft="@dimen/list_entry_padding_horizontal_lax"
android:textSize="@dimen/font_size_large"
android:textSize="@dimen/font_size_normal"
android:textStyle="bold" />
<TextView
android:id="@+id/directions_trip_details_fare_entry_row_unit"
android:paddingLeft="@dimen/list_entry_padding_horizontal_lax"
android:textSize="@dimen/font_size_large" />
android:textSize="@dimen/font_size_normal" />
</TableRow>

View file

@ -242,7 +242,6 @@
<!-- directions trip details -->
<string name="directions_trip_details_duraton">Dauer %s</string>
<string name="directions_trip_details_num_changes">%d Umst.</string>
<string name="directions_trip_details_fare_entry_ticket">Einzelfahrt</string>
<string name="directions_trip_details_walk">&lt;b>%1$d Minuten&lt;/b> %2$sFußweg nach&lt;br/>%3$s</string>
<string name="directions_trip_details_bike">&lt;b>%1$d Minuten&lt;/b> %2$sFahrt mit dem Fahrrad nach&lt;br/>%3$s</string>
<string name="directions_trip_details_car">&lt;b>%1$d Minuten&lt;/b> %2$sFahrt mit dem Auto nach&lt;br/>%3$s</string>

View file

@ -243,7 +243,6 @@
<!-- directions trip details -->
<string name="directions_trip_details_duraton">Duration %s</string>
<string name="directions_trip_details_num_changes">%d ch.</string>
<string name="directions_trip_details_fare_entry_ticket">Single ticket</string>
<string name="directions_trip_details_walk">walk &lt;b>%1$d minutes&lt;/b> %2$sto&lt;br/>%3$s</string>
<string name="directions_trip_details_bike">bike &lt;b>%1$d minutes&lt;/b> %2$sto&lt;br/>%3$s</string>
<string name="directions_trip_details_car">drive &lt;b>%1$d minutes&lt;/b> %2$sto&lt;br/>%3$s</string>

View file

@ -557,14 +557,14 @@ public class TripDetailsActivity extends OeffiActivity implements LocationListen
if (trip.fares != null && !trip.fares.isEmpty()) {
faresTable.setVisibility(View.VISIBLE);
((TextView) findViewById(R.id.directions_trip_details_fare_entry_network)).setText(fares.get(0).network);
final String[] fareTypes = res.getStringArray(R.array.fare_types);
int i = 1;
int i = 0;
for (final Fare fare : fares) {
final View fareRow = inflater.inflate(R.layout.directions_trip_details_fares_row, null);
((TextView) fareRow.findViewById(R.id.directions_trip_details_fare_entry_row_type))
.setText(fareTypes[fare.type.ordinal()]);
((TextView) fareRow.findViewById(R.id.directions_trip_details_fare_entry_row_name)).setText(fare.name);
((TextView) fareRow.findViewById(R.id.directions_trip_details_fare_entry_row_fare))
.setText(String.format("%s%.2f", fare.currency.getSymbol(), fare.fare));
final TextView unitView = (TextView) fareRow