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
| version: 2 | |
| jobs: | |
| build: | |
| working_directory: ~/code | |
| docker: | |
| - image: circleci/android:api-28-alpha | |
| environment: | |
| JVM_OPTS: -Xmx3200m | |
| steps: | |
| - checkout |
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
| packagingOptions { | |
| exclude "lib/armeabi/libsnappydb-native.so" | |
| exclude "lib/mips/libsnappydb-native.so" | |
| exclude "lib/mips64/libsnappydb-native.so" | |
| } | |
| Exclude not very useful libs |
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 SendDataJob(private val dataInput: SomeDataClass) : | |
| Job(Params(1).requireNetwork().persist().groupBy(“tag”)), KoinComponent { | |
| // job is queued, need to update local storage | |
| override fun onAdded() { | |
| } | |
| @Throws(Throwable::class) | |
| override fun onRun() { | |
| val sendService: SendService? by inject() | |
| sendService?.sendData(dataInput) |
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 SendDataWorker(context: Context, params: WorkerParameters) : Worker(context, params), KoinComponent { | |
| @SuppressLint("CheckResult") | |
| override fun doWork(): Result { | |
| val sendService: SendService? by inject() | |
| val data = inputData.getString("data") | |
| val dataInput = getGsonForJoda()?.fromJson(data, SomeDataClass::class.java) | |
| return try { | |
| val query = sendService?.sendData(dataInput) | |
| ?.blockingGet() |
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
| protected <T> void autoResubscribe(Observable<T> observable, ResubscriptionObserver<T> resubscriptionObserver) { | |
| if (getObservableGroup() != null && observable != null) { | |
| observable | |
| .compose(getObservableGroup().<T>transform((String) resubscriptionObserver.resubscriptionTag())) | |
| .compose(applySchedulers()) | |
| .subscribe(resubscriptionObserver); | |
| } | |
| } |
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
| protected fun <T> subscribe(observable: Observable<T>?, observer: Observer<T>?, bind: Boolean = true) { | |
| if (observable != null && observer != null) { | |
| if (bind) { | |
| observable | |
| .subscribeOn(Schedulers.io()) | |
| .observeOn(AndroidSchedulers.mainThread(), true) | |
| .bindToLifecycle(this) | |
| .subscribe(observer) | |
| } else { | |
| observable |
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
| "[^"\\]*(?:\\[\W\w][^"\\]*)*"|(\/\/.*) |
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 FlutterApp extends StatelessWidget { | |
| final WebService _webService; | |
| final StorageService _storageService; | |
| FlutterApp(this._webService, this._storageService); | |
| @override | |
| Widget build(BuildContext context) { | |
| var localizationDelegate = LocalizedApp.of(context).delegate; |
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
| part 'some_kind_of_store.g.dart'; | |
| /// User Resources Store | |
| class SomeKindOfStore = SomeKindOfStoreBase with _$SomeKindOfStore; | |
| /// User Resources Store | |
| abstract class SomeKindOfStoreBase with Store { | |
| final WebService _webService; | |
| final StorageService _storageService; |
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
| abstract class StorageService { | |
| /// Save user to D | |
| void saveUser(User user); | |
| /// Get user from DB | |
| Future<DBUser> getUser(); | |
| /// Stop all operations | |
| void stop(); | |
| } |