Skip to content

Instantly share code, notes, and snippets.

View aashreys's full-sized avatar
zooming...

Aashrey Sharma aashreys

zooming...
View GitHub Profile
@aashreys
aashreys / resources.xml
Created February 5, 2017 18:05
Unbounded ripples which gracefully fallback to the default selector in pre-lollipop devices.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr name="selectableItemBackgroundBorderlessCompat" />
</resources>
@aashreys
aashreys / ChromeTabUtils.java
Last active November 20, 2019 06:00
Simple helper to check if Chrome Tabs is supported on a device and open urls.
public class ChromeTabUtils {
public static void openUrl(Context context, String url) {
if (isChromeTabSupported(context)) {
// Build intent to open Chrome Tab
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
builder.setToolbarColor(getColor(context, R.color.toolbarBackground));
CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.launchUrl(context, Uri.parse(url));
} else {
@aashreys
aashreys / QuickActionView.java
Last active July 3, 2017 07:00
A simple view for providing iOS's Assistive Touch capabilities to your application's screens.
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Build;
import android.support.annotation.ColorRes;
import android.support.annotation.DrawableRes;
@aashreys
aashreys / ForegroundImageView.java
Created November 23, 2016 03:28
Modified ForegroundImageView from Jake Wharton's original code. Implemented #drawableHotspotChanged() to start ripple effect from a touch point.
package com.aashreys.walls.ui.utils;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.ImageView;
@aashreys
aashreys / build.gradle
Created May 18, 2016 16:19
build.gradle script additions to allow uploading debug and release builds to different maven repos.
configurations {
debugArchives
releaseArchives
}
artifacts {
def path = "${project.rootDir}/library/build/outputs/aar/"
debugArchives file: file(path + "${project.getName()}-debug.aar")
releaseArchives file: file(path + "${project.getName()}-release.aar")
}