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
android.applicationVariants.all { | |
def aptOutputDir = new File(buildDir, "generated/source/apt/${it.unitTestVariant.dirName}") | |
it.unitTestVariant.addJavaSourceFoldersToModel(aptOutputDir) | |
} |
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.example; | |
import javax.inject.Scope; | |
import javax.inject.Singleton; | |
import dagger.Component; | |
import dagger.Module; | |
import dagger.Provides; | |
import dagger.Subcomponent; |
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
/** | |
* MIT License | |
* | |
* Copyright (c) 2017 Dandré Allison | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
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
// https://akarnokd.blogspot.ru/2017/09/rxjava-vs-kotlin-coroutines-quick-look.html | |
import kotlinx.coroutines.experimental.* | |
suspend fun f1(i: Int): Int { | |
Thread.sleep(if (i != 2) 2000L else 200L) | |
return 1 | |
} | |
suspend fun f2(i: Int): Int { | |
Thread.sleep(if (i != 2) 2000L else 200L) |
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 ch.pboos.android.sample.viewpager; | |
import android.os.Bundle; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentActivity; | |
import android.support.v4.app.FragmentPagerAdapter; | |
import android.support.v4.view.ViewPager; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; |
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
@Component(modules=MyModule.class) | |
@ApplicationScope | |
public interface MyComponent { | |
void inject(MyApplication application); | |
} | |
@Module | |
public class MyModule { | |
@Provides @ApplicationScope |
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
@Scope | |
public @interface ActivityScope { | |
} |
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
/// Pack For XCode | |
val packForXcode by tasks.creating(Sync::class) { | |
group = "build" | |
val mode = System.getenv("CONFIGURATION") ?: "DEBUG" | |
val sdkName = System.getenv("SDK_NAME") ?: "iphonesimulator" | |
val targetName = "ios" + if (sdkName.startsWith("iphoneos")) "Arm64" else "X64" | |
val framework = kotlin.targets.getByName<KotlinNativeTarget>(targetName).binaries.getFramework(mode) | |
inputs.property("mode", mode) | |
dependsOn(framework.linkTask) | |
val targetDir = File(buildDir, "xcode-frameworks") |
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 LMCustomerSDK // Your Kotlin Multiplatform Library | |
import RxSwift | |
struct RxAsyncResult<ResultElement: AnyObject> { | |
#if targetEnvironment(simulator) | |
let async: AsyncResult<ResultElement> | |
#else | |
let async: AsyncResult | |
#endif |
OlderNewer