Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Room Park Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav Bogdashkin
Room Park Android
Commits
b29f0f10
Commit
b29f0f10
authored
Sep 19, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
preview of statusprogress view ceil
parent
123a4254
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
0 deletions
+75
-0
StatusProgressCeil.kt
...ark/view_utils/status_progress_view/StatusProgressCeil.kt
+75
-0
No files found.
app/src/main/java/com/biganto/visual/roompark/view_utils/status_progress_view/StatusProgressCeil.kt
0 → 100644
View file @
b29f0f10
package
com.biganto.visual.roompark.view_utils.status_progress_view
import
android.content.Context
import
android.graphics.Canvas
import
android.graphics.Color
import
android.graphics.Paint
import
android.graphics.PointF
import
android.util.AttributeSet
import
android.view.View
/**
* Created by Vladislav Bogdashkin on 19.09.2019.
*/
class
StatusProgressCeil
@JvmOverloads
constructor
(
context
:
Context
,
attrs
:
AttributeSet
?
=
null
,
defStyleAttr
:
Int
=
0
)
:
View
(
context
,
attrs
,
defStyleAttr
)
{
private
var
direction
:
StatusProgressDirection
=
StatusProgressDirection
.
HORIZONTAL
private
val
fillEnableColor
:
Int
=
Color
.
WHITE
private
val
fillDisableColor
:
Int
=
Color
.
CYAN
private
val
enablePaint
:
Paint
=
Paint
()
get
(){
field
.
style
=
Paint
.
Style
.
STROKE
field
.
strokeWidth
=
3F
field
.
color
=
fillEnableColor
return
field
}
private
val
disablePaint
:
Paint
=
Paint
()
get
(){
field
.
style
=
Paint
.
Style
.
STROKE
field
.
strokeWidth
=
3F
field
.
color
=
fillEnableColor
return
field
}
private
val
enableRadius
:
Float
get
()
{
return
when
(
direction
){
StatusProgressDirection
.
HORIZONTAL
->
height
/
2f
StatusProgressDirection
.
VERTICAL
->
width
/
2f
}}
private
val
disableRadius
:
Float
get
()
{
return
when
(
direction
){
StatusProgressDirection
.
HORIZONTAL
->
height
/
2f
StatusProgressDirection
.
VERTICAL
->
width
/
2f
}}
private
var
enableDisableCrossRadius
:
Int
=
0
private
val
centerStatus
:
PointF
get
()
{
return
when
(
direction
){
StatusProgressDirection
.
HORIZONTAL
->
PointF
(
width
/
2f
,
height
/
2f
)
StatusProgressDirection
.
VERTICAL
->
PointF
(
width
/
2f
,
height
/
2f
)
}
}
override
fun
onDraw
(
canvas
:
Canvas
?)
{
super
.
onDraw
(
canvas
)
canvas
?.
drawColor
(
Color
.
TRANSPARENT
)
canvas
?.
drawCircle
(
centerStatus
.
x
,
centerStatus
.
y
,
enableRadius
,
enablePaint
)
}
}
enum
class
StatusProgressDirection
{
HORIZONTAL
,
VERTICAL
}
\ No newline at end of file
Write
Preview
Markdown
is supported
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