mirror of
https://gitlab.com/oeffi/oeffi.git
synced 2025-07-07 17:38:48 +00:00
TripDetailsActivity: Relayout fare list to properly show fare/ticket names.
This commit is contained in:
parent
f740de9af0
commit
d675d9a282
5 changed files with 15 additions and 23 deletions
|
@ -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"
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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"><b>%1$d Minuten</b> %2$sFußweg nach<br/>%3$s</string>
|
||||
<string name="directions_trip_details_bike"><b>%1$d Minuten</b> %2$sFahrt mit dem Fahrrad nach<br/>%3$s</string>
|
||||
<string name="directions_trip_details_car"><b>%1$d Minuten</b> %2$sFahrt mit dem Auto nach<br/>%3$s</string>
|
||||
|
|
|
@ -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 <b>%1$d minutes</b> %2$sto<br/>%3$s</string>
|
||||
<string name="directions_trip_details_bike">bike <b>%1$d minutes</b> %2$sto<br/>%3$s</string>
|
||||
<string name="directions_trip_details_car">drive <b>%1$d minutes</b> %2$sto<br/>%3$s</string>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue