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 android.content.Context | |
import io.reactivex.Maybe | |
import io.reactivex.Observable | |
import io.reactivex.Single | |
class VkPhotoRepository(private val vkPhotosApi: VkPhotosApi, private val context: Context) { | |
fun getAlbums(): Single<List<AlbumItem>> { | |
val token = context.getString(R.string.vk_service_key) | |
val owner = context.getString(R.string.vk_owner_id).toLong() |
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 ConfigManager() { | |
@Volatile private var isDirty = true | |
@Volatile private var cachedConfig: String? = null | |
private var replay: ReplaySubject<String>? = null | |
fun getConfig(): Single<String> = Observable.concat(fromCache().toObservable(), fromServer().toObservable()).firstOrError() | |
private fun fromCache(): Maybe<String> = Maybe.create { | |
if (isCacheExists()) it.onSuccess(cachedConfig) else it.onComplete() |
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
-keep public class org.example.native.** { *; } |
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
G:\github\another-yet-bash-client>gradlew.bat tasks --stacktrace | |
:tasks | |
------------------------------------------------------------ | |
All tasks runnable from root project | |
------------------------------------------------------------ | |
:tasks FAILED | |
FAILURE: Build failed with an exception. |
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 com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; | |
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; | |
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; | |
import javax.xml.bind.annotation.XmlAccessType; | |
import javax.xml.bind.annotation.XmlAccessorType; | |
import java.util.List; | |
@JacksonXmlRootElement(localName = "doc") | |
@XmlAccessorType(XmlAccessType.FIELD) |
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 org.sample; | |
import java.util.ArrayList; | |
import static org.hamcrest.CoreMatchers.equalTo; | |
import static org.mockito.Matchers.argThat; | |
import static org.mockito.Mockito.mock; | |
import static org.mockito.Mockito.verify; | |
public class Sample { |