Skip to content

Instantly share code, notes, and snippets.

View tahaak67's full-sized avatar
💭
Have a wonderful day

Taha Ben Ashur tahaak67

💭
Have a wonderful day
View GitHub Profile
// Usage
// PingPongSwitch(
// textFirst = "Ping",
// textSecond = "Pong"
// )
@Composable
fun PingPongSwitch(
state: PingPongSwitchState = rememberPingPongSwitchState(),
textFirst: String,
@handstandsam
handstandsam / MyLifecycleOwner.kt
Last active March 30, 2024 16:59
Jetpack Compose OverlayService. You have to have all the correct permissions granted and in your manifest, but if you do, this this will show a green box with "Hello" in it!
import android.os.Bundle
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleRegistry
import androidx.savedstate.SavedStateRegistry
import androidx.savedstate.SavedStateRegistryController
import androidx.savedstate.SavedStateRegistryOwner
internal class MyLifecycleOwner : SavedStateRegistryOwner {
private var mLifecycleRegistry: LifecycleRegistry = LifecycleRegistry(this)
private var mSavedStateRegistryController: SavedStateRegistryController = SavedStateRegistryController.create(this)
@c33k
c33k / Update .gitignore
Last active April 26, 2023 06:08
Updating .gitignore and cleaning the cache
//First commit any outstanding code changes, and then, run this command:
git rm -r --cached .
//This removes any changed files from the index(staging area), then just run:
git add .
//Commit
git commit -m "Atualizando .gitignore para..."