Skip to content

Instantly share code, notes, and snippets.

View kevinvanmierlo's full-sized avatar

Kevin van Mierlo kevinvanmierlo

View GitHub Profile
@kevinvanmierlo
kevinvanmierlo / 0. Voyager Android Predictive Back Gesture And iOS Swipe to go back.md
Last active November 11, 2024 00:13
Voyager Android Predictive Back Gesture And iOS Swipe to go back

This is the gist which explains how to use Android predictive back gesture and iOS swipe to go back when using Voyager in Compose multiplatform.

If you are just using Android, you can merge the commonMain stuff and the androidMain stuff.

@kevinvanmierlo
kevinvanmierlo / JetpackComposeTextFieldMentions.kt
Last active November 8, 2023 18:09
Mentions in Jetpack Compose TextField (@john Doe)
/*
MIT License
Copyright (c) 2022 Kevin van Mierlo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@kevinvanmierlo
kevinvanmierlo / CrossFadeDrawable.java
Last active July 9, 2020 21:06
Glide respecting different aspect ratio placeholder and loading image
package nl.kevinvanmierlo.testtransitiondrawable;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.SystemClock;
import androidx.annotation.NonNull;
@kevinvanmierlo
kevinvanmierlo / Stacktrace Telegram
Created June 4, 2015 14:02
Stacktrace Telegram - Happens when Telegram is not on foreground
Process: Telegram [1624]
Path: /Applications/Telegram.app/Contents/MacOS/Telegram
Identifier: ru.keepcoder.Telegram
Version: 1.60 (20263)
App Item ID: 747648890
App External ID: 812412646
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Telegram [1624]
User ID: 501
@kevinvanmierlo
kevinvanmierlo / Group
Last active August 29, 2015 14:19
RealmList move - unexpected results
public class Group extends RealmObject
{
private RealmList<Person> persons;
public RealmList<Person> getPersons()
{
return persons;
}
public void setPersons(RealmList<Person> persons)
@kevinvanmierlo
kevinvanmierlo / BaseActivity.java
Last active September 1, 2020 15:22
Same Navigation Drawer on different Activities
public class BaseActivity extends AppCompatActivity
{
public DrawerLayout drawerLayout;
public ListView drawerList;
private ActionBarDrawerToggle drawerToggle;
protected void onCreate(Bundle savedInstanceState)
{
// R.id.drawer_layout should be in every activity with exactly the same id.
drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);