Skip to content

Instantly share code, notes, and snippets.

View subinkrishna's full-sized avatar
🥕

Subinkrishna Gopi subinkrishna

🥕
View GitHub Profile
@subinkrishna
subinkrishna / BitmapUtils.java
Created April 24, 2017 15:30 — forked from jayrambhia/BitmapUtils.java
Android Background Blur
public static Bitmap getBitmapFromView(View view) {
Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(bitmap);
view.layout(view.getLeft(), view.getTop(), view.getRight(), view.getBottom());
view.draw(c);
return bitamp;
}
@subinkrishna
subinkrishna / ParcelableSpareBooleanArray.java
Created November 18, 2016 23:07 — forked from PPartisan/ParcelableSpareBooleanArray.java
SparseBooleanArray that is also Parcelable
/**
* SparseBooleanArray that is also Parcelable. Had to put this together so I could pass this to a
* {@code Fragment} bundle.
*/
public class ParcelableSparseBooleanArray extends SparseBooleanArray implements Parcelable {
public ParcelableSparseBooleanArray(){
super();
}
@subinkrishna
subinkrishna / 1_drawable_ic_hash_io16.xml
Created March 18, 2016 12:44 — forked from nickbutcher/1_drawable_ic_hash_io16.xml
Animated Stroke. The google I/O website this year (https://google.com/io) has some funky animated lettering. I especially liked the animated stroke around the letters and wondered how you might implement that on Android. Turns out that AnimatedVectorDrawable makes this very easy! Here's how it looks: https://twitter.com/crafty/status/71077957997…
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016 Google Inc.
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
@subinkrishna
subinkrishna / CustomRowView.java
Created October 13, 2015 16:06 — forked from devunwired/CustomRowView.java
Custom View Example for drawing raw text and images
public class CustomRowView extends View {
private CharSequence mText;
private Layout mTextLayout;
private TextPaint mTextPaint;
private Drawable mImageDrawable;
public CustomRowView(Context context) {
this(context, null);
@subinkrishna
subinkrishna / colors.xml
Last active September 16, 2015 20:36 — forked from mpost/colors.xml
This gist demonstrates how to create an animated pause/resume media playback button for Android. It uses animated vector drawables and state transitions to orchestrate the effect. Some background: https://plus.google.com/u/0/+MoritzPost/posts/3EFF8uC7jXv
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="action_pause">#FF8F00</color>
<color name="action_resume">#43A047</color>
</resources>