Skip to content

Instantly share code, notes, and snippets.

View scottyab's full-sized avatar

Scott Alexander-Bown scottyab

View GitHub Profile
@ganadist
ganadist / gist:2af47d422ca6f9d30e8d
Last active March 3, 2021 20:24
SafetyNet example
private static final DEBUG = false;
private static final SecureRandom SR;
static {
SR = new SecureRandom();
SR.setSeed(System.currentTimeMillis());
}
private byte[] getRequestNonce() {
byte[] output = new byte[16];
@miao1007
miao1007 / GradientTransformation.java
Last active October 7, 2023 05:10
Gradient Transformation For Picasso
/**
* Created by Miao1007 on 2/2/15.
*
* Original Code: https://gist.github.com/miao1007/3f7e9b5f011fc188eba6
*/
public class GradientTransformation implements Transformation {
int startColor = Color.argb(240,0,0,0);
int endColor = Color.TRANSPARENT;
@donnfelker
donnfelker / android-19-circle.yml
Last active March 12, 2021 13:19
Sample CircleCI Configuration For an Android App
#
# Build configuration for Circle CI
#
general:
artifacts:
- /home/ubuntu/your-app-name/app/build/outputs/apk/
machine:
environment:
@chrisbanes
chrisbanes / CollapsingTitleLayout.java
Last active March 26, 2023 11:58
CollapsingTitleLayout
/*
* Copyright 2014 Chris Banes
*
* 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
@seanKenkeremath
seanKenkeremath / Android Lollipop Widget Tinting Guide
Last active November 17, 2023 12:40
How base colors in Lollipop apply to different UI elements
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21. To use the support version of these attributes, remove the android namespace. For instance, "android:colorControlNormal" becomes "colorControlNormal". These attributes will be propagated to their corresponding attributes within the android namespace for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.
All Clickable Views:
-----------
* ripple effect (Lollipop only) -- "colorControlHighlight"
Status Bar:
------------
* background (Lollipop only) - "colorPrimaryDark"
@Takhion
Takhion / build.gradle
Last active May 28, 2020 11:13 — forked from dmarcato/strip_play_services.gradle
Gradle task to strip unused packages on Google Play Services library, so you don't have to use necessarily Proguard or MultiDex
apply from: 'strip_play_services.gradle'
@homj
homj / DrawerIconDrawable.java
Last active April 6, 2017 10:11
This Drawable implements the "Drawer-Indicator to Arrow"-Animation as seen in several Material-Design-Apps; NOTE: Mind the updated constructors in Revision 5!
/*
* Copyright 2014 Johannes Homeier
*
* 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
@rallat
rallat / dexmethodcount
Last active March 25, 2024 13:54
Android Dex Method Count more sophisticated scripts that gives you method cound by package @JakeWharton https://gist.github.com/JakeWharton/6002797 and @tsmith https://gist.github.com/tyvsmith/6056422
You can add this to your shell profile and then use it as dexcount file.
This file should have a classes.dex in order to work, that means it has to be a android lib project or android apk.
count(){
mkdir temp >/dev/null
cp $1 temp/$1+copy > /dev/null
unzip temp/$1+copy -d temp/ > /dev/null
cat temp/classes.dex | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"'
rm -R temp > /dev/null
}
@kaushikgopal
kaushikgopal / CircleTransformation.java
Last active March 24, 2017 22:22
A set of Picasso Transformation Examples
package co.kaush.mystarterapp.myappmodule.ui.transformations;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Shader;
import com.squareup.picasso.Transformation;
@chrisjenx
chrisjenx / ContentLoadingFrameLayoyt..java
Created May 21, 2014 09:56
Similar to the LoadingProgressSpinner which doesnt flicker if you change stages quickly.
public abstract class ContentLoadingFrameLayout extends FrameLayout {
private static final int MIN_SHOW_TIME = 200; // ms
private static final int MIN_DELAY = 200; // ms
private ProgressBar mProgressBar;
private View mContent;
private long mStartTime = -1;
private boolean mPostedHide = false;
private boolean mPostedShow = false;