This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
Copyright (C) 2015 The Android Open Source Project | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
there are some git command and git tutorial conllection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void save(String path, Map<Integer, Integer> map) {// int threadid, | |
// int position | |
SQLiteDatabase db = openHelper.getWritableDatabase(); | |
db.beginTransaction(); | |
try { | |
for (Map.Entry<Integer, Integer> entry : map.entrySet()) { | |
db.execSQL( | |
"insert into filedownlog(downpath, threadid, downlength) values(?,?,?)", | |
new Object[]{path, entry.getKey(), entry.getValue()}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2014 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set the Action Bar to use tabs for navigation | |
ActionBar ab = getSupportActionBar(); | |
ab.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); | |
// Add three tabs to the Action Bar for display | |
ab.addTab(ab.newTab().setText("Tab 1").setTabListener(this)); //ActionBar.TabListener | |
ab.addTab(ab.newTab().setText("Tab 2").setTabListener(this)); | |
ab.addTab(ab.newTab().setText("Tab 3").setTabListener(this)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AndroidApplication extends Application { | |
private ApplicationComponent applicationComponent; | |
@Override public void onCreate() { | |
super.onCreate(); | |
this.initializeInjector(); | |
this.initializeLeakDetection(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.kennyc.bottomsheet; | |
import android.content.Context; | |
import android.support.v4.view.ViewCompat; | |
import android.support.v4.widget.ViewDragHelper; | |
import android.util.AttributeSet; | |
import android.util.Log; | |
import android.view.MotionEvent; | |
import android.view.View; | |
import android.widget.FrameLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* courtesy: https://gist.github.com/benjchristensen/04eef9ca0851f3a5d7bf | |
*/ | |
public class RxBus { | |
//private final PublishSubject<Object> _bus = PublishSubject.create(); | |
// If multiple threads are going to emit events to this | |
// then it must be made thread-safe like this instead | |
private final Subject<Object, Object> _bus = new SerializedSubject<>(PublishSubject.create()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GithubService { | |
private GithubService() { } | |
public static GithubApi createGithubService(final String githubToken) { | |
Retrofit.Builder builder = new Retrofit.Builder().addCallAdapterFactory(RxJavaCallAdapterFactory.create()) | |
.addConverterFactory(GsonConverterFactory.create()) | |
.baseUrl("https://api.github.com"); | |
if (!TextUtils.isEmpty(githubToken)) { |
OlderNewer