Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block bastami82

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
bastami82 / gist:ef5987b79353978223b74257f42c09c9
Last active Apr 4, 2018
set drwabale icon backward compatible
View gist:ef5987b79353978223b74257f42c09c9
THE_VIEW.setBackgroundDrawable(AppCompatResources.getDrawable(ctx, R.drawable.ic_report_review);
//with drwable left
THE_VIEW.setCompoundDrawablesWithIntrinsicBounds(AppCompatResources.getDrawable(ctx, R.drawable.ic_report_review), null, null, null);
bastami82 /
Created Jan 3, 2018
using Android handler as a timer to check a condition
private Runnable runnable;
private Handler handler;
private boolean condition;
runnable = () -> {
if (condition) {
handler.removeCallbacks(runnable); //stop handler
} else {
handler.postDelayed(runnable, 500); //check a condition every half a second (until condition is met)
You can’t perform that action at this time.