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 fun animateToPoint(point: Point) { | |
| val propertyX = PropertyValuesHolder.ofFloat(ColorDropperView.PROPERTY_X, dropperPoint.x, point.x) | |
| val propertyY = PropertyValuesHolder.ofFloat(ColorDropperView.PROPERTY_Y, dropperPoint.y, point.y) | |
| val animator = ValueAnimator() | |
| animator.setValues(propertyX, propertyY) | |
| animator.interpolator = OvershootInterpolator() | |
| animator.duration = 100 | |
| animator.addUpdateListener { animation -> | |
| val animatedX = animation.getAnimatedValue(ColorDropperView.PROPERTY_X) as Float |
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 floatPropertyAnimX = object : FloatPropertyCompat<ColorDropperView>(PROPERTY_X) { | |
| override fun setValue(dropper: ColorDropperView?, value: Float) { | |
| dropper?.setDropperX(value) | |
| } | |
| override fun getValue(dropper: ColorDropperView?): Float { | |
| return dropper?.getDropperX() ?: 0f | |
| } | |
| } |
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 fun animateToPoint(point: Point) { | |
| SpringAnimation(this, floatPropertyAnimX, point.x).apply { | |
| spring.stiffness = SpringForce.STIFFNESS_MEDIUM | |
| spring.dampingRatio = SpringForce.DAMPING_RATIO_MEDIUM_BOUNCY | |
| start() | |
| } | |
| SpringAnimation(this, floatPropertyAnimY, point.y).apply { | |
| spring.stiffness = SpringForce.STIFFNESS_MEDIUM |
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
| SpringAnimation(this, floatPropertyAnimY, point.y).apply { | |
| setStartVelocity(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 5000f, resources.displayMetrics)) | |
| start() | |
| } |
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
| // Why use inline classes? 🤔 | |
| // 🎯 Compile time safety | |
| // 🎯 Less runtime overhead than a normal wrapper class as it "inlines" the data into its usages | |
| // More info : https://kotlinlang.org/docs/reference/inline-classes.html | |
| // Without inline classes 😞 | |
| data class Recipe(id: UUID) | |
| data class Ingredient(id: UUID, recipeId: UUID) |
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/bash | |
| today=$(date +%Y%m%d) | |
| for path in $(adb shell ls /sdcard/Pictures/Screenshots/*"${today}"*); do | |
| name=$(basename "$path") | |
| if [ ! -f "$name" ]; then | |
| adb pull "$path" | |
| fi | |
| done |
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
| name: Create Release Branch | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| versionName: | |
| description: 'Name of version (ie 5.5.0)' | |
| required: true | |
| versionCode: | |
| description: 'Version number (50500)' | |
| required: 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
| name: Tag Release | |
| on: | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| tag_release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v2 |
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
| name: Translation Export to Android Repo | |
| on: | |
| push: | |
| branches: [ master ] | |
| workflow_dispatch: | |
| jobs: | |
| push_strings_to_over: | |
| runs-on: ubuntu-latest | |
| if: "contains(github.event.head_commit.message, 'Automated checkin')" | |
| steps: |
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
| /* Copyright 2022 Google LLC. | |
| SPDX-License-Identifier: Apache-2.0 */ | |
| @Composable | |
| fun BouncyRopes() { | |
| val startCoOrdinate by remember { | |
| mutableStateOf(Offset(0f, 0f)) | |
| } | |
| var endCoOrdinate by remember { | |
| mutableStateOf(Offset(100f, 0f)) | |
| } |