Author: Adam <git@apiote.xyz>
improve departure UI
app/src/main/java/ml/adamsprogs/bimba/departures/Departures.kt | 5 app/src/main/res/layout/departure.xml | 26 ++-
diff --git a/app/src/main/java/ml/adamsprogs/bimba/departures/Departures.kt b/app/src/main/java/ml/adamsprogs/bimba/departures/Departures.kt index b9a9652362d0d199115d55e7745e2139b45ace81..f6452346edd002ec2e201aafc0062f73bc152162 100644 --- a/app/src/main/java/ml/adamsprogs/bimba/departures/Departures.kt +++ b/app/src/main/java/ml/adamsprogs/bimba/departures/Departures.kt @@ -18,6 +18,7 @@ class BimbaDepartureViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { val root: View = itemView.findViewById(R.id.departure) val lineIcon: ImageView = itemView.findViewById(R.id.line_icon) val departureTime: TextView = itemView.findViewById(R.id.departure_time) + val lineName: TextView = itemView.findViewById(R.id.departure_line) val headsign: TextView = itemView.findViewById(R.id.departure_headsign) companion object { @@ -32,8 +33,8 @@ holder?.root?.setOnClickListener { onClickListener(departure) } holder?.lineIcon?.setImageBitmap(departure.line.icon(context!!)) - holder?.headsign?.text = - "${departure.line.name} » ${departure.headsign}" // check if >> is a11y + holder?.lineName?.text = departure.line.name + holder?.headsign?.text = "» ${departure.headsign}" // todo >> is not a11y val now = Calendar.getInstance() val departureTime = Calendar.getInstance().apply { set(Calendar.HOUR_OF_DAY, departure.time.Hour.toInt()) diff --git a/app/src/main/res/layout/departure.xml b/app/src/main/res/layout/departure.xml index 43a0470c1377c0777089a83f3e753541630266a5..c603a8f6e1c94e90b7759c8be2d18ff0f25c3c5b 100644 --- a/app/src/main/res/layout/departure.xml +++ b/app/src/main/res/layout/departure.xml @@ -21,21 +21,31 @@ android:id="@+id/departure_time" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="8dp" - android:layout_marginStart="16dp" - android:text="" - android:textAppearance="@style/TextAppearance.Material3.DisplaySmall" + android:layout_marginEnd="8dp" + android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" + tools:text="1h 56mins" /> + + <TextView + android:id="@+id/departure_line" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall" app:layout_constraintStart_toEndOf="@+id/line_icon" - app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toTopOf="parent" + tools:text="Metropolitan" /> - <!-- todo(ux) bigger --> <TextView android:id="@+id/departure_headsign" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="" android:textAppearance="@style/TextAppearance.Material3.BodySmall" - app:layout_constraintStart_toStartOf="@+id/departure_time" - app:layout_constraintTop_toBottomOf="@+id/departure_time" /> + app:layout_constraintStart_toStartOf="@+id/departure_line" + app:layout_constraintTop_toBottomOf="@+id/departure_line" + tools:text="» Tower Hill" /> </androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file