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
| // inspired by http://www.andreamaglie.com/rxjava-listener-to-observable/ | |
| interface ValueUpdateListener { | |
| fun onValueChanged(value: String) | |
| } | |
| class ValueUpdater { | |
| fun registerListener(listener: ValueUpdateListener) { | |
| // ... | |
| } |
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
| # Добавляем в ~/.bashrc следующие строки: | |
| export LANG="en_US.UTF-8" | |
| export LC_COLLATE="en_US.UTF-8" | |
| export LC_CTYPE="en_US.UTF-8" | |
| export LC_MESSAGES="en_US.UTF-8" | |
| export LC_MONETARY="en_US.UTF-8" | |
| export LC_NUMERIC="en_US.UTF-8" | |
| export LC_TIME="en_US.UTF-8" |
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 RoundedImageView(context: Context, attributeSet: AttributeSet?) : View(context, attributeSet), Target { | |
| constructor(context: Context) : this(context, null) | |
| private var drawable: Drawable? = null | |
| set(value) { | |
| field = value | |
| postInvalidate() | |
| } | |
| fun loadImage(url: String?) { |
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
| #!/bin/sh | |
| set -e | |
| export PATH=$BUILD_SOURCESDIRECTORY/flutter/bin:$BUILD_SOURCESDIRECTORY/flutter/bin/cache/dart-sdk/bin:$PATH | |
| # All scripts will be placed here | |
| "$@" |
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
| #!/bin/sh | |
| set -e | |
| export PATH=$BUILD_SOURCESDIRECTORY/flutter/bin:$BUILD_SOURCESDIRECTORY/flutter/bin/cache/dart-sdk/bin:$PATH | |
| # All scripts will be placed here | |
| "$@" |
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
| install_flutter() { | |
| git clone -b stable https://github.com/flutter/flutter.git | |
| flutter precache | |
| yes | $ANDROID_HOME/tools/bin/sdkmanager --licenses | |
| flutter doctor | |
| } |
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
| launch_avd() { | |
| echo "Installing SDK" | |
| $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-29;default;x86' | |
| echo "Creating emulator" | |
| $ANDROID_HOME/tools/bin/avdmanager create avd -n "pixel" --device "pixel" -k "system-images;android-29;default;x86" | |
| echo "Starting emulator" | |
| $ANDROID_HOME/emulator/emulator -avd "pixel" -no-snapshot & | |
| $ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82' |
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
| start_recording() { | |
| # Each video is 3 minutes max, so 5 videos will give us up to 15 minutes, | |
| # should be enough for test | |
| $ANDROID_HOME/platform-tools/adb shell mkdir /sdcard/video | |
| $ANDROID_HOME/platform-tools/adb shell screenrecord /sdcard/video/1.mp4 | |
| $ANDROID_HOME/platform-tools/adb shell screenrecord /sdcard/video/2.mp4 | |
| $ANDROID_HOME/platform-tools/adb shell screenrecord /sdcard/video/3.mp4 | |
| $ANDROID_HOME/platform-tools/adb shell screenrecord /sdcard/video/4.mp4 | |
| $ANDROID_HOME/platform-tools/adb shell screenrecord /sdcard/video/5.mp4 | |
| } |
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
| flutter_test() { | |
| flutter packages get | |
| flutter packages pub run build_runner build | |
| flutter test | |
| launch_avd | |
| start_recording & | |
| flutter drive --target=test_driver/app.dart | |
| pkill -f screenrecord || true |
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
| pull_video() { | |
| $ANDROID_HOME/platform-tools/adb pull /sdcard/video $BUILD_SOURCESDIRECTORY/screenshots | |
| } |