Skip to content

Instantly share code, notes, and snippets.

apply plugin: 'com.jakewharton.butterknife'
dependencies {
compile 'com.jakewharton:butterknife:8.4.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'
}
}
<family lang="ko">
<font weight="400" style="normal" index="1">NotoSansCJK-Regular.ttc</font>
</family>
+ <family lang="ko">
+ <font weight="400" style="normal" index="1">NanumGothic.ttf</font>
+ </family>
<family lang="und-Zsye">
<font weight="400" style="normal">NotoColorEmoji.ttf</font>
</family>
public class log {
public static final String tag = "PYEONGHO";
public final static boolean debug = BuildConfig.DEBUG;
public final static boolean debug1 = true;
private static boolean getDebug(){
if(debug && debug1){
return true;
private class mWebViewClient extends WebViewClient {
@Override
public void onReceivedSslError(WebView view, final SslErrorHandler handler, SslError error){
StringBuilder sb= new StringBuilder();
if (error != null) {
switch (error.getPrimaryError()) {
case SslError.SSL_EXPIRED:
sb.append("이 사이트의 보안 인증서가 만료되었습니다.\n");
break;
case SslError.SSL_IDMISMATCH:
PackageManager pm = getPackageManager();
try {
PackageInfo pi = pm.getPackageInfo("com.google.android.webview", 0);
Log.d("UILAb", "version name: " + pi.versionName);
Log.d("UILAb", "version code: " + pi.versionCode);
} catch (PackageManager.NameNotFoundException e) {
}
private List<Recent> items= null;
private ArrayList<Recent> arrayList;
public RecyclerAdapter(Context context, List<Recent> items) {
this.mCtx=context;
this.items=items;
arrayList = new ArrayList<Recent>();
arrayList.addAll(items);
}
private void doSomeWork() {
getObservable()
// Run on a background thread
.subscribeOn(Schedulers.io())
// Be notified on the main thread
.observeOn(AndroidSchedulers.mainThread())
.subscribe(getObserver());
}
private Observable<String> getObservable() {
private Observable<List<ApiUser>> getObservable() {
return Observable.create(new ObservableOnSubscribe<List<ApiUser>>() {
@Override
public void subscribe(ObservableEmitter<List<ApiUser>> e) throws Exception {
if (!e.isDisposed()) {
e.onNext(Utils.getApiUserList());
e.onComplete();
}
}
});
public class AppClient {
public static Retrofit mRetrofit;
public static Retrofit retrofit() {
if (mRetrofit == null) {
OkHttpClient.Builder builder = new OkHttpClient.Builder();
if (BuildConfig.DEBUG) {
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);