Skip to content

Instantly share code, notes, and snippets.

View yschimke's full-sized avatar

Yuri Schimke yschimke

View GitHub Profile
from cqgridfinity import *
import cadquery as cq
from ocp_vscode import show_object
FRONT_SURFACE_TAG = "front_surface"
# make a simple box
box = GridfinityBox(4, 4, 10.2, solid=True, solid_ratio=1.0, holes=True, unsupported_holes=True)
posca_box: cq.Workplane = box.cq_obj
from cqgridfinity import *
import cadquery as cq
from ocp_vscode import show_object
FRONT_SURFACE_TAG = "front_surface"
# make a simple box
box = GridfinityBox(3, 4, 21, solid=True, solid_ratio=1.0, holes=True, unsupported_holes=True)
posca_box: cq.Workplane = box.cq_obj
@Composable
fun WearApp() {
val useDistance = rememberExpandableState(initiallyExpanded = false)
var distanceGoal by remember { mutableFloatStateOf(3.0f) }
val useDuration = rememberExpandableState(initiallyExpanded = false)
var durationGoal by remember { mutableFloatStateOf(15.0f) }
@yschimke
yschimke / CaptureComposable.kt
Created August 17, 2024 18:24 — forked from iamcalledrob/CaptureComposable.kt
Android headless composable capture
import android.app.Presentation
import android.content.Context
import android.graphics.Bitmap
import android.graphics.Picture
import android.graphics.SurfaceTexture
import android.hardware.display.DisplayManager
import android.view.Display
import android.view.Surface
import android.view.ViewGroup
import androidx.compose.foundation.layout.Box
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
package com.google.android.horologist.scratch
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@yschimke
yschimke / ComposeA11yExtension.kt
Created August 24, 2022 16:44
ComposeA11yExtension
package com.google.android.horologist.audio.ui
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import androidx.compose.ui.layout.positionInRoot
import androidx.compose.ui.node.RootForTest
import androidx.compose.ui.platform.ViewRootForTest
import androidx.compose.ui.semantics.SemanticsActions
import androidx.compose.ui.semantics.SemanticsNode
val navController = rememberSwipeDismissableNavController()
Scaffold(
modifier = Modifier.fillMaxSize(),
timeText = { TimeText() }
) {
SwipeDismissableNavHost(
navController = navController,
startDestination = "start",
) {
/*
* Copyright (C) 2020 Square, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software