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 LibOptions(config1: String, config2: String) { | |
fun toHttpUrl(): HttpUrl { | |
httpUrlBuilder = super().newBuilder() | |
httpUrlBuilder.addQueryParameter("option_1", option1) | |
httpUrlBuilder.addQueryParameter("option_2", option2) | |
return httpUrlBuilder.build() | |
} | |
} |
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 LibClient(val libOptions: LibOptions) { | |
lazy val reqFactory: OkRequestFactory | |
fun init() { | |
reqFactory = OkRequestFactory(libOptions) | |
} | |
fun getUser(userRequest: UserRequest): UserResponse { | |
val okRequest = reqFactory.toOkRequest(userRequest) | |
// execute request, and parse response |
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
public class App extends Application { | |
private AppComponent appComponent; | |
@Override | |
public void onCreate() { | |
appComponent = DaggerAppComponent | |
.module1(new Module1()) | |
.etcModule(new EtcModule()) | |
.build(); | |
} |
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
dependencies { | |
implementation "com.google.dagger:dagger:2.11" | |
} |
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
dependencies { | |
implementation “com.google.dagger:dagger:$versions.daggerVersion” | |
} |
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
dependencies { | |
implementation deps.dagger | |
} |
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
dependencies { | |
implementation deps.retrofit | |
implementation deps.retrofitGson | |
} |
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
dependencies { | |
implementation "com.squareup.retrofit2:retrofit:2.3.0" | |
implementation "com.squareup.retrofit2:converter-gson:2.3.0" | |
} |
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
dependencies { | |
implementation "com.google.dagger:dagger:2.11" | |
} |
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
dependencies { | |
implementation deps.dagger | |
} |