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
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.4' | |
} | |
} | |
apply plugin: 'android' |
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
-assumenosideeffects class android.util.Log { | |
public static boolean isLoggable(java.lang.String,int); | |
public static int v(...); | |
public static int i(...); | |
public static int w(...); |
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"?> | |
<TabHost xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@android:id/tabhost" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent"> | |
<LinearLayout | |
android:orientation="vertical" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent"> | |
<TabWidget |
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
/** | |
* 计算透明度百分比对应的十六进制值 | |
*/ | |
println "透明度百分比 -> 16进制" | |
for (int percent = 100; percent >= 0; percent--) { | |
int alpha = Math.round(255 * percent / 100d); | |
// println String.format("% 2d%% -> %s ", percent, Integer.toHexString(alpha).toUpperCase()) |
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 TypeFactory { | |
public static Type $List(Type type) { | |
return $Gson$Types.newParameterizedTypeWithOwner(null, List.class, type); | |
} | |
public static Type $Set(Type type) { | |
return $Gson$Types.newParameterizedTypeWithOwner(null, Set.class, type); | |
} |
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 gradle = getGradle() | |
println "***************************************************" | |
println "Dump gradle information" | |
println "Version:${gradle.getGradleVersion()}" | |
println "UserHomeDir:${gradle.getGradleUserHomeDir()}" | |
println "HomeDir:${gradle.getGradleHomeDir()}" | |
println "***************************************************" | |
// Maven credentials | |
def NEXUS_SERVER = "http://nexus.xxx.com/content/groups/public" |
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
oldActivity="" | |
displayName="" | |
currentActivity=`adb shell dumpsys activity | grep mFocusedActivity` | |
while true | |
do | |
if [[ $oldActivity != $currentActivity && $currentActivity != *"=null"* ]]; then | |
displayName=${currentActivity% *} | |
displayName=${displayName##* } | |
echo $displayName | |
oldActivity=$currentActivity |
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.addListener(new BuildTimeListener()) | |
class BuildTimeListener implements TaskExecutionListener, BuildListener { | |
private org.gradle.internal.time.Clock clock | |
private costTimeMap = [:] | |
@Override | |
void beforeExecute(Task task) { | |
clock = new org.gradle.internal.time.Clock() | |
} |
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
build.gradle | |
sourceSets { | |
def p_module_names = projectDir.listFiles() | |
.findAll { | |
// filter all pin project | |
return it.isDirectory() && it.name.startsWith('p_') | |
} | |
main { |
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 plugin: 'maven-publish' | |
task androidJavadocs(type: Javadoc) { | |
source = android.sourceSets.main.java.srcDirs | |
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) | |
android.libraryVariants.all { variant -> | |
if (variant.name == 'release') { | |
owner.classpath += variant.javaCompile.classpath | |
} | |
} |
OlderNewer