Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
GmsCore
Commits
5b50e246
Commit
5b50e246
authored
Feb 20, 2021
by
Fynn Godau
Committed by
Marvin W.
Feb 23, 2021
Browse files
EN: Hide legend if no data is to be displayed
parent
412e513a
Changes
1
Hide whitespace changes
Inline
Side-by-side
play-services-nearby-core-ui/src/main/kotlin/org/microg/gms/nearby/core/ui/DotChartView.kt
View file @
5b50e246
...
...
@@ -181,13 +181,15 @@ class DotChartView : View {
fontPaint
.
getTextBounds
(
strNoRecords
,
0
,
strNoRecords
.
length
,
fontTempRect
)
canvas
.
drawText
(
strNoRecords
,
(
subLeft
+
perWidth
+
4
*
d
).
toFloat
(),
(
subTop
+
perHeight
/
2.0
+
fontTempRect
.
height
()
/
2.0
).
toFloat
(),
fontPaint
)
canvas
.
drawMyRect
((
subLeft
+
(
perWidth
+
innerPadding
)
*
1
+
12
*
d
+
fontTempRect
.
width
()).
toFloat
(),
subTop
.
toFloat
(),
perWidth
.
toFloat
(),
perHeight
.
toFloat
(),
accentColor
and
0xffffff
)
canvas
.
drawMyRect
((
subLeft
+
(
perWidth
+
innerPadding
)
*
2
+
12
*
d
+
fontTempRect
.
width
()).
toFloat
(),
subTop
.
toFloat
(),
perWidth
.
toFloat
(),
perHeight
.
toFloat
(),
accentColor
and
(
80
shl
24
or
0xffffff
))
canvas
.
drawMyRect
((
subLeft
+
(
perWidth
+
innerPadding
)
*
3
+
12
*
d
+
fontTempRect
.
width
()).
toFloat
(),
subTop
.
toFloat
(),
perWidth
.
toFloat
(),
perHeight
.
toFloat
(),
accentColor
and
(
170
shl
24
or
0xffffff
))
canvas
.
drawMyRect
((
subLeft
+
(
perWidth
+
innerPadding
)
*
4
+
12
*
d
+
fontTempRect
.
width
()).
toFloat
(),
subTop
.
toFloat
(),
perWidth
.
toFloat
(),
perHeight
.
toFloat
(),
accentColor
)
if
(
maxValue
>=
0
)
{
canvas
.
drawMyRect
((
subLeft
+
(
perWidth
+
innerPadding
)
*
1
+
12
*
d
+
fontTempRect
.
width
()).
toFloat
(),
subTop
.
toFloat
(),
perWidth
.
toFloat
(),
perHeight
.
toFloat
(),
accentColor
and
0xffffff
)
canvas
.
drawMyRect
((
subLeft
+
(
perWidth
+
innerPadding
)
*
2
+
12
*
d
+
fontTempRect
.
width
()).
toFloat
(),
subTop
.
toFloat
(),
perWidth
.
toFloat
(),
perHeight
.
toFloat
(),
accentColor
and
(
80
shl
24
or
0xffffff
))
canvas
.
drawMyRect
((
subLeft
+
(
perWidth
+
innerPadding
)
*
3
+
12
*
d
+
fontTempRect
.
width
()).
toFloat
(),
subTop
.
toFloat
(),
perWidth
.
toFloat
(),
perHeight
.
toFloat
(),
accentColor
and
(
170
shl
24
or
0xffffff
))
canvas
.
drawMyRect
((
subLeft
+
(
perWidth
+
innerPadding
)
*
4
+
12
*
d
+
fontTempRect
.
width
()).
toFloat
(),
subTop
.
toFloat
(),
perWidth
.
toFloat
(),
perHeight
.
toFloat
(),
accentColor
)
val
strRecords
=
context
.
getString
(
R
.
string
.
pref_exposure_rpis_histogram_legend_records
,
"0 - $maxValue"
)
canvas
.
drawText
(
strRecords
,
(
subLeft
+
(
perWidth
+
innerPadding
)
*
4
+
16
*
d
+
fontTempRect
.
width
()
+
perWidth
).
toFloat
(),
(
subTop
+
perHeight
/
2.0
+
fontTempRect
.
height
()
/
2.0
).
toFloat
(),
fontPaint
)
val
strRecords
=
context
.
getString
(
R
.
string
.
pref_exposure_rpis_histogram_legend_records
,
"0 - $maxValue"
)
canvas
.
drawText
(
strRecords
,
(
subLeft
+
(
perWidth
+
innerPadding
)
*
4
+
16
*
d
+
fontTempRect
.
width
()
+
perWidth
).
toFloat
(),
(
subTop
+
perHeight
/
2.0
+
fontTempRect
.
height
()
/
2.0
).
toFloat
(),
fontPaint
)
}
if
(
focusHour
!=
-
1
&&
Build
.
VERSION
.
SDK_INT
>=
23
)
{
val
floatingColor
=
context
.
resolveColor
(
androidx
.
appcompat
.
R
.
attr
.
colorBackgroundFloating
)
?:
0
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment