シングルトンの代替え (Dagger通さなくてもいいやつ)
staticの代替え
例えばHogeActivity.createIntent()など
あと定数とかね
| public inline fun <T, R> T.nullWithBlock(block: T.() -> Unit): R? = run { | |
| block() | |
| null | |
| } |
| override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { | |
| val binding = parent.inflateBinding<ListItemCommentBinding>() | |
| return ViewHolder(binding) | |
| } |
| inline fun withBeforeAfter( | |
| before: () -> Unit, | |
| after: () -> Unit, | |
| block: () -> Unit | |
| ) { | |
| before() | |
| block() | |
| after() | |
| } |
| // for processing program. | |
| import ddf.minim.*; | |
| import ddf.minim.analysis.*; | |
| import ddf.minim.effects.*; | |
| import ddf.minim.signals.*; | |
| import ddf.minim.spi.*; | |
| import ddf.minim.ugens.*; | |
| import com.jogamp.opengl.GL; | |
| import com.jogamp.opengl.GL2ES2; |
| package kotlinx.coroutines.android | |
| import rx.Observable | |
| import rx.android.schedulers.AndroidSchedulers | |
| import rx.schedulers.Schedulers | |
| fun asyncAndroid( | |
| coroutine c: RxController<Unit>.() -> Continuation<Unit> | |
| ) { | |
| val controller = RxController<Unit>() |
| # Script Name : fabfile.py | |
| # Author : shikajiro | |
| # Created : 2016-11-03 | |
| # Last Modified : 2016-11-03 | |
| # Version : 1.0.0 | |
| # Modifications : | |
| # Description : | |
| # Script to perform the build of Android on another machine | |
| # By performing such a build of severely time on another machine, | |
| # it is possible to ensure the CPU resources of the development machine, |
| fun given(description: String, given: Given.() -> Unit) { | |
| given.invoke(Given()) | |
| } | |
| class Given { | |
| fun on(description: String, on: On.() -> Unit) { | |
| on.invoke(On()) | |
| } | |
| } |