Skip to content

Instantly share code, notes, and snippets.

private class Outer {
val outerValue = "Outer value"
inner class ReallyInnerClass {
fun printOuterValue() {
println(outerValue)
}
}
sealed class WeatherEvent
class Rain : WeatherEvent()
class Snow : WeatherEvent()
class Fire : WeatherEvent()
class Performer() {
fun perform(event: WeatherEvent) {
class Circle(val radius:Int = 15) {
val name = "My Circle"
val color:Int
init{
color = 0x555556
}
}
class Shape(
val radius: Int = 15,
val color: Int = 12345,
val shapeName: String = "My Circle",
val strokeWidth: Float = 35.55f,
val id: Long = -1L
)
class Shape(
val radius: Int = 15,
val color: Int = 12345,
val shapeName: String = "My Circle",
val strokeWidth: Float = 35.55f,
val id: Long = -1L
)
fun main() {
Shape(radius = 1)
Shape(radius = 3, id = 100)
Shape(radius = 3,
color = 121212,
shapeName = "triangle",
strokeWidth = 22f,
id = 100)
@yuriyskulskiy
yuriyskulskiy / colors.xml
Last active June 18, 2020 12:12
Gists for simple neon progress bar (Java)
<resources>
...
<color name="neon_body">#BEFF09</color>
<color name="neon_glow">#CBBCFF00</color>
</resources>
public class GradientCircularProgressBar extends View {
public GradientCircularProgressBar(Context context) {
super(context);
init();
}
public GradientCircularProgressBar(Context context,
AttributeSet attrs) {
super(context, attrs);
public class GradientCircularProgressBar extends View {
private static final int BODY_STROKE_WIDTH = 12;
private static final int GLOW_STROKE_WIDTH = BODY_STROKE_WIDTH * 3;
private static final int PADDING = GLOW_STROKE_WIDTH / 2;
private static final int BODY_LENGTH = 270;
...
...
private static final int BODY_LENGTH = 270;
private float mPaddingPx;
private float mBodyStrokeWidthPx;
private float mGlowStrokeWidthPx;
...