This file contains 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 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 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 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 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 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 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 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
canvas.withTranslate(200f, 300f) { | |
drawCircle(...) | |
} |
This file contains 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
canvas.withTranslate(200f, 300f, { | |
drawCircle(...) | |
}) |
This file contains 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
/** | |
* Wrap the specified [block] in calls to [Canvas.save]/[Canvas.translate] | |
* and [Canvas.restoreToCount]. | |
*/ | |
inline fun Canvas.withTranslation( | |
x: Float = 0.0f, | |
y: Float = 0.0f, | |
block: Canvas.() -> Unit | |
) { | |
val checkpoint = save() |