Skip to content

Instantly share code, notes, and snippets.

View zerofancy's full-sized avatar

归零幻想 zerofancy

View GitHub Profile
@zerofancy
zerofancy / gist:87645b411159ae7c64bb85e180bad3fc
Created March 17, 2024 22:08
模仿微信涂抹文字选择。
package top.ntutn.swipeselectview
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Rect
import android.util.AttributeSet
import android.view.MotionEvent
import android.view.View
import androidx.core.view.children
import com.google.android.material.chip.ChipGroup
@zerofancy
zerofancy / Ext.kt
Last active March 23, 2023 10:56
fragment便捷传参
import android.os.Bundle
import androidx.fragment.app.Fragment
import kotlin.properties.ReadWriteProperty
class FragmentBundleDataDelegate<T : Any>(private val clazz: Class<T>, private val defaultValue: T? = null) :
ReadWriteProperty<Fragment, T?> {
@Suppress("UNCHECKED_CAST")
override fun getValue(
thisRef: Fragment,