Skip to content

Instantly share code, notes, and snippets.

package it.inrebus.skyte.rtcclient;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.opengl.GLES20;
import android.opengl.GLUtils;
@myinnos
myinnos / TouchImageView.java
Last active March 22, 2024 12:14
Android ImageView to include pinch zooming, panning, fling and double tap zoom.
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.PointF;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.net.Uri;
@Robyer
Robyer / maven-publish-helper-usage.gradle
Last active June 15, 2023 04:22
Gradle script for publishing Android library with sources and javadoc to Maven repository using maven-publish plugin.
// You can use maven-publish-helper.gradle script without changes and even share it between multiple
// modules. Just place the maven-publish-helper.gradle file in the root directory of your project,
// then apply it at the bottom of your module's build.gradle file like this:
// ...content of module's build.gradle file...
apply from: '../maven-publish-helper.gradle'
publishing {
publications {
@bj0
bj0 / Cached.kt
Created January 26, 2017 17:15
A modified version of Kotlin's lazy delegate that can be reset.
/**
* Created by Brian Parma on 2/10/16.
*
* This is basically just the lazy delegate copy and pasted, then modified so that it can be
* reset by setting it equal to null
*/
/**
* Represents a value with lazy initialization.
*
* To create an instance of [Cached] use the [cached] function.
@gotev
gotev / ProximitySensor.java
Last active February 26, 2019 10:44
Android Proximity Sensor helper
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Build;
import android.os.PowerManager;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
@JonDouglas
JonDouglas / xamarinandroidbindings.md
Last active March 12, 2024 10:36
Xamarin Android Bindings Troubleshooting

Approaching a Xamarin.Android Bindings Case

1. Investigation

One of the best ways to investigate a problematic Xamarin.Android Binding is to first ensure you have the proper tooling available:

@Petrakeas
Petrakeas / SynchronousHandler.java
Last active April 21, 2022 08:24
Android - Posts a runnable on a handler's thread and waits until it has finished running.
import android.os.Handler;
import android.os.Looper;
/**
* A helper class that provides more ways to post a runnable than {@link android.os.Handler}.
*
* Created by Petros Douvantzis on 19/6/2015.
*/
public class SynchronousHandler {
@lauw
lauw / SnappingRecyclerView.java
Created May 4, 2015 23:00
Snapping RecyclerView (Horizontal)
/*
* Copyright 2015 Laurens Muller.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@staltz
staltz / introrx.md
Last active May 13, 2024 09:59
The introduction to Reactive Programming you've been missing