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
protocol Dao { | |
func insert(key: String, value: Any) -> Bool | |
func find(key: String) -> Any? | |
} | |
protocol StoreAdapterFactory { | |
func create() -> Dao | |
} | |
class StoreMemoryAdapter : Dao { |
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 FooPresenterTest { | |
private val view = mock<FooPresenterContract.View>() | |
private val presenter: FooPresenterContract.Presenter = FooPresenter(view) | |
@Test | |
fun testDoWork() { | |
presenter.doWork() | |
verify(view).inflated("it was success!") |
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
/** | |
* Implementation Detail | |
*/ | |
interface FooPresenterContract { | |
interface Presenter { | |
fun doWork() | |
} | |
interface View { | |
fun inflated(message: String) |
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
internal object DataStoreFactory { | |
private val mapToDataStore = ConcurrentHashMap<String, DataStore<Preferences>>() | |
fun create( | |
name: String, | |
context: Context | |
): DataStore<Preferences> { | |
if (mapToDataStore.containsKey(name).not()) { | |
mapToDataStore[name] = context.getDataStore( |
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
```groovy | |
afterEvaluate { | |
// All proguard tasks shall depend on our filter task | |
def proguardTasks = tasks.findAll { task -> | |
task.name.startsWith('transformClassesAndResourcesWithProguardFor') } | |
proguardTasks.each { task -> task.dependsOn filterConsumerRules } | |
} | |
// Let define our custom task that filters some unwanted | |
// consumer proguard rules |
OlderNewer