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 AndroidDevice(val activity: AppCompatActivity) { | |
| /** | |
| * Source: http://stackoverflow.com/a/22174245/273119 | |
| */ | |
| fun readLogFile(): String { | |
| val fullName = "appLog.log" | |
| val file = File(activity.cacheDir, fullName) | |
| val pid = android.os.Process.myPid().toString() |
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 boolean runningOnMainThread() { | |
| return Looper.getMainLooper().getThread() == Thread.currentThread(); | |
| } |
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 'dart:async'; | |
| typedef FutureResult<T> = Future<Result<T>>; | |
| typedef FutureOrResult<T> = FutureOr<Result<T>>; | |
| typedef ConcatResult<F, S> = ({F first, S second}); | |
| abstract class Result<T> { | |
| const Result(); |
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
| // Merge of | |
| // https://github.com/mgouline/android-samples/blob/master/jacoco/app/build.gradle | |
| // and https://github.com/pushtorefresh/storio/blob/master/gradle/jacoco-android.gradle | |
| // Requires Jacoco plugin in build classpath. | |
| apply plugin: 'jacoco' | |
| jacoco { | |
| toolVersion = "0.8.3" | |
| } |
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
| targets: | |
| $default: | |
| builders: | |
| built_value_generator:built_value:generate_for: | |
| generate_for: | |
| - HERE |
Results are:
- direclty access to i18n(RunTime): 55185442.5 us.
- indireclty access to i18n(RunTime): 55758307.0 us.
- indireclty outside access to i18n(RunTime): 56177293.5 us.
- direclty access to i18n(RunTime): 92459941.0 us.
- indireclty access to i18n(RunTime): 83667963.5 us.
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
| /// | |
| /// The Result Monad | |
| /// | |
| abstract class Result<T> { | |
| bool isSuccess() { | |
| return this is Success; | |
| } | |
| Success<T> asSuccess() { | |
| return this as Success<T>; |
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
| <!-- Attribute to add on android --> | |
| <app | |
| .... | |
| android:usesCleartextTraffic="true"> | |
| ... | |
| </app> |
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
| <CheckBox | |
| android:id="@+id/item_card_check_favorite" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:layout_alignParentRight="true" | |
| android:layout_centerVertical="true" | |
| android:padding="@dimen/activity_margin" | |
| style="?android:attr/starStyle"/> |
NewerOlder