diff --git a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/eventregistration/common/TraceLocationCardHighlightView.kt b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/eventregistration/common/TraceLocationCardHighlightView.kt new file mode 100644 index 00000000000..9308fcb8b48 --- /dev/null +++ b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/eventregistration/common/TraceLocationCardHighlightView.kt @@ -0,0 +1,46 @@ +package de.rki.coronawarnapp.ui.eventregistration.common + +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import android.widget.TextView +import androidx.constraintlayout.widget.ConstraintLayout +import androidx.core.content.ContextCompat +import androidx.core.content.withStyledAttributes +import androidx.core.view.children +import de.rki.coronawarnapp.R + +class TraceLocationCardHighlightView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 +) : ConstraintLayout(context, attrs, defStyleAttr) { + + private val captionView: TextView by lazy { findViewById(R.id.caption) } + private val containerView: ConstraintLayout by lazy { findViewById(R.id.container) } + + init { + LayoutInflater.from(context).inflate(R.layout.trace_location_view_cardhighlight, this, true) + + background = ContextCompat.getDrawable(context, R.drawable.trace_location_view_cardhighlight_background) + + context.withStyledAttributes(attrs, R.styleable.TraceLocationHighlightView) { + val captionText = getText(R.styleable.TraceLocationHighlightView_android_text) ?: "" + captionView.text = captionText + } + } + + override fun onFinishInflate() { + children + .filter { it != captionView && it != containerView } + .forEach { + removeView(it) + containerView.addView(it) + } + super.onFinishInflate() + } + + fun setCaption(caption: String) { + captionView.text = caption + } +} diff --git a/Corona-Warn-App/src/main/res/drawable/ic_qr_code_list_item_icon.xml b/Corona-Warn-App/src/main/res/drawable/ic_qr_code_list_item_icon.xml new file mode 100644 index 00000000000..7b2adb69232 --- /dev/null +++ b/Corona-Warn-App/src/main/res/drawable/ic_qr_code_list_item_icon.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + diff --git a/Corona-Warn-App/src/main/res/drawable/trace_location_view_cardhighlight_background.xml b/Corona-Warn-App/src/main/res/drawable/trace_location_view_cardhighlight_background.xml new file mode 100644 index 00000000000..dc85b552d1a --- /dev/null +++ b/Corona-Warn-App/src/main/res/drawable/trace_location_view_cardhighlight_background.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/Corona-Warn-App/src/main/res/drawable/trace_location_view_cardhighlight_gradient.xml b/Corona-Warn-App/src/main/res/drawable/trace_location_view_cardhighlight_gradient.xml new file mode 100644 index 00000000000..bacb62a6b0b --- /dev/null +++ b/Corona-Warn-App/src/main/res/drawable/trace_location_view_cardhighlight_gradient.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_item.xml b/Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_item.xml new file mode 100644 index 00000000000..60c7911c140 --- /dev/null +++ b/Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_item.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Corona-Warn-App/src/main/res/layout/trace_location_view_cardhighlight.xml b/Corona-Warn-App/src/main/res/layout/trace_location_view_cardhighlight.xml new file mode 100644 index 00000000000..4baec8d5c1d --- /dev/null +++ b/Corona-Warn-App/src/main/res/layout/trace_location_view_cardhighlight.xml @@ -0,0 +1,36 @@ + + + + + + + \ No newline at end of file diff --git a/Corona-Warn-App/src/main/res/values-night/colors.xml b/Corona-Warn-App/src/main/res/values-night/colors.xml index b570534002d..316a7a0e1ab 100644 --- a/Corona-Warn-App/src/main/res/values-night/colors.xml +++ b/Corona-Warn-App/src/main/res/values-night/colors.xml @@ -68,4 +68,7 @@ #A7A7A7 #FFFFFF + + + #434445 diff --git a/Corona-Warn-App/src/main/res/values/attrs.xml b/Corona-Warn-App/src/main/res/values/attrs.xml index 6ff2a5d3b28..21217d0f0c4 100644 --- a/Corona-Warn-App/src/main/res/values/attrs.xml +++ b/Corona-Warn-App/src/main/res/values/attrs.xml @@ -46,4 +46,8 @@ + + + + \ No newline at end of file diff --git a/Corona-Warn-App/src/main/res/values/colors.xml b/Corona-Warn-App/src/main/res/values/colors.xml index 8bcf5822056..a459e542b50 100644 --- a/Corona-Warn-App/src/main/res/values/colors.xml +++ b/Corona-Warn-App/src/main/res/values/colors.xml @@ -88,4 +88,7 @@ @color/colorAccent #999999 + + + #FFFFFF