Skip to content

Instantly share code, notes, and snippets.

@smithaaron
smithaaron / ExampleUsage.java
Last active June 28, 2016 16:46
This is a Picasso Transformation used to make images look like speech bubbles.
//In my case I first resize the image to a max width of 300dp as I'm displaying in a list and want them to look uniform
//Then for the margin and raidus measurements, I convert from dp to px, so that it appears the same on different screens.
Picasso.with(mContext)
.load(imageUrl)
.resize((int)UiUtils.dpToPx(mContext, 300), 0)
.transform(new SpeechBubbleTransform((int)UiUtils.dpToPx(mContext, 8), (int)UiUtils.dpToPx(mContext,12), SpeechBubbleTransform.Corner.BOTTOM_LEFT))
.into(holder.mIvPhotoMessage);
@smithaaron
smithaaron / ClickToSelectEditText.java
Last active January 2, 2019 18:37 — forked from rodrigohenriques/ClickToSelectEditText.java
Used to make your EditText a better option than Spinners
public class ClickToSelectEditText <T> extends AppCompatEditText {
CharSequence mHint;
OnItemSelectedListener<T> onItemSelectedListener;
ListAdapter mSpinnerAdapter;
public ClickToSelectEditText(Context context) {
super(context);