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
| fun pullScreenshots(): File { | |
| val screenshotPath = "/data/local/tmp/screenshots/<file_name_here>.png" | |
| // 1 | |
| dadb.shell("screencap -p $screenshotPath") | |
| // 2 | |
| val outputFile = File.createTempFile(outputFileName, ".txt") | |
| val bufferedSink = outputFile.sink().buffer() | |
| dadb.pull(bufferedSink, logFilePath) | |
| return outputFile | |
| } |
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
| fun pullLogs(): File { | |
| val logFilePath = "/data/local/tmp/logs/<file_name_here>.txt" | |
| // 1 | |
| dadb.shell("logcat -v time -f $logFilePath -d") | |
| // 2 | |
| val outputFile = File.createTempFile(outputFileName, ".txt") | |
| val bufferedSink = outputFile.sink().buffer() | |
| dadb.pull(bufferedSink, logFilePath) | |
| return outputFile | |
| } |
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 dadb.AdbShellResponse | |
| import dadb.Dadb | |
| import okio.Sink | |
| import okio.buffer | |
| import okio.sink | |
| import java.io.File | |
| import java.io.IOException | |
| import java.text.SimpleDateFormat | |
| import java.util.Date | |
| import java.util.Locale |
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
| private val zipDataChannel = Channel<List<FeedItem>>(2) | |
| // Async coroutine builder for latest movies | |
| fun loadLatestMoviesAsync() = | |
| scope.async(coroutinesDispatcherProvider.io) { | |
| moviesRepository.getLatestMovies()?.let { | |
| zipDataChannel.send(it) | |
| } | |
| } | |
| // Async coroutine for popular movies |
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
| this.providesRetrofitProvider = | |
| DoubleCheck.provider(NetModule_ProvidesRetrofitFactory.create(builder.netModule)); |
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
| public final class ActivityModule_ProvideMainViewModelFactory implements Factory<MainViewModel> { | |
| /*Other code*/ | |
| @Override | |
| public MainViewModel get() { | |
| return Preconditions.checkNotNull( | |
| module.provideMainViewModel(dataManagerProvider.get()), | |
| "Cannot return null from a non-@Nullable @Provides method"); | |
| } | |
| } |
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
| public final class DaggerActivityComponent implements ActivityComponent{ | |
| /**Other code**/ | |
| @Override | |
| public void inject(MainActivity mainActivity) { | |
| mainActivityMembersInjector.injectMembers(mainActivity); | |
| } | |
| } |
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
| private void initialize(final Builder builder) { | |
| /**Other Code**/ | |
| this.provideMainViewModelProvider = ActivityModule_ProvideMainViewModelFactory.create( | |
| builder.activityModule, dataManagerProvider); | |
| this.mainActivityMembersInjector = MainActivity_MembersInjector | |
| .create(provideMainViewModelProvider); | |
| } |
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
| public static final class Builder { | |
| /**Other code**/ | |
| public ActivityComponent build() { | |
| if (activityModule == null) { | |
| throw new IllegalStateException(ActivityModule.class.getCanonicalName() + " must be set"); | |
| } | |
| if (appComponent == null) { | |
| throw new IllegalStateException(AppComponent.class.getCanonicalName() + " must be set"); | |
| } | |
| return new DaggerActivityComponent(this); |
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
| val activityComponent = DaggerActivityComponent | |
| .builder() | |
| .appComponent(InitApp.get(this).component()) | |
| .activityModule(ActivityModule(SchedulerProvider())) | |
| .build() | |
| activityComponent.inject(this) |
NewerOlder