Skip to content

Commit

Permalink
Merge pull request #24 from AdevintaSpain/version_UI
Browse files Browse the repository at this point in the history
Version UI
  • Loading branch information
alorma authored Mar 28, 2023
2 parents 19eb352 + 0d3512d commit 390474c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ internal class DetailTaggingViewHolder(binding: TaggingDetailedItemBinding) : Re
}

binding.detailItemTime.text = timeFormat.format(Date(tagEntry.timestamp))
val version = tagEntry.version?.toString() ?: "-"
binding.detailItemVersion.text = binding.detailItemVersion.context.getString(
R.string.tagging_viewer_item_version, version
)

binding.detailItemIcon.setImageResource(
when (tagEntry) {
Expand Down
21 changes: 16 additions & 5 deletions taggingviewer/src/main/res/layout/tagging_detailed_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="20dp"
android:layout_marginRight="8dp"
tools:text="@tools:sample/date/hhmmss"
/>
<FrameLayout
Expand Down Expand Up @@ -46,9 +46,10 @@
android:id="@+id/detailItemIcon"
android:layout_width="28dp"
android:layout_height="28dp"
android:layout_marginTop="16dp"
android:layout_gravity="center_horizontal|top"
android:layout_marginTop="16dp"
android:src="@drawable/tgv_marker_event"
tools:ignore="ContentDescription"
/>
</FrameLayout>
<androidx.cardview.widget.CardView
Expand All @@ -73,15 +74,25 @@
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:textColor="?android:textColorPrimary"
android:textSize="18sp"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline6"
tools:text="Some event"
/>
<TextView
android:id="@+id/detailItemVersion"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/detailItemTitle"
android:layout_alignParentStart="true"
android:layout_marginVertical="8dp"
android:textAppearance="@style/TextAppearance.MaterialComponents.Caption"
tools:text="Some event"
/>
<TextView
android:id="@+id/detailItemExtra"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/detailItemTitle"
android:layout_below="@+id/detailItemVersion"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2"
android:textColor="?android:textColorSecondary"
tools:text="@tools:sample/lorem/random"
/>
Expand Down
4 changes: 4 additions & 0 deletions taggingviewer/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="tagging_viewer_item_version">Version: %s</string>
</resources>

0 comments on commit 390474c

Please sign in to comment.