This file contains hidden or 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.blacklenspub.android.playground; | |
| import java.util.ArrayList; | |
| import java.util.Collection; | |
| import java.util.List; | |
| public class FilterableArrayList<T> extends ArrayList<T> { | |
| public FilterableArrayList(Collection<? extends T> c) { | |
| super(c); |
This file contains hidden or 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.blacklenspub.android.playground; | |
| import java.util.ArrayList; | |
| import java.util.Collection; | |
| import java.util.List; | |
| public class ListUtil { | |
| public static <T> List<T> filter(Iterable<T> source, Predicate<T> predicate) { | |
| return filterTo(source, new ArrayList<T>(), predicate); |
This file contains hidden or 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
| /** | |
| * Pros: | |
| * Super simple | |
| * | |
| * Cons: | |
| * You need to [UseCase1.toObservable] and [Observable.blockingFirst] to exit Rx world | |
| */ | |
| interface UseCase1<T> { | |
| fun toObservable(): Observable<T> | |
| } |
This file contains hidden or 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 net.appsynth.seven.domain | |
| import io.reactivex.Completable | |
| import io.reactivex.Observable | |
| import net.appsynth.seven.models.promotion.PromotionData | |
| object UseCase4 | |
| fun UseCase4.getPrepaid(): Observable<PromotionData> { | |
| TODO() |
This file contains hidden or 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 SampleTest { | |
| lateinit var driver: AppiumDriver<WebElement> | |
| val platform = MobilePlatform.IOS | |
| @Before | |
| fun setup() { | |
| if (platform == MobilePlatform.ANDROID) { | |
| val dir = System.getProperty("user.dir") | |
| val path = Paths.get(dir, "apps/hello-appium.apk") |
This file contains hidden or 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 SampleTest { | |
| lateinit var driver: AppiumDriver<WebElement> | |
| val platform = MobilePlatform.ANDROID | |
| @Before | |
| fun setup() { | |
| if (platform == MobilePlatform.ANDROID) { | |
| val dir = System.getProperty("user.dir") | |
| val path = Paths.get(dir, "apps/hello-appium.apk") |
This file contains hidden or 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 MainPage(driver: AppiumDriver<WebElement>) { | |
| init { | |
| PageFactory.initElements(AppiumFieldDecorator(driver), this) | |
| } | |
| @AndroidFindBy(id = "com.blacklenspub.helloappium:id/tvLabel") | |
| @iOSFindBy(xpath = "//XCUIElementTypeStaticText[1]") | |
| lateinit var myLabel: WebElement | |
| @AndroidFindBy(id = "com.blacklenspub.helloappium:id/btnGreet") |
This file contains hidden or 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 Car { | |
| val engine = Engine() | |
| fun start() { | |
| engine.start() | |
| } | |
| } | |
| class Engine { | |
| fun start() = //... | |
| } |
This file contains hidden or 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 { | |
| implementation 'com.google.code.gson:gson:2.8.5' | |
| } |
This file contains hidden or 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 Car(val engine: Engine) { | |
| fun start() { | |
| engine.start() | |
| } | |
| } |