MAJ terminée. Nous sommes passés en version 14.6.2 . Pour consulter les "releases notes" associées c'est ici :

https://about.gitlab.com/releases/2022/01/11/security-release-gitlab-14-6-2-released/
https://about.gitlab.com/releases/2022/01/04/gitlab-14-6-1-released/

Commit ae5456be authored by stopcovid@lunabee.com's avatar stopcovid@lunabee.com
Browse files

Update to 2.1.6

- Cosmetic improvement on numbers layout
- Use extractDate instead of lastUpdate for Key Figure
parent 413951cc
......@@ -68,7 +68,7 @@ abstract class BaseFragment : Fragment() {
}
@OptIn(ExperimentalTime::class)
protected fun Duration.getRelativeDateString(context: Context): String? {
protected fun Duration.getRelativeDateString(): String? {
return DateUtils.getRelativeTimeSpanString(
this.toLongMilliseconds(),
System.currentTimeMillis(),
......
......@@ -153,7 +153,7 @@ class KeyFiguresFragment : MainFragment() {
identifier = items.count().toLong()
}
keyFigures.filter { it.category == KeyFigureCategory.HEALTH }.forEach { figure ->
items += itemForFigure(figure)
items += itemForFigure(figure, false)
}
items += spaceItem {
......@@ -166,7 +166,7 @@ class KeyFiguresFragment : MainFragment() {
identifier = items.count().toLong()
}
keyFigures.filter { it.category == KeyFigureCategory.APP }.forEach { figure ->
items += itemForFigure(figure)
items += itemForFigure(figure, true)
}
}
}
......@@ -183,17 +183,9 @@ class KeyFiguresFragment : MainFragment() {
}
@OptIn(ExperimentalTime::class)
private fun itemForFigure(figure: KeyFigure): KeyFigureCardItem {
private fun itemForFigure(figure: KeyFigure, useDateTime: Boolean): KeyFigureCardItem {
return keyFigureCardItem {
updatedAt = stringsFormat(
"keyFigures.update",
if (figure.category == KeyFigureCategory.HEALTH) {
figure.lastUpdate.seconds.getRelativeDateString(requireContext())
} else {
figure.lastUpdate.seconds.getRelativeDateTimeString(requireContext())
}
)
val extractDate: Long
if (sharedPrefs.hasChosenPostalCode) {
val departmentKeyFigure = figure.getKeyFigureForPostalCode(sharedPrefs.chosenPostalCode)
......@@ -204,14 +196,25 @@ class KeyFiguresFragment : MainFragment() {
rightValue = figure.valueGlobalToDisplay.formatNumberIfNeeded(numberFormat)
rightTrend = figure.trend?.getTrend()
leftTrend = departmentKeyFigure.trend?.getTrend()
extractDate = departmentKeyFigure.extractDate
} else {
leftValue = figure.valueGlobalToDisplay.formatNumberIfNeeded(numberFormat)
leftTrend = figure.trend?.getTrend()
extractDate = figure.extractDate
}
} else {
leftValue = figure.valueGlobalToDisplay.formatNumberIfNeeded(numberFormat)
leftTrend = figure.trend?.getTrend()
extractDate = figure.extractDate
}
updatedAt = stringsFormat(
"keyFigures.update",
if (useDateTime) {
extractDate.seconds.getRelativeDateTimeString(requireContext())
} else {
extractDate.seconds.getRelativeDateString()
}
)
label = strings["${figure.labelKey}.label"]
description = strings["${figure.labelKey}.description"]
......
......@@ -21,7 +21,7 @@ data class KeyFigure(
val valueGlobalToDisplay: String,
val valueGlobal: Double?,
val isFeatured: Boolean,
val lastUpdate: Long,
val extractDate: Long,
val valuesDepartments: List<DepartmentKeyFigure>?,
val trend: Int?
)
......
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ This Source Code Form is subject to the terms of the Mozilla Public
~ License, v. 2.0. If a copy of the MPL was not distributed with this
~ file, You can obtain one at https://mozilla.org/MPL/2.0/.
......@@ -32,19 +31,25 @@
android:id="@+id/label1TextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/spacing_small"
android:textAppearance="@style/TextAppearance.StopCovid.Caption.Bold"
android:textIsSelectable="false"
app:layout_constraintBottom_toTopOf="@id/value1TextView"
app:layout_constraintEnd_toStartOf="@id/label2TextView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/locationTextView"
tools:text="@tools:sample/lorem[1]" />
app:layout_constraintVertical_bias="1"
app:layout_constraintVertical_chainStyle="packed"
tools:text="@tools:sample/lorem[4]" />
<TextView
android:id="@+id/value1TextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/spacing_small"
android:textAppearance="@style/TextAppearance.StopCovid.Title.Bold"
android:textIsSelectable="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/value2TextView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/label1TextView"
......@@ -54,19 +59,25 @@
android:id="@+id/label2TextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/spacing_small"
android:textAppearance="@style/TextAppearance.StopCovid.Caption.Bold"
android:textIsSelectable="false"
app:layout_constraintBottom_toTopOf="@id/value2TextView"
app:layout_constraintEnd_toStartOf="@id/label3TextView"
app:layout_constraintStart_toEndOf="@id/label1TextView"
app:layout_constraintTop_toBottomOf="@id/locationTextView"
app:layout_constraintVertical_bias="1"
app:layout_constraintVertical_chainStyle="packed"
tools:text="@tools:sample/lorem[1]" />
<TextView
android:id="@+id/value2TextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/spacing_small"
android:textAppearance="@style/TextAppearance.StopCovid.Title.Bold"
android:textIsSelectable="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/value3TextView"
app:layout_constraintStart_toEndOf="@id/value1TextView"
app:layout_constraintTop_toBottomOf="@id/label2TextView"
......@@ -78,10 +89,13 @@
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.StopCovid.Caption.Bold"
android:textIsSelectable="false"
app:layout_constraintBottom_toTopOf="@id/value3TextView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/label2TextView"
app:layout_constraintTop_toBottomOf="@id/locationTextView"
tools:text="@tools:sample/lorem[1]" />
app:layout_constraintVertical_bias="1"
app:layout_constraintVertical_chainStyle="packed"
tools:text="@tools:sample/lorem[5]" />
<TextView
android:id="@+id/value3TextView"
......@@ -89,6 +103,7 @@
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.StopCovid.Title.Bold"
android:textIsSelectable="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/value2TextView"
app:layout_constraintTop_toBottomOf="@id/label3TextView"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment