Skip to content

Instantly share code, notes, and snippets.

View mnafian's full-sized avatar
🎯
Focusing

M. Nafian Wildana mnafian

🎯
Focusing
View GitHub Profile
@mnafian
mnafian / MyApp.java
Created January 19, 2016 09:53 — forked from artem-zinnatullin/MyApp.java
If you need to set one font for all TextViews in android application you can use this solution. It will override ALL TextView's typefaces, includes action bar and other standard components, but EditText's password font won't be overriden.
public class MyApp extends Application {
@Override
public void onCreate() {
TypefaceUtil.overrideFont(getApplicationContext(), "SERIF", "fonts/Roboto-Regular.ttf"); // font from assets: "assets/fonts/Roboto-Regular.ttf
}
}
@mnafian
mnafian / Android unzip file using ZipInputStream
Created January 30, 2016 04:47 — forked from shengoo/Android unzip file using ZipInputStream
Android unzip file using ZipInputStream
public class unzip extends Activity {
/** Called when the activity is first created. */
static final int BUFFER = 2048;
TextView textView;
@Override
public void onCreate(Bundle savedInstanceState) {
textView = new TextView(this);
@mnafian
mnafian / RxJava.md
Created November 6, 2016 07:24 — forked from cesarferreira/RxJava.md
Party tricks with RxJava, RxAndroid & Retrolambda

View Click

Instead of the verbose setOnClickListener:

RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));

Filter even numbers

Observable
    .just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)