Skip to content

Instantly share code, notes, and snippets.

View riggaroo's full-sized avatar
🌍

Rebecca Franks riggaroo

🌍
View GitHub Profile
@riggaroo
riggaroo / GradientAlongPathAnimation.kt
Last active January 24, 2024 15:45
Gradient along a path using path.flatten in Compose, Inspired by William Candillon https://youtu.be/7SCzL-XnfUU, this uses Jetpack Compose to draw a gradient along a path https://github.com/wcandillon/can-it-be-done-in-react-native/tree/master/bonuses/skia-examples/src/PathGradient
package androidx.compose.samples.animationfactory
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.infiniteRepeatable
import androidx.compose.animation.core.tween
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
@riggaroo
riggaroo / CompositingStrategyOffscreenExample.kt
Last active January 21, 2024 21:29
GraphicsLayer CompositingStrategy Example demonstrating offscreen compositing strategy in Jetpack Compose, leveraging BlendMode.Clear to mask some of the image away.
/* Copyright 2022 Google LLC.
SPDX-License-Identifier: Apache-2.0 */
@Composable
fun GraphicsLayerCompositingStrategyExample() {
Image(painter = painterResource(id = R.drawable.dog),
contentDescription = "Dog",
contentScale = ContentScale.Crop,
modifier = Modifier
.size(120.dp)
.aspectRatio(1f)
@riggaroo
riggaroo / create_release_branch.yml
Last active December 5, 2023 10:21
Github Action workflow for creating release branch, updating versionName and versionCode, copying strings.xml to another repo, submitting PRs as per GitFlow.
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
@riggaroo
riggaroo / RecyclerViewAdapterTemplate.java
Created May 2, 2016 16:12
File Template for Android Studio for creating a RecyclerViewAdapter without having to remember much of the boilerplate.
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.util.List;
#parse("File Header.java")
@riggaroo
riggaroo / tag_release.yml
Created October 4, 2020 07:51
Github Action workflow for tagging release on Github Release, copying release notes from CHANGELOG.md
name: Tag Release
on:
push:
branches: [ main ]
jobs:
tag_release:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
@riggaroo
riggaroo / PULL_REQUEST_TEMPLATE
Created February 3, 2019 14:34
Pull request template format. Add this file to your .github folder
<!--- Provide a general summary of your changes in the Title above -->
<!--- If there is no changelog entry, label this PR as trivial to bypass the Danger warning -->
## Description
<!--- Describe your changes in detail -->
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
@riggaroo
riggaroo / BouncyRopes.kt
Last active May 21, 2023 11:58
Jetpack Compose Bouncy Ropes code
/* 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))
}
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.Spring
import androidx.compose.animation.core.SpringSpec
import androidx.compose.animation.core.spring
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
@riggaroo
riggaroo / AndroidManifest.xml
Created April 13, 2016 17:31
Custom Android Espresso Test Runner - Unlocking a Device, Granting Permission to turn animations off, turning the Screen on.
<?xml version="1.0" encoding="utf-8"?>
<!-- Put this file in the "debug" folder so it only gets merged into debug builds -->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="org.bookdash.android">
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<!-- Disable animations on debug builds so that the animations do not interfere with Espresso
@riggaroo
riggaroo / export_strings.yml
Last active September 28, 2021 13:48
Github Action workflow that copies string translations from one repo into another and creates a PR.
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: