Skip to content

Instantly share code, notes, and snippets.

Greg Ennis grennis

Block or report user

Report or block grennis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
public class SoftInputAssist {
private View rootView;
private ViewGroup contentContainer;
private ViewTreeObserver viewTreeObserver;
private ViewTreeObserver.OnGlobalLayoutListener listener = () -> possiblyResizeChildOfContent();
private Rect contentAreaOfWindowBounds = new Rect();
private FrameLayout.LayoutParams rootViewLayout;
private int usableHeightPrevious = 0;
public SoftInputAssist(Activity activity) {
grennis /
Created May 11, 2016
This class allows easy use of SwipeRefreshLayout with RecyclerView (or ListView) and an "empty" view that can still be pulled to refresh
package com.innodroid.sample;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
grennis /
Created Apr 22, 2016
Android Rounded Corner Layout
// This layout will display its children with rounded corners
// It works with Glide image library placeholders and animations
// It assumes your background is a solid color. If you need the corners to be truly transparent,
// this solution will not work for you.
package com.myapp.ui;
import android.content.Context;
import shutil
import os
import json
material_dir = os.path.expanduser('~/material-design-icons-2.0/')
ios_dir = '../MyProject-ios/MyProject/Images.xcassets/'
dest_dir = 'app/src/main/res/drawable-'
densities = ['xxxhdpi', 'xxhdpi', 'xhdpi', 'hdpi', 'mdpi']
ios_res = {'1x': 'hdpi', '2x': 'xhdpi', '3x': 'xxhdpi'}
You can’t perform that action at this time.