I hereby claim:
- I am omuomugin on github.
- I am omuomugin (https://keybase.io/omuomugin) on keybase.
- I have a public key ASAZCSIG2Qm2EQGhNn2kbQCmBH4zb39tXhuQfnKu0puGpgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# see also https://developer.android.com/jetpack/androidx/migrate/artifact-mappings for all the artifacts which are mapped androidx | |
./gradlew :app:dependencies | grep -e android.arch.core:common -e android.arch.core:core -e android.arch.core:core-testing -e android.arch.core:runtime -e android.arch.lifecycle:common -e android.arch.lifecycle:common-java8 -e android.arch.lifecycle:compiler -e android.arch.lifecycle:extensions -e android.arch.lifecycle:livedata -e android.arch.lifecycle:livedata-core -e android.arch.lifecycle:reactivestreams -e android.arch.lifecycle:runtime -e android.arch.lifecycle:viewmodel -e android.arch.paging:common -e android.arch.paging:runtime -e android.arch.paging:rxjava2 -e android.arch.persistence.room:common -e android.arch.persistence.room:compiler -e android.arch.persistence.room:guava -e android.arch.persistence.room:migration -e android.arch.persistence.room:runtime -e android.arch.persistence.room:rxjava2 -e android.arch.persistence.room:testing -e android.arch.persistence:db |
// これはだめ | |
fun foo(s: String?) { | |
print(s.toUpperCase()) // s は nullable なので s? or s!! しないとメソッド呼び出しできない | |
} | |
// これはok | |
fun foo(s: String?) { | |
requireNotNull(s) // not null であることが事前条件に書かれてるのでこれ以降のスコープでは nonnullとして スマートキャストされる | |
print(s.toUpperCase()) | |
} |
fun unionFun(val a: {Hoge | Fuga | Poyo}) { | |
// only Hoge, Fuga, Poyo can pass to this function | |
// still you should cast them using instanceof | |
// but you know that only Hoge, Fuga and Poyo should be target of instance of | |
// so you can cover all the types that you want to do something | |
} |
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<color name="colorPrimary">@color/indigo_500</color> | |
<color name="colorPrimaryDark">@color/indigo_700</color> | |
<color name="colorAccent">@color/pink_A200</color> | |
<color name="red_50">#FFEBEE</color> | |
<color name="red_100">#FFCDD2</color> | |
<color name="red_200">#EF9A9A</color> | |
<color name="red_300">#E57373</color> |
if condition: | |
# do something | |
else condition1: | |
if condition2: | |
# else-if 1 | |
else condition3: | |
if condition4: | |
# else-if 2 | |
if condition: |