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
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.support.annotation.NonNull; | |
import android.text.Editable; | |
import android.text.Spannable; | |
import android.text.TextWatcher; | |
import android.text.style.ReplacementSpan; | |
public class ExpiryDateTextWatcher implements TextWatcher { | |
private int maxLength = 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
data class Stock( | |
val name: String, | |
val ticker: String, | |
val price: BigDecimal, | |
val priceDailyChange: BigDecimal = BigDecimal.ZERO, | |
val logoUrl: String? = null | |
) |
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
interface StockListFeatureApi : Api { | |
val interactor: StockListInteractor | |
} |
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
import io.reactivex.Maybe | |
import io.reactivex.Single | |
interface StockListInteractor { | |
fun stocks(): Single<List<Stock>> | |
fun stock(ticker: String): Maybe<Stock> | |
} |
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
import retrofit2.Retrofit | |
interface NetworkCoreLibApi : Api { | |
fun retrofit(): Retrofit | |
} |
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 DefaultStockListInteractor @Inject constructor() : StockListInteractor { | |
override fun stocks(): Single<List<Stock>> { | |
throw UnsupportedOperationException("Not implemented") | |
} | |
override fun stock(ticker: String): Maybe<Stock> { | |
throw UnsupportedOperationException("Not implemented") | |
} | |
} |
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 FakeStockListInteractor @Inject constructor() : StockListInteractor { | |
override fun stocks(): Single<List<Stock>> = | |
Single.just( | |
listOf( | |
Stock( | |
name = "Apple Inc.", | |
ticker = "AAPL", | |
price = 131.93.money() | |
), |
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
// :feature:stock_list:impl/build.gradle.kts | |
plugins { | |
id("kotlin") | |
} | |
dependencies { | |
api(project(":feature:stock_list:api")) | |
} |
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
@Module | |
interface FakeStockListFeatureModule { | |
@Binds | |
@Reusable | |
fun interactor(impl: FakeStockListInteractor): StockListInteractor | |
} |
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
@Component( | |
modules = [ | |
FakeStockListFeatureModule::class // publish reasonable alternative for StockListInteractor | |
] | |
) | |
interface FakeStockListFeatureComponent : StockListFeatureApi |
OlderNewer