Skip to content

Instantly share code, notes, and snippets.

View AlexKGwyn's full-sized avatar

Alex Gwyn AlexKGwyn

View GitHub Profile
@AlexKGwyn
AlexKGwyn / PinchToZoom.kt
Created April 23, 2023 14:51
Jetpack Compose MacOS Pinch to Zoom modifier
@file:Suppress("JAVA_MODULE_DOES_NOT_EXPORT_PACKAGE")
package com.lottieworks.app.ui
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.input.pointer.PointerEventType
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.layout.LayoutCoordinates
@AlexKGwyn
AlexKGwyn / LayoutNameInflater.java
Created June 15, 2017 23:16
A layout inflater that sets the layouts resource name as a view tag for logging purposes
package com.alexgwyn.layoutname;
import android.content.Context;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* A layout inflater that adds the tag of the layout to the views it inflates
@AlexKGwyn
AlexKGwyn / FullScreenLinearLayoutManager.java
Created December 3, 2015 20:57
A LinearLayoutManager that measures children to be the same size as their RecyclerView parent
import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.util.AttributeSet;
import android.view.View;
public class FullScreenLinearLayoutManager extends LinearLayoutManager {
public FullScreenLinearLayoutManager(Context context) {
super(context);