Skip to content

Commit

Permalink
rilling#118 display activity Type for each record on home screen
Browse files Browse the repository at this point in the history
  • Loading branch information
prachipatel488 committed Apr 7, 2024
1 parent db2a37c commit b6b7cf3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ public void bind(Cursor cursor) {
trackId = new Track.Id(cursor.getLong(idIndex));

int iconId = activityType.getIconDrawableId();
String activity_id = activityType.getId();
int iconDesc = R.string.image_track;

boolean isRecordingThisTrackRecording = trackId.equals(recordingStatus.trackId());
Expand All @@ -213,6 +214,7 @@ public void bind(Cursor cursor) {
viewBinding.trackListItemIcon.setContentDescription(context.getString(iconDesc));

viewBinding.trackListItemName.setText(name);
viewBinding.trackListItemActivity.setText(activity_id);

String timeDistanceText = ListItemUtils.getTimeDistanceText(context, unitSystem, isRecordingThisTrackRecording, totalTime, totalDistance, markerCount);
viewBinding.trackListItemTimeDistance.setText(timeDistanceText);
Expand Down
12 changes: 11 additions & 1 deletion src/main/res/layout/track_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@
app:layout_constraintTop_toTopOf="parent"
tools:text="Main Text" />

<!-- Activity-Type -->
<TextView
android:id="@+id/track_list_item_activity"
style="?attr/textAppearanceBodySmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/track_list_item_name"
app:layout_constraintStart_toStartOf="@id/track_list_item_name"
tools:text="Activity Type" />

<!-- Date -->
<TextView
android:id="@+id/track_list_item_date"
Expand All @@ -47,7 +57,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="@id/track_list_item_name"
app:layout_constraintTop_toBottomOf="@id/track_list_item_name"
app:layout_constraintTop_toBottomOf="@id/track_list_item_activity"
tools:text="50:43 (50.00km)" />

<!-- Marker Count Icon -->
Expand Down

0 comments on commit b6b7cf3

Please sign in to comment.