Skip to content

Instantly share code, notes, and snippets.

View Nataland's full-sized avatar
🐱
Petting my cat

Yumeng Zhang Nataland

🐱
Petting my cat
  • North York
View GitHub Profile
@Nataland
Nataland / ZoomableLayout.kt
Created June 22, 2020 21:32
Put this outside of a drawing view
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.*
import android.util.AttributeSet
import android.view.GestureDetector.SimpleOnGestureListener
import android.view.MotionEvent
import android.view.ScaleGestureDetector
import android.view.ScaleGestureDetector.OnScaleGestureListener
import android.view.ScaleGestureDetector.SimpleOnScaleGestureListener
import android.widget.FrameLayout
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/colorControlHighlight">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<corners android:radius="@dimen/popup_corner_radius"/>
<solid android:color="@color/polaris_background"/>
</shape>
</item>
<item>