This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package vadiole.presseffect | |
import android.annotation.SuppressLint | |
import android.view.MotionEvent | |
import android.view.View | |
import android.view.View.OnTouchListener | |
import android.view.ViewPropertyAnimator | |
import android.view.animation.AccelerateDecelerateInterpolator | |
@SuppressLint("ClickableViewAccessibility") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import androidx.compose.foundation.gestures.detectTapGestures | |
import androidx.compose.foundation.text.BasicText | |
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.mutableStateOf | |
import androidx.compose.runtime.remember | |
import androidx.compose.ui.Modifier | |
import androidx.compose.ui.graphics.isSpecified | |
import androidx.compose.ui.input.pointer.pointerInput | |
import androidx.compose.ui.text.SpanStyle | |
import androidx.compose.ui.text.TextLayoutResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Colors from https://www.figma.com/community/plugin/1143682832255826428 | |
const colors = { | |
colorName: 'rgb(23, 23, 23)', | |
}; | |
for (var key in colors) { | |
if (colors.hasOwnProperty(key)) { | |
console.log('val ' + key + ' = Color(' + RGBAToAHex(colors[key]) + ')'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.BroadcastReceiver | |
import android.content.Context | |
import android.content.Intent | |
import android.content.IntentFilter | |
import android.graphics.Canvas | |
import android.os.PowerManager | |
import android.service.wallpaper.WallpaperService | |
import android.util.Log | |
import android.view.Choreographer | |
import android.view.SurfaceHolder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.graphics.Canvas | |
import android.graphics.ColorFilter | |
import android.graphics.Matrix | |
import android.graphics.Paint | |
import android.graphics.Path | |
import android.graphics.PixelFormat | |
import android.graphics.Rect | |
import android.graphics.drawable.Drawable | |
import kotlin.math.pow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.animation.ValueAnimator | |
import android.view.View | |
import java.lang.ref.WeakReference | |
class ShakeController(v: View) { | |
val view: WeakReference<View> = WeakReference(v) | |
private var isShaking = false | |
// rotate and translate bounds, params for random duration | |
private val rotate = 1f |