Skip to content

Instantly share code, notes, and snippets.

View AlbertVilaCalvo's full-sized avatar
🤘
Hola!

Albert Vila Calvo AlbertVilaCalvo

🤘
Hola!
View GitHub Profile

Keybase proof

I hereby claim:

  • I am albertvilacalvo on github.
  • I am albertvilacalvo (https://keybase.io/albertvilacalvo) on keybase.
  • I have a public key ASDSG8eKG8-68Nbg4G665IqhU-3j6m-jlQd9C2lC55oFFAo

To claim this, I am signing this object:

// WITH SHAPE RECTANGLE
// drawable-v21/bg_rectangle_green.xml
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/white">
<item>
<shape android:shape="rectangle">
<solid android:color="@color/green"/>
@AlbertVilaCalvo
AlbertVilaCalvo / StethoDebugTree.java
Last active February 5, 2019 14:45
Timber Tree for logging with Stetho in Android
// Add the dependencies in app/build.gradle:
compile 'com.facebook.stetho:stetho:1.4.2'
compile 'com.facebook.stetho:stetho-okhttp3:1.4.2'
// Initialize Stetho and plant the StethoDebugTree in Application onCreate():
if (BuildConfig.DEBUG) {
Stetho.initializeWithDefaults(this);
@AlbertVilaCalvo
AlbertVilaCalvo / Timber.java
Last active December 19, 2016 10:29
Timber tree for logging line numbers in Android
// Put this in Application onCreate()
Timber.plant(new Timber.DebugTree() {
@Override
protected String createStackElementTag(StackTraceElement element) {
// Add the line number
return super.createStackElementTag(element) + ":" + element.getLineNumber();
}
});