This is a Chinese version of https://gist.github.com/1207002/86f48cd3b3b72c85e6293926cf7c730de03b2f08 from lucasfais
⌘T | 前往文件 |
⌘⌃P | 前往项目 |
⌘R | 前往 method |
⌘⇧P | 命令提示 |
android { | |
applicationVariants.all { variant -> | |
variant.outputs.each { output -> | |
if (variant.getBuildType().isMinifyEnabled()) { | |
variant.assemble.doLast{ | |
copy { | |
from variant.mappingFile | |
into "${projectDir}/mappings" | |
rename { String fileName -> | |
"mapping-${variant.name}.txt" |
private void setTaskDescription(){ | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | |
String title = getString(R.string.app_name); | |
Bitmap icon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher); | |
int color = getResources().getColor(R.color.task_background); | |
// The legacy method call | |
// setTaskDescription(new ActivityManager.TaskDescription(title, icon, color)); | |
// The reflected method call |
#!/usr/bin/python | |
''' | |
Copyright 2009, 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 |
获取问题跟文章 | |
http://v3.wufazhuce.com:8000/api/reading/index/ | |
然后根据essay跟question id进去到不同的详细 | |
http://v3.wufazhuce.com:8000/api/question/1282 | |
http://v3.wufazhuce.com:8000/api/essay/1339 | |
获取首页 | |
http://v3.wufazhuce.com:8000/api/hp/idlist/0 | |
然后通过http://v3.wufazhuce.com:8000/api/hp/detail/1275 进入 |
public class EventLiveData extends LiveData<Object> { | |
private final int mSubject; | |
private final LifecycleRegistryOwner mLifecycle; | |
public EventLiveData(@LiveDataBus.Subject int subject, @NonNull LifecycleRegistryOwner lifecycle) { | |
mSubject = subject; | |
mLifecycle = lifecycle; | |
} |
apply from: 'deps.gradle' | |
// ... | |
dependencies { | |
compile supportLibs | |
compile rxJavaLibs | |
compile retrofitLibs | |
compile okHttpLibs |
project.afterEvaluate { | |
def isAndroidLibraryProject = project.plugins.hasPlugin('com.android.library') | |
if(isAndroidLibraryProject) { | |
task copyDeps(type:Copy) { | |
from configurations.compile { | |
include '**/*.jar' | |
} | |
into "./build/intermediates/bundles/release/libs/" | |
} | |
bundleRelease.dependsOn copyDeps |
This is a Chinese version of https://gist.github.com/1207002/86f48cd3b3b72c85e6293926cf7c730de03b2f08 from lucasfais
⌘T | 前往文件 |
⌘⌃P | 前往项目 |
⌘R | 前往 method |
⌘⇧P | 命令提示 |
Centralize the support libraries dependencies in gradle
Working with multi-modules project, it is very useful to centralize the dependencies, especially the support libraries.
A very good way is to separate gradle build files, defining something like:
root
--gradleScript
----dependencies.gradle
public class BlockDetect { | |
// BlockDetectByPrinter | |
public static void start() { | |
Looper.getMainLooper().setMessageLogging(new Printer() { | |
private static final String START = ">>>>> Dispatching"; | |
private static final String END = "<<<<< Finished"; | |
@Override |