Skip to content

Instantly share code, notes, and snippets.

View PiotrPrus's full-sized avatar
🏠
Working from home

Piotr Prus PiotrPrus

🏠
Working from home
View GitHub Profile
@Composable
fun Modifier.tapOrPress(
onStart: (offsetX: Float) -> Unit,
onCancel: (offsetX: Float) -> Unit,
onCompleted: (offsetX: Float) -> Unit
): Modifier {
val interactionSource = remember { MutableInteractionSource() }
return this.pointerInput(interactionSource) {
forEachGesture {
coroutineScope {
@Composable
fun Modifier.startGesture(
onStart: (offsetX: Float) -> Unit
): Modifier {
val interactionSource = remember { MutableInteractionSource() }
return this.pointerInput(interactionSource) {
forEachGesture {
coroutineScope {
awaitPointerEventScope {
val touch = awaitFirstDown().also { it.consumeDownChange() }
# Trigger on every tag creation
on:
push:
tags:
- 'release-*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
- name: Create release branch on package repo
uses: GuillaumeFalourd/create-other-repo-branch-action@v1
with:
repository_owner: piotrprus
repository_name: kmm-swift-packages
new_branch_name: develop
access_token: ${{ secrets.API_TOKEN_GITHUB}}
- name: Push directory to another repository
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: 'swiftpackage'
destination-github-username: 'piotrprus'
destination-repository-name: 'kmm-swift-packages'
user-email: prus.piotr@gmail.com
target-branch: main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 11
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 11
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<receiver android:name=".MyWidgetProvider" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="@xml/my_widget_provider" />
</receiver>
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:initialLayout="@layout/widget_initial"
android:minWidth="110dp"
android:minHeight="40dp"
android:resizeMode="horizontal"
android:updatePeriodMillis="1800000"
android:widgetCategory="home_screen">
</appwidget-provider>