Skip to content

Instantly share code, notes, and snippets.

View webserveis's full-sized avatar

Webserveis webserveis

View GitHub Profile
@passsy
passsy / KIntent.kt
Last active May 10, 2026 21:28
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
/**
* Extensions for simpler launching of Activities
@metasidd
metasidd / PillButtons.swift
Last active February 8, 2026 18:19
Pill Buttons - Mail App iOS 18 - SwiftUI
//
// PillButtons.swift
//
// Created by Siddhant Mehta on 6/11/24
// Twitter: @metasidd
//
// Feel free to reuse, or remix.
import SwiftUI
@gelldur
gelldur / FullscreenFragment.java
Created September 11, 2015 12:48
FullscreenFragment - simple android fragment that will make fullscreen for you. Remember to: "You must manually call onKeyDown and onWindowFocusChanged."
package com.dexode.fragment;
import android.annotation.TargetApi;
import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.view.KeyEvent;
@kidinov
kidinov / Undo_Redo android
Last active July 9, 2025 05:06
Undo/Redo with batches for any TextView descendant.
/*
* THIS CLASS IS PROVIDED TO THE PUBLIC DOMAIN FOR FREE WITHOUT ANY
* RESTRICTIONS OR ANY WARRANTY.
*/
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.text.Editable;
import android.text.Selection;
import android.text.TextUtils;
@Matt54
Matt54 / AnimatingMaskedMeshView.swift
Created June 13, 2024 12:21
An animating mesh gradient view with an animating mask
import SwiftUI
struct AnimatingMaskedMeshView: View {
let referenceDate: Date = .now
@State private var mainPosition: CGPoint = .zero
@State private var positions: [CGPoint] = []
private let blurRadius = 20.0
private let alphaThreshold = 0.875
@yuntan
yuntan / FloatSeekBarPreference.kt
Last active August 22, 2024 21:17
SeekBarPreference for Float with value formatter
package com.example.app
import android.content.Context
import android.content.res.TypedArray
import android.util.AttributeSet
import android.widget.SeekBar
import android.widget.TextView
import androidx.preference.Preference
import androidx.preference.PreferenceViewHolder
@peantunes
peantunes / GroundReflectionViewModifier-final.swift
Last active July 27, 2024 13:21
Reflection effect for SwiftUI
private struct GroundReflectionViewModifier: ViewModifier {
let offsetY: CGFloat
func body(content: Content) -> some View {
content
.background(
content
.mask(
LinearGradient(
gradient: Gradient(stops: [.init(color: .white, location: 0.0), .init(color: .clear, location: 0.6)]),
startPoint: .bottom,
@lostincode
lostincode / ContentView.swift
Created June 15, 2024 00:24
MeshGradient Playground iOS 18
//
// ContentView.swift
// MeshGradientPlayground
//
// Created by Bill Richards on 6/14/24.
//
import SwiftUI
struct ContentView: View {
@coughski
coughski / MeshGradientEditor.swift
Created June 17, 2024 02:36
SwiftUI Mesh Gradient Editor
import SwiftUI
import UniformTypeIdentifiers
struct MeshGradientPoint: Identifiable {
let id = UUID()
var point: SIMD2<Float>
var color: Color
}
struct ContentView: View {
@wasabeef
wasabeef / AnimatedGifEncoder.java
Last active July 8, 2023 10:04
Android - AnimatedGifEncoder
import java.io.IOException;
import java.io.OutputStream;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Canvas;
import android.graphics.Paint;
public class AnimatedGifEncoder {
protected int width; // image size