Skip to content

Instantly share code, notes, and snippets.

@JcMinarro
JcMinarro / LicensesActivity.java
Created June 5, 2014 12:30 — forked from cyrilmottier/LicensesActivity.java
"Open source licenses" screen
View LicensesActivity.java
package com.cyrilmottier.android.citybikes;
import android.os.Bundle;
import com.cyrilmottier.android.avelov.R;
import com.cyrilmottier.android.citybikes.app.BaseActivity;
public class LicensesActivity extends BaseActivity {
private WebView mWebView;
@JcMinarro
JcMinarro / MyApp.java
Last active August 29, 2015 14:04 — forked from artem-zinnatullin/MyApp.java
Set font to all application component
View MyApp.java
public class MyApp extends Application {
@Override
public void onCreate() {
TypefaceUtil.overrideFont(getApplicationContext(), "SERIF", "fonts/Roboto-Regular.ttf"); // font from assets: "assets/fonts/Roboto-Regular.ttf
}
}
@JcMinarro
JcMinarro / git-git
Last active August 29, 2015 14:04 — forked from swankjesse/git-git
git-git
View git-git
echo '#!/bin/bash' > ~/bin/git-git
echo 'git $*' >> ~/bin/git-git
chmod u+x ~/bin/git-git
View PulldownListViewHelper
import android.util.Log;
import android.widget.AbsListView;
import android.widget.ListView;
import org.jetbrains.annotations.NotNull;
/**
* Makes a listview to have a pull down, this is a wrapper.
* Is not a good idea to override a ListView because there
* are a lot of libraries and we dont know when we need one.
*/
@JcMinarro
JcMinarro / adbIp.sh
Created August 20, 2014 10:40
Script to connect Android devices to ADB over tcpip
View adbIp.sh
#/bin/bash
adb devices
echo "Waiting for device"
adb wait-for-device
ip=$(adb shell ifconfig wlan0 | cut -f3 -d ' ')
echo "Device ip: $ip"
echo "Setting Up tcpip port"
adb tcpip 5555
echo "Connecting to $ip"
adb connect $ip
View RoundedTransformation.java
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Shader;
// enables hardware accelerated rounded corners
// original idea here : http://www.curious-creature.org/2012/12/11/android-recipe-1-image-with-rounded-corners/
@JcMinarro
JcMinarro / AppRater.java
Last active August 29, 2015 14:06 — forked from rharter/AppRater.java
AppRater
View AppRater.java
package com.ryanharter.android.util;
import android.content.Context;
import android.content.SharedPreferences;
/**
* Keeps track of the number of app launches, and days since first launch, and
* provides an easy way to determine whether you should show a rating prompt
* or not.
*/
@JcMinarro
JcMinarro / crashException
Created September 13, 2014 10:23
LiveTemplate AndroidStudio
View crashException
Crashlytics.log(android.util.Log.ERROR, TAG, "[$CLASS$ - $METHOD_NAME$] - (line $LINE$): " + "$END$");
Crashlytics.logException(e);
@JcMinarro
JcMinarro / Debug.java
Last active August 29, 2015 14:06 — forked from scruffyfox/Debug.java
View Debug.java
package in.lib;
import android.util.Log;
import java.util.Collection;
public class Debug
{
private static long timeseed = 0L;
private final static String LOG_TAG = "DEBUG";
@JcMinarro
JcMinarro / HLog.java
Last active August 29, 2015 14:06 — forked from romainpiel/HLog.java
View HLog.java
package com.example.myapplication;
import android.util.Log;
/**
* HLog
* romainpiel
* 13/09/2014
*/
public class HLog {