MindfulCircleView

class MindfulCircleView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0) : View(source)

Custom circular progress view that displays mindful time vs doom scrolling time.

This view shows a circular arc with:

  • Blue arc representing doom scrolling time
  • Green arc representing avoided/mindful time
  • Percentage text showing mindful percentage
  • Animated end-cap indicator

The progress is calculated as: doomMs / (doomMs + avoidedMs)

See also

Constructors

Link copied to clipboard
constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0)

Functions

Link copied to clipboard
protected open override fun onDraw(c: Canvas)
Link copied to clipboard
protected open override fun onMeasure(w: Int, h: Int)
Link copied to clipboard
fun setFromCounts(avoidedCount: Int, doomCount: Int)

Sets the progress from count values (doom count vs avoided count).

Link copied to clipboard
fun setFromTimes(avoidedMs: Long, doomMs: Long)
Link copied to clipboard

Sets the progress directly from a ratio (0.0 to 1.0).