This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Quit Android Studio | |
Android Studio → Tools → Kotlin → Configure Kotlin in Project | |
Clean build | |
😰 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
※It might not work... | |
※I tried Parceler and PaperParcel, But I don't use Parcelable Library by Kotlin. | |
1. Remove apply plugin: 'com.neenbedankt.android-apt' | |
2. Change dependencies kapt to apt | |
dependencies { | |
… | |
kapt 'com.github.grandstaish.paperparcel:compiler:1.0.0' | |
↓ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// recommend class.java.simpleName is not wrapped | |
private val LogTag = MainActivity::class.java.simpleName | |
// deprecate class.simpleName is wrapped. | |
private val LogTag = MainActivity::class.simpleName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum class HttpStatusCode(val value: Int) { | |
Default(0), | |
Continue(100), | |
SwitchingProtocols(101), | |
Processing(102), | |
Ok(200), | |
Created(201), | |
Accepted(202), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val value: T | |
when(value) { | |
is String -> ... | |
is Int -> ... | |
else -> ... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env/ python | |
# coding:utf-8 | |
import numpy as np | |
import chainer.links as L | |
from chainer import functions as F | |
from chainer import Variable, optimizers, Chain | |
class Model(Chain): | |
def __init__(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env/ python | |
# coding:utf-8 | |
import numpy as np | |
import chainer.links as L | |
from chainer import functions as F | |
from chainer import Variable, optimizers, Chain | |
class Model(Chain): | |
def __init__(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env/ python | |
# coding:utf-8 | |
import numpy as np | |
import chainer.links as L | |
from chainer import functions as F | |
from chainer import Variable, optimizers, Chain | |
class Model(Chain): | |
def __init__(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Notify scroll | |
class ObservableScrollView : ScrollView { | |
interface OnScrollChangeListener { | |
fun OnScrollChangeListener(scrollView: ObservableScrollView, x: Int, y: Int, oldX: Int, oldY: Int) | |
} | |
var onScrollChangeListener: OnScrollChangeListener? = null | |
constructor(context: Context) : this(context, null) | |
constructor(context: Context, attrs: AttributeSet?) : this(context, attrs, 0) | |
constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : super(context, attrs, defStyleAttr) |
OlderNewer