Skip to content

Instantly share code, notes, and snippets.

View ammarques's full-sized avatar
:electron:
big things have small beginnings

Anderson Marques ammarques

:electron:
big things have small beginnings
View GitHub Profile
@ammarques
ammarques / setAlpha
Created December 17, 2015 23:12
change a solid color by adding a alpha percentual
ColorUtils.setAlphaComponent(Color.RED,80)
/*
* The function searchPlaces can be called continuously, no matter how many times it got invoked
* the Handler will remove all the last sequence request, and execute the last one.
* */
String fieldValue = "";
final private Handler handler = new Handler();
final private Runnable runnable = new Runnable() {
@Override
public void run() {
@ammarques
ammarques / gist:acf2c97ca2a75a54d8de
Created September 16, 2015 15:52
grep recursive, highlited while avoid binary files
grep -r --color=always -I "WORD" .
@ammarques
ammarques / gist:31402368b0ab15716865
Created March 26, 2015 19:20
Different sizes in the same TextView while keep their style.
String text = "R$ 2.086,01"
String pathern = ",";
int start = text.lastIndexOf(pathern);
int end = ((text.length()) - start);
final SpannableString span = new SpannableString(text);
span.setSpan(new RelativeSizeSpan(0.5f), start, (start + end), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
someTextView.setText(span);