This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.inperson.android.utils.leastview; | |
import android.content.Context; | |
import android.support.v7.widget.GridLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
import android.view.ViewGroup; | |
public class WrappableGridLayoutManager extends GridLayoutManager { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package xx.xxx.xx.view; | |
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.view.ViewGroup; | |
import android.widget.GridView; | |
/** | |
* ScrollViewの中のGridViewでも高さを可変にする<br> | |
* http://stackoverflow.com/questions/8481844/gridview-height-gets-cut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GSON can parse the data. | |
// | |
// Deserialization: | |
// Note there is a bug in GSON 2.3.1 that can cause it to StackOverflow when working with RealmObjects. | |
// To work around this, use the ExclusionStrategy below or downgrade to 1.7.1 | |
// See more here: https://code.google.com/p/google-gson/issues/detail?id=440 | |
// | |
// Serialization: | |
// <Type>RealmProxy objects are created by the Realm annotation processor. They are used to control | |
// access to the actual data instead of storing them in fields and it is therefore them we need to register a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.utils; | |
import android.content.Context; | |
import android.text.TextUtils; | |
import android.util.Patterns; | |
import android.widget.EditText; | |
/** | |
* Created by darshan on 2/4/15. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.content.res.AssetManager; | |
import android.os.Environment; | |
import android.util.Log; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by vaibhav.jani on 15-Jul-15. | |
*/ | |
public abstract class BaseFragment extends Fragment { | |
protected View rootView; | |
protected HomeActivity activity; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drawerLayout.setDrawerListener(new DrawerLayout.DrawerListener() { | |
@Override | |
public void onDrawerSlide(View drawerView, float slideOffset) { | |
float moveFactor = (drawerView.getWidth() * slideOffset); | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) | |
{ | |
flContent.setTranslationX(-moveFactor); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class KeyboardUtils { | |
public static void setKeyboardVisibilityListener(Activity activity, final KeyboardVisibilityListener keyboardVisibilityListener) { | |
final View contentView = activity.findViewById(android.R.id.content); | |
contentView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { | |
private int mPreviousHeight; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SignatureView extends View { | |
private static final float STROKE_WIDTH = 5f; | |
/** Need to track this so the dirty region can accommodate the stroke. **/ | |
private static final float HALF_STROKE_WIDTH = STROKE_WIDTH / 2; | |
private Paint paint = new Paint(); | |
private Path path = new Path(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.ByteArrayOutputStream; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.util.Base64; | |
public class Base64ImageUtil { | |
public static Bitmap stringToBitmap(String encodedString) { | |
try { |