Reformat source code

pull/1929/head
Alinson S. Xavier 2 years ago
parent 45a82b3c2d
commit 248ba50a8e
Signed by: isoron
GPG Key ID: 0DA8E4B9E1109DCA

@ -157,7 +157,7 @@ class RingView : View {
pRing!!.xfermode = XFERMODE_CLEAR pRing!!.xfermode = XFERMODE_CLEAR
} else { } else {
pRing!!.color = pRing!!.color =
backgroundColor!! backgroundColor!!
} }
rect!!.inset(thickness, thickness) rect!!.inset(thickness, thickness)
activeCanvas.drawArc(rect!!, 0f, 360f, true, pRing!!) activeCanvas.drawArc(rect!!, 0f, 360f, true, pRing!!)
@ -165,17 +165,17 @@ class RingView : View {
pRing!!.color = color pRing!!.color = color
pRing!!.textSize = textSize pRing!!.textSize = textSize
if (isStrokedTextEnabled){ if (isStrokedTextEnabled) {
pRing!!.style = Paint.Style.STROKE pRing!!.style = Paint.Style.STROKE
pRing!!.strokeWidth = textSize / 15f pRing!!.strokeWidth = textSize / 15f
} }
if (enableFontAwesome) pRing!!.typeface = getFontAwesome(context) if (enableFontAwesome) pRing!!.typeface = getFontAwesome(context)
activeCanvas.drawText( activeCanvas.drawText(
text!!, text!!,
rect!!.centerX(), rect!!.centerX(),
rect!!.centerY() + 0.4f * em, rect!!.centerY() + 0.4f * em,
pRing!! pRing!!
) )
} }
if (activeCanvas !== canvas) canvas.drawBitmap(internalDrawingCache!!, 0f, 0f, null) if (activeCanvas !== canvas) canvas.drawBitmap(internalDrawingCache!!, 0f, 0f, null)

@ -146,14 +146,14 @@ class CheckmarkWidgetView : HabitWidgetView {
} }
ring.setThickness(0.03f * width) ring.setThickness(0.03f * width)
super.onMeasure( super.onMeasure(
MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY) MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY)
) )
} }
private fun init() { private fun init() {
val appComponent: HabitsApplicationComponent = val appComponent: HabitsApplicationComponent =
(context.applicationContext as HabitsApplication).component (context.applicationContext as HabitsApplication).component
preferences = appComponent.preferences preferences = appComponent.preferences
ring = findViewById<View>(R.id.scoreRing) as RingView ring = findViewById<View>(R.id.scoreRing) as RingView
label = findViewById<View>(R.id.label) as TextView label = findViewById<View>(R.id.label) as TextView

Loading…
Cancel
Save