Skip to content

Instantly share code, notes, and snippets.

Noot-Nooting around

Mattia Pagini matpag

Noot-Nooting around
View GitHub Profile
matpag / OnThrottleClickListener.kt
Created Dec 2, 2019
ThrottleClickListener prevent double click using OnClickListener
View OnThrottleClickListener.kt
import android.os.SystemClock
import android.view.View
* This is a custom clicklistener to prevent multiple click events to happens at the same time.
* Each click on a button is added in the internal event handler queue, there is no way to remove
* them from there so the only thing we can do is adding a filter to prevent them to run too
* frequently
matpag /
Last active Jul 25, 2019
Script to run test on a random-generated android emulator with a specific API level
#You need to have installed the API images you are going to start or you can change the createGoogleEmulator function to start the image you want
#For example to start an Android API 28 emulator and perform the app test with Google Apis you just need to call
#./ 28 :app:connectedCheck
#unlock for debugging purposes
# set -ex
#global vars
View DialogNavigator.kt
package com.geekorum.geekdroid.navigation
import android.content.Context
import android.os.Bundle
import android.util.AttributeSet
import androidx.core.content.res.use
import androidx.core.os.bundleOf
matpag /
Last active Sep 9, 2019
Implement Zebra EMDK 7.0 on BaseActivity for multiple Activities
//the others Android import....
import com.symbol.emdk.EMDKManager;
import com.symbol.emdk.barcode.BarcodeManager;
import com.symbol.emdk.barcode.ScanDataCollection;
import com.symbol.emdk.barcode.Scanner;
import com.symbol.emdk.barcode.ScannerConfig;
import com.symbol.emdk.barcode.ScannerException;
import com.symbol.emdk.barcode.ScannerInfo;
matpag /
Created May 20, 2017 — forked from lopspower/
Publish AAR to jCenter and Maven Central

Publish AAR to jCenter and Maven Central


Now I'm going to list how to publish an Android libray to jCenter and then syncronize it with Maven Central:

  1. I use "Android Studio" and I have this simple android lib that I would like to be available on maven: CircularImageView

  2. In the library folder(module) I have the lib code abovementioned. And applying in the build.gradle of this folder apply plugin: '' I got as output an .aar in the build/outputs/aar/ directory of the module's directory

matpag /
Last active Dec 14, 2016 — forked from hrules6872/
TextViewDrawableSize - CompoundDrawable size
* Original source from here :
public class TextViewDrawableSize extends TextView {
private static final int DEFAULT_COMPOUND_DRAWABLE_SIZE = -1;
private int compoundDrawableWidth;
private int compoundDrawableHeight;
public TextViewDrawableSize(Context context) {
this(context, null);
View DBFlow project build.gradle jack test
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
dependencies {
classpath ''
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
View DBFlow module build.gradle jack test
apply plugin: ''
def dbflow_version = "3.1.1"
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.testpackage.test"
matpag / Database.cs
Created Apr 15, 2016
Xamarin Forms SQLite database upgrade strategy
View Database.cs
using ProjectTest.MyModels;
using SQLite.Net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace ProjectTest.Database
You can’t perform that action at this time.