Skip to content

Instantly share code, notes, and snippets.

View kibotu's full-sized avatar
🎯
Focusing

Jan Rabe kibotu

🎯
Focusing
View GitHub Profile
@kibotu
kibotu / KEYBOARD_AVOIDANCE.md
Last active October 30, 2025 09:26
SwiftUI & UIKit Keyboard Avoidance fix for iOS 26.0.1, 26.1

Keyboard Avoidance Implementation

Overview

This document describes the keyboard avoidance implementation for the Messenger iOS app, ensuring that the ChatInputView is not overlapped by the keyboard on iOS 16+ (including iOS 16.0.1 and 16.1).

Problem

The SwiftUI-based ChatInputView was not properly avoiding the keyboard when it appeared, potentially causing the input field to be hidden behind the keyboard.

Solution

@kibotu
kibotu / ViewControllerFocusMonitoring.md
Last active October 17, 2025 10:48
onWindowsFocusChanged for iOS

View Controller Focus Monitoring Pattern

Overview

This document describes a pragmatic solution for monitoring focus changes in iOS view controllers. The pattern allows view controllers to be notified when they gain or lose user attention due to various system events like modals, alerts, app backgrounding, or navigation changes.

Problem Statement

iOS view controllers need to react to focus changes, but the platform doesn't provide a built-in unified API for this. A view controller may lose focus in several ways:

@kibotu
kibotu / android-run-maestro-jenkins-groovy-function.groovy
Last active October 13, 2025 12:21
Running maesto ui tests on headless android emulator on mac or linux in parallel.
/**
* runMaestro("signin-flow.yaml", "36", "app/build/outputs/apk/debug/app-debug.apk", "de.example")
*/
def runMaestro(flow, api, apk, bundleIdentifier) {
int rc = sh(
script: "./build/buildscripts/run-headless-maestro-tests.sh ${flow} ${apk} ${api}",
returnStatus: true
)
@kibotu
kibotu / check_dagger_consistency.py
Last active August 18, 2025 10:07
Check if there is a @Inject constructor without a provide function being used.
#!/usr/bin/env python3
import os
import re
import sys
from pathlib import Path
from typing import Set, List, Tuple
from dataclasses import dataclass
@dataclass
class InjectClass:
import androidx.compose.animation.core.CubicBezierEasing
import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.RepeatMode
import androidx.compose.animation.core.animateFloat
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.infiniteRepeatable
import androidx.compose.animation.core.rememberInfiniteTransition
import androidx.compose.animation.core.tween
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
@kibotu
kibotu / clean.py
Last active August 11, 2025 09:30
Comprehensive MacOS App Cleanup Script
#!/usr/bin/env python3
import subprocess
import shutil
import os
import argparse
from pathlib import Path
# Global dry run flag
DRY_RUN = False
@kibotu
kibotu / migrate_to_core_13.py
Last active May 30, 2025 12:45
Migration script for sp android core 13 changes.
import os
import subprocess
from typing import Dict, Set
import re
# Constants
EVENTS_MODULE = "mover"
def checkout_core_repo() -> str:
"""Clone and checkout the core repository with shallow clone (no history), return its path"""
@kibotu
kibotu / extract-proguard-rules.sh
Last active May 16, 2025 09:16
Consumer ProGuard Rules Report
#!/bin/bash
# Extract consumer ProGuard rules from all dependencies and generate an HTML report
# Author: Jan Rabe
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
@kibotu
kibotu / SharedPreferenceDelegate.kt
Created May 13, 2025 06:47
Advanced android kotlin shared preference delegate.
import android.content.SharedPreferences
import androidx.core.content.edit
import de.check24.android.plugin.profis.events.shared.logger.EventsLogger
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KProperty
/**
* A type-safe SharedPreferences delegate with enhanced features: