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
{ | |
"name": "gulp-test", | |
"version": "0.0.0", | |
"authors": [ | |
"featZima <[email protected]>" | |
], | |
"license": "MIT", | |
"ignore": [ | |
"**/.*", | |
"node_modules", |
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
// добавить файлы в индекс (изменившиеся или новые) | |
git add <filename> | |
// сделать локальный коммит | |
git commit -m "<commit comment>" | |
// отправить все локальные коммиты на сервер | |
git push |
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
class MainViewModel : DisposableViewModel() { | |
val title = ChannelLiveData("New Title 0") | |
val isReady = ChannelLiveData(false) | |
init { | |
disposableLaunch { | |
(1..Int.MAX_VALUE).forEach { time -> | |
delay(1, TimeUnit.SECONDS) | |
title.send("New Title $time") | |
} |
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
data class MyViewModel( | |
private val myEndpoint: MyEndpoint): DisposableViewModel() { | |
private val searchText = ChannelLiveData("") | |
private val inProgress = ChannelLiveData(false) | |
private val result = ChannelLiveData("") | |
init { | |
disposableLaunch { | |
searchText |
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
data class MyViewModel( | |
private val myEndpoint: MyEndpoint): DisposableViewModel() { | |
private val searchText = ChannelLiveData("") | |
private val inProgress = ChannelLiveData(false) | |
private val result = ChannelLiveData("") | |
init { | |
disposableLaunch { | |
searchText.consumeEach { searchText -> |
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
import java.io.File | |
interface IProjectDetector { | |
fun isProjectRootFolder(folder: File): Boolean | |
} | |
interface IProjectCleaner { | |
fun clean(folder: File) | |
} |
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
class CompositeAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder>() { | |
var adapters: List<RecyclerView.Adapter<RecyclerView.ViewHolder>> by adapterProperty(emptyList()) | |
fun addAdapter(adapter: RecyclerView.Adapter<out RecyclerView.ViewHolder>) { | |
@Suppress("UNCHECKED_CAST") | |
adapters = adapters.plus(adapter as RecyclerView.Adapter<RecyclerView.ViewHolder>) | |
adapter.registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() { | |
override fun onChanged() { | |
notifyDataSetChanged() |
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
package com.olearis.notate.ui.screen.settinglist | |
import androidx.arch.core.executor.testing.InstantTaskExecutorRule | |
import com.nhaarman.mockitokotlin2.times | |
import com.olearis.notate.interactor.INoteInteractor | |
import com.olearis.notate.interactor.INoteListInteractor | |
import com.olearis.notate.model.SortCriteria | |
import com.olearis.notate.model.SortDirection | |
import com.olearis.notate.model.SortOrder | |
import com.olearis.notate.model.UniId |
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
inline fun <R> Cursor.map(transform: (Cursor) -> R): List<R> { | |
val result = ArrayList<R>(count) | |
while (moveToNext()) { | |
result.add(transform(this)) | |
} | |
return result | |
} |
OlderNewer