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
private DisplayImageOptions options; | |
public static ImageLoader imageLoader; | |
imageLoader = ImageLoader.getInstance(); | |
imageLoader.init(ImageLoaderConfiguration.createDefault(activity)); | |
options = new DisplayImageOptions.Builder().cacheOnDisc(true) | |
.showStubImage(R.drawable.ic_launcher) | |
.showImageOnFail(R.drawable.images).build(); | |
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
private void selectImage() { | |
final CharSequence[] options = { "Take Photo", "Choose from Gallery","Cancel" }; | |
AlertDialog.Builder builder = new AlertDialog.Builder(SignUp.this); | |
builder.setTitle("Add Photo!"); | |
builder.setItems(options, new DialogInterface.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialog, int item) { | |
if (options[item].equals("Take Photo")) |
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 Uri getImageUri(Context inContext, Bitmap inImage) { | |
ByteArrayOutputStream bytes = new ByteArrayOutputStream(); | |
inImage.compress(Bitmap.CompressFormat.JPEG, 100, bytes); | |
String path = MediaStore.Images.Media.insertImage(inContext.getContentResolver(), inImage, "Title", null); | |
return Uri.parse(path); | |
} | |
private String getPath(Uri uri) { | |
String[] projection = { MediaStore.Images.Media.DATA }; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<!-- google's material design colours from | |
http://www.google.com/design/spec/style/color.html#color-ui-color-palette --> | |
<!--reds--> | |
<color name="md_red_50">#fde0dc</color> | |
<color name="md_red_100">#f9bdbb</color> | |
<color name="md_red_200">#f69988</color> |
NewerOlder