Skip to content

Instantly share code, notes, and snippets.

@denebchorny
denebchorny / BoxShadow.kt
Created December 31, 2023 03:59 — forked from maulikhirani/BoxShadow.kt
Helper extension to use drop shadow in Jetpack Compose
import android.graphics.BlurMaskFilter
import android.graphics.ColorMatrix
import android.graphics.ColorMatrixColorFilter
import androidx.compose.runtime.Stable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.drawWithCache
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Canvas
import androidx.compose.ui.graphics.ClipOp
@denebchorny
denebchorny / ZoomLayout.java
Created April 25, 2022 18:28 — forked from anorth/ZoomLayout.java
Pinch-zoomable Android frame layout
package au.id.alexn;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.View;
import android.widget.FrameLayout;
@denebchorny
denebchorny / IconView.kt
Created August 9, 2021 21:31 — forked from nickbutcher/IconView.kt
A prototype implementation of a shadow effect inspired by the Google Play Games app (https://play.google.com/store/apps/details?id=com.google.android.play.games).
/*
* Copyright 2017 Google 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 distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@denebchorny
denebchorny / README.md
Created January 18, 2021 12:44 — forked from lopspower/README.md
Material Animations

Material Animations

Android Arsenal

[Android Transition Framework][transition-framework] can be used for three main things:

  1. Animate activity layout content when transitioning from one activity to another.
  2. Animate shared elements (Hero views) in transitions between activities.
  3. Animate view changes within same activity.
@denebchorny
denebchorny / RecyclerViewExtension.kt
Created July 22, 2020 19:32 — forked from arcadefire/RecyclerViewExtension.kt
Add addOnItemClickListener easily to a RecyclerView using Kotlin
import android.support.v7.widget.RecyclerView
import android.view.View
interface OnItemClickListener {
fun onItemClicked(position: Int, view: View)
}
fun RecyclerView.addOnItemClickListener(onClickListener: OnItemClickListener) {
this.addOnChildAttachStateChangeListener(object: RecyclerView.OnChildAttachStateChangeListener {
override fun onChildViewDetachedFromWindow(view: View?) {
@denebchorny
denebchorny / RecyclerViewExtension.kt
Created July 22, 2020 19:32 — forked from arcadefire/RecyclerViewExtension.kt
Add addOnItemClickListener easily to a RecyclerView using Kotlin
import android.support.v7.widget.RecyclerView
import android.view.View
interface OnItemClickListener {
fun onItemClicked(position: Int, view: View)
}
fun RecyclerView.addOnItemClickListener(onClickListener: OnItemClickListener) {
this.addOnChildAttachStateChangeListener(object: RecyclerView.OnChildAttachStateChangeListener {
override fun onChildViewDetachedFromWindow(view: View?) {
@denebchorny
denebchorny / KIntent.kt
Last active July 20, 2020 12:26 — forked from passsy/KIntent.kt
Kotlin extension functions to start a generic Activity
package com.pascalwelsch.extensions
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.os.Build
import android.os.Bundle
/**
* Edited by Deneb Asecas