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
@Override | |
public void onActivityCreated(@Nullable Bundle savedInstanceState) { | |
super.onActivityCreated(savedInstanceState); | |
_setupLogger(); | |
_subscription = RxTextView.textChangeEvents(_inputSearchText)// | |
.debounce(400, TimeUnit.MILLISECONDS)// default Scheduler is Computation | |
.filter(new Func1<TextViewTextChangeEvent, Boolean>() { | |
@Override |
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
gradle.properties | |
marvel_public_key = 74129ef99c9fd5f7692608f17abb88f9 | |
marvel_private_key = 281eb4f077e191f7863a11620fa1865f2940ebeb | |
//app build.gradle | |
defaultConfig { | |
applicationId cfg.package | |
minSdkVersion cfg.minSdk | |
targetSdkVersion cfg.targetSdk | |
versionCode cfg.version_code | |
versionName cfg.version_name |
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
def getVersionCode = { -> | |
try { | |
def stdout = new ByteArrayOutputStream() | |
exec { | |
commandLine 'git', 'rev-list', '--all', '--count' | |
standardOutput = stdout | |
} | |
return Integer.parseInt(stdout.toString().trim())+400 | |
} | |
catch (ignored) { |
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
apply from: 'buildsystem/ci.gradle' | |
apply from: 'buildsystem/dependencies.gradle' | |
buildscript { | |
repositories { | |
jcenter() | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:2.2.0-alpha3' |
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
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
<!-- Define the background properties like color etc --> | |
<item android:id="@android:id/background"> | |
<shape android:shape="line"> | |
<stroke android:width="3dp" android:color="@color/white" /> | |
</shape> | |
</item> |
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
``` | |
android { | |
buildTypes { | |
debug { | |
applicationIdSuffix ".debug" | |
} | |
jnidebug { | |
initWith(buildTypes.debug) | |
applicationIdSuffix ".jnidebug" |
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 Singleton { | |
private volatile static Singleton INSTANCE; //声明成 volatile | |
private Singleton (){} | |
public static Singleton getSingleton() { | |
if (INSTANCE == null) { | |
synchronized (Singleton.class) { | |
if (INSTANCE == null) { | |
INSTANCE = new Singleton(); | |
} |
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
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.text.TextUtils; | |
import android.util.Log; | |
import cn.jpush.android.api.JPushInterface; | |
import com.moement.view.main.activity.GroomingActivity; | |
import java.util.Iterator; |
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
private Weather parseWeather(String weatherXml){ | |
//采用Pull方式解析xml | |
StringReader reader = new StringReader(weatherXml); | |
XmlPullParser xmlParser = Xml.newPullParser(); | |
Weather weather = null; | |
try { | |
xmlParser.setInput(reader); | |
int eventType = xmlParser.getEventType(); | |
while(eventType != XmlPullParser.END_DOCUMENT){ | |
switch (eventType){ |
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
<li> <a title="把这个链接拖到你的Chrome收藏夹工具栏中" href='javascript:(function() { | |
function c() { | |
var e = document.createElement("link"); | |
e.setAttribute("type", "text/css"); | |
e.setAttribute("rel", "stylesheet"); | |
e.setAttribute("href", f); | |
e.setAttribute("class", l); | |
document.body.appendChild(e) | |
} |