I hereby claim:
- I am StylingAndroid on github.
- I am stylingandroid (https://keybase.io/stylingandroid) on keybase.
- I have a public key whose fingerprint is B3F2 DD7F E0BC 2542 F33F D7A5 07DC C222 845A 5B74
To claim this, I am signing this object:
fun main() { | |
val classThree = ClassThree() | |
val color3 = classThree.obtainColor(context, R.color.my_color, ContextCompat::getColor) | |
} | |
class ClassThree { | |
fun obtainColor(context: Context, colorRes: Int, colorLookup: (Context, Int) -> Int) = colorLookup(context, colorRes) | |
} |
classTwo.obtainColor(R.color.my_color) { | |
Color.RED | |
} |
fun main() { | |
val classOne = ClassOne() | |
val color1 = classOne.obtainColor(context, R.color.my_color) | |
val classTwo = ClassTwo() | |
classTwo.obtainColor(R.color.my_color, context.resources::getColor) | |
} |
fun main() { | |
val classOne = ClassOne() | |
val classTwo = ClassTwo() | |
classTwo.myFunc(true, classOne::doSomething) | |
} | |
class ClassOne { | |
private val output = "Hello, world!!!" | |
fun main() { | |
myFunc(true, ::doSomething) | |
} | |
fun doSomething() { | |
println("Hello, world!!!") | |
} | |
fun myFunc(someCondition: Boolean, funcRef: () -> Unit) { | |
if (someCondition) { |
fun main() { | |
myFunc(false) { | |
println("Hello, world!!!") | |
} | |
} | |
fun myFunc(someCondition: Boolean, funcRef: () -> Unit) { | |
if (someCondition) { | |
funcRef() | |
} |
I hereby claim:
To claim this, I am signing this object:
import com.google.gson.annotations.SerializedName; | |
public class GsonClass { | |
private static final String EMPTY = ""; | |
@SerializedName("mandatory") | |
private String mandatory; | |
@SerializedName("optional") | |
private String optional; | |