Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔
why is this a feature?

Marcin Robaczyński scana

🤔
why is this a feature?
View GitHub Profile
@neworld
neworld / howto.md
Last active Sep 15, 2020
How to make faster Android build without sacrificing new api lint check
View howto.md

Original solution sacrifices new api lint check.

Here my solution:

int minSdk = hasProperty('minSdk') ? minSdk.toInteger() : 16

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
@MarsVard
MarsVard / README
Last active Nov 15, 2020
android drawable to imitate google cards.
View README
put card.xml in your drawables directory, put colors.xml in your values directory or add the colors to your colors.xml file.
set the background of a view to card,
as you can see in card.xml the drawable handles the card margin, so you don't have to add a margin to your view
``` xml
<View
android:layout_width="fill_parent"
@arriolac
arriolac / TopCropImageView.java
Last active Mar 3, 2021
Custom Android ImageView for top-crop scaling of the contained drawable.
View TopCropImageView.java
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Matrix;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.ImageView;
/**
* Created by chris on 7/27/16.