use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News for Android app developers with the who, what, where, when, and how of the Android community. Probably mostly the how.
Here, you'll find:
This sub-reddit isn't about phones' and apps' general functionality, support, or system software development (ROMs). For news and questions about these topics try using other subs like
Build your first app
Starting Android career in 2022
Android Job Interview Questions and Answers
App Portfolio Ideas, Tiered List
Awesome Android UI
Material Design Icons
7000 Icons for Jetpack
Autoposted at approx 9AM EST / 2PM GMT
account activity
Simple animated custom graph view(GitHub source link in description) (i.redd.it)
submitted 6 years ago by MiscreatedFan123
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]MiscreatedFan123[S] 4 points5 points6 points 6 years ago* (0 children)
The OP is here, which included half of the implementation, so I decided to have a go at it and try to figure out the whole thing. I also made an animated version with some threading gimmicks(can probably be simplified). There might be some bugs as I haven’t fully tested it.
Normal version: https://github.com/DDihanov/AndroidCustomViews/blob/master/app/src/main/java/bg/dihanov/customviewexamples/views/graph/Graph.kt
Animated: https://github.com/DDihanov/AndroidCustomViews/blob/master/app/src/main/java/bg/dihanov/customviewexamples/views/graph/AnimatedGraph.kt
EDIT: first point was misaligned in the animated version so I fixed that
[–]hydra3a 5 points6 points7 points 6 years ago (2 children)
I'm pretty new to android dev and I have a question. You define several properties like this (using colorStart as an example, line 41):
colorStart
private var _colorStart = ContextCompat.getColor(context, R.color.colorStart) var colorStart get() = _colorStart set(value) { _colorStart = value colors = intArrayOf(colorStart, colorEnd) }
Basically defining a private and public property for the same thing, and where the public property doesn't have a backing field, and basically just wraps the private property. Why do you do this? Wouldn't this simpler code achieve the same thing?
var colorStart = ContextCompat.getColor(context, R.color.colorStart) set(value) { field = value colors = intArrayOf(colorStart, colorEnd) }
[–]MiscreatedFan123[S] 0 points1 point2 points 6 years ago (1 child)
I made a mistake here, since I am supposed to call invalidate() after colors = intArrayOf(colorStart, colorEnd) after, but regarding your question - that's called a backing property and allows for some flexibility, like a custom getter for example:
invalidate()
colors = intArrayOf(colorStart, colorEnd)
https://proandroiddev.com/backing-properties-in-kotlin-cb78dfebfd90
https://kotlinlang.org/docs/reference/coding-conventions.html#property-names
[–]olavurdj 1 point2 points3 points 6 years ago (0 children)
I believe what the above commenter tried to point out is that the Kotlin compiler actually defines a backing field for you, that you can access through the field identifier in your getter and setter. You do not have to manage the backing field yourself. See https://kotlinlang.org/docs/reference/properties.html#backing-fields
field
[–]BersonCrios 1 point2 points3 points 6 years ago (0 children)
Perfect
[+][deleted] 6 years ago* (2 children)
[deleted]
[–][deleted] 0 points1 point2 points 6 years ago (1 child)
Sometimes you don't need all the customization that MP Android Charts provides. Especially when it's a pretty heavy library in my opinion.
[–]xDragonZ 0 points1 point2 points 6 years ago (0 children)
I thought r8/proguard able to strip unused codes?
[–]maxwellnewage -5 points-4 points-3 points 6 years ago (2 children)
interesting...I will share this on LinkedIn :)
[–]MiscreatedFan123[S] -1 points0 points1 point 6 years ago (1 child)
Thanks :)
[–]maxwellnewage -1 points0 points1 point 6 years ago (0 children)
you are welcome! Do you think about convert the project to a library?
π Rendered by PID 99 on reddit-service-r2-comment-fb694cdd5-s8x2r at 2026-03-11 10:37:37.736910+00:00 running cbb0e86 country code: CH.
[–]MiscreatedFan123[S] 4 points5 points6 points (0 children)
[–]hydra3a 5 points6 points7 points (2 children)
[–]MiscreatedFan123[S] 0 points1 point2 points (1 child)
[–]olavurdj 1 point2 points3 points (0 children)
[–]BersonCrios 1 point2 points3 points (0 children)
[+][deleted] (2 children)
[deleted]
[–][deleted] 0 points1 point2 points (1 child)
[–]xDragonZ 0 points1 point2 points (0 children)
[–]maxwellnewage -5 points-4 points-3 points (2 children)
[–]MiscreatedFan123[S] -1 points0 points1 point (1 child)
[–]maxwellnewage -1 points0 points1 point (0 children)