Skip to content

Instantly share code, notes, and snippets.

@SIDOVSKY
SIDOVSKY / CustomButton.kt
Last active January 19, 2023 04:00
Custom view default style overload example
package <yourpackage>
import android.content.Context
import android.util.AttributeSet
import androidx.annotation.AttrRes
import com.google.android.material.button.MaterialButton
class CustomButton @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
@SIDOVSKY
SIDOVSKY / AutoDispose.md
Created March 29, 2021 20:51
Attach IDisposable to a Lifecycle.Event in Xamarin.Android

Usage:

// Inside a Fragment or Activity
IDisposable.AutoDispose(this, Lifecycle.Event.OnDestroy);

// One more option for a Fragment
IDisposable.AutoDispose(ViewLifecycleOwner, Lifecycle.Event.OnDestroy);
@SIDOVSKY
SIDOVSKY / ADB over WiFi.md
Last active February 15, 2021 22:15
Find connected devices and establish ADB over WiFi with the selected one

PLATFORM

In order for these scripts to work adb must be reachable in the shell. If it's not then add adb location to PATH. On Windows you may also place adb.exe, AdbWinApi.dll, AdbWinUsbApi.dll to the same folder with the script.

On MacOS to open the script with double click it should be saved with .command extension.

Example: