This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 { |
This file contains hidden or 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.IOException; | |
| import android.annotation.TargetApi; | |
| import android.app.Activity; | |
| import android.app.PendingIntent; | |
| import android.content.BroadcastReceiver; | |
| import android.content.ContentValues; | |
| import android.content.Context; | |
| import android.content.Intent; |
This file contains hidden or 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.util.HashMap; | |
| import java.util.Map; | |
| public class HelloWorld { | |
| public static void main(String[] args) { | |
| String str = "this is what this is"; | |
| System.out.println(str); |
This file contains hidden or 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.SharedPreferences; | |
| public class AppPreferences { | |
| private static String PREFERENCE_FILE_NAME = "application_preferences"; | |
| public static String IMEI = "imei"; | |
| private static SharedPreferences getSharedPreferences(Context context) { |
OlderNewer