mirror of
https://github.com/breezy-weather/breezy-weather.git
synced 2025-12-28 05:24:53 +00:00
Fix #2438 - Text overlap double line charts
Some checks failed
Breezy Weather push CI / build (push) Has been cancelled
Some checks failed
Breezy Weather push CI / build (push) Has been cancelled
This commit is contained in:
parent
ec0fd0e14f
commit
995d53b8dd
@ -12,6 +12,7 @@
|
||||
|
||||
**Improvements and fixes**
|
||||
- Fix crash on some devices when current weather is snow (@Cactric)
|
||||
- Fix overlap of texts on double line charts when the line “below” goes above the “above” line (for example, a min. night temperature higher than the max. day temperature)
|
||||
|
||||
**Weather sources**
|
||||
- Icelandic Met Office - Fix refresh error
|
||||
|
||||
@ -244,7 +244,11 @@ class PolylineAndHistogramView @JvmOverloads constructor(
|
||||
canvas.drawText(
|
||||
mHighPolylineValueStr ?: "",
|
||||
getRTLCompactX((measuredWidth / 2.0).toFloat()),
|
||||
mHighPolylineY[1] - mPaint.fontMetrics.bottom - mTextMargin,
|
||||
if (mHighPolylineY[1] > mLowPolylineY[1]) {
|
||||
mHighPolylineY[1] - mPaint.fontMetrics.top + mTextMargin
|
||||
} else {
|
||||
mHighPolylineY[1] - mPaint.fontMetrics.bottom - mTextMargin
|
||||
},
|
||||
mPaint
|
||||
)
|
||||
mPaint.setShadowLayer(0f, 0f, 0f, Color.TRANSPARENT)
|
||||
@ -315,7 +319,11 @@ class PolylineAndHistogramView @JvmOverloads constructor(
|
||||
canvas.drawText(
|
||||
mLowPolylineValueStr ?: "",
|
||||
getRTLCompactX((measuredWidth / 2.0).toFloat()),
|
||||
mLowPolylineY[1] - mPaint.fontMetrics.top + mTextMargin,
|
||||
if (mHighPolylineY[1] > mLowPolylineY[1]) {
|
||||
mLowPolylineY[1] - mPaint.fontMetrics.bottom - mTextMargin
|
||||
} else {
|
||||
mLowPolylineY[1] - mPaint.fontMetrics.top + mTextMargin
|
||||
},
|
||||
mPaint
|
||||
)
|
||||
mPaint.setShadowLayer(0f, 0f, 0f, Color.TRANSPARENT)
|
||||
|
||||
@ -212,8 +212,14 @@ class DailyFeelsLikeAdapter(
|
||||
if (mHighestTemperature == null || it > mHighestTemperature!!) {
|
||||
mHighestTemperature = it.toFloat()
|
||||
}
|
||||
if (mLowestTemperature == null || it < mLowestTemperature!!) {
|
||||
mLowestTemperature = it.toFloat()
|
||||
}
|
||||
}
|
||||
(daily.night?.temperature?.feelsLikeTemperature ?: daily.night?.temperature?.temperature)?.value?.let {
|
||||
if (mHighestTemperature == null || it > mHighestTemperature!!) {
|
||||
mHighestTemperature = it.toFloat()
|
||||
}
|
||||
if (mLowestTemperature == null || it < mLowestTemperature!!) {
|
||||
mLowestTemperature = it.toFloat()
|
||||
}
|
||||
|
||||
@ -244,8 +244,14 @@ class DailyTemperatureAdapter(
|
||||
if (mHighestTemperature == null || it > mHighestTemperature!!) {
|
||||
mHighestTemperature = it.toFloat()
|
||||
}
|
||||
if (mLowestTemperature == null || it < mLowestTemperature!!) {
|
||||
mLowestTemperature = it.toFloat()
|
||||
}
|
||||
}
|
||||
daily.night?.temperature?.temperature?.value?.let {
|
||||
if (mHighestTemperature == null || it > mHighestTemperature!!) {
|
||||
mHighestTemperature = it.toFloat()
|
||||
}
|
||||
if (mLowestTemperature == null || it < mLowestTemperature!!) {
|
||||
mLowestTemperature = it.toFloat()
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user