Skip to content

Instantly share code, notes, and snippets.

View actionbar_done_button.xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="?attr/actionButtonStyle"
android:background="?attr/selectableItemBackground"
android:id="@+id/actionbar_done"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<TextView style="?attr/actionBarTabTextStyle"
android:layout_width="wrap_content"
View gist:192935d71857a6d7b3db
public class DraweeTransform extends Transition {
private static final String PROPNAME_MATRIX = "draweeTransform:matrix";
private final boolean enter;
private final ScalingUtils.ScaleType detailScale;
public DraweeTransform(ScalingUtils.ScaleType detailScale, boolean enter) {
this.detailScale = detailScale;
this.enter = enter;
}
@dcollien
dcollien / ImageTools.es6
Last active May 18, 2022
Resize Images in the Browser
View ImageTools.es6
let hasBlobConstructor = typeof(Blob) !== 'undefined' && (function () {
try {
return Boolean(new Blob());
} catch (e) {
return false;
}
}());
let hasArrayBufferViewSupport = hasBlobConstructor && typeof(Uint8Array) !== 'undefined' && (function () {
try {
@cbeyls
cbeyls / WindowInsetsFrameLayout.java
Last active Feb 5, 2020
A fragment container enabling the use of android:fitsSystemWindows in fragment layouts.
View WindowInsetsFrameLayout.java
package be.digitalia.common.widgets;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Rect;
import android.os.Build;
import android.support.v4.util.ObjectsCompat;
import android.util.AttributeSet;
import android.view.View;
@phpdude
phpdude / nginx.conf
Last active Jun 7, 2022
Nginx image filter + caching of results.
View nginx.conf
location /resize {
alias /tmp/nginx/resize;
set $width 150;
set $height 100;
set $dimens "";
if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) {
set $width $1;
set $height $2;
set $image_path $3;