View jiagu.sh
#!/bin/bash | |
cd `dirname $0`/../ | |
projectDir=`pwd` | |
buildDir="$projectDir/build" | |
# release Official apk | |
cd $buildDir | |
touch timestampFile | |
echo "Build release official apk" |
View Json.kt
/* | |
* Copyright (c) 2018. Xi'an iRain IOT Technology service CO., Ltd (ShenZhen). All Rights Reserved. | |
*/ | |
package com.parkingwang.iop.api.json | |
import com.google.gson.Gson | |
import com.google.gson.GsonBuilder | |
import com.google.gson.reflect.TypeToken | |
import com.parkingwang.iop.api.services.park.objects.Version |
View bintray.gradle
task javadoc(type: Javadoc, dependsOn: 'assembleRelease') { | |
source = android.sourceSets.main.java.srcDirs | |
classpath += configurations.compile | |
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) | |
android.libraryVariants.all { variant -> | |
if (variant.name == 'release') { | |
owner.classpath += variant.javaCompile.classpath | |
} | |
} | |
} |
View TypeExtensions.kt
fun Date.toCalendar(): Calendar = Calendar.getInstance().apply { this.time = this@toCalendar } | |
fun Calendar.addDayOfMonth(amount: Int): Calendar { | |
this.add(Calendar.DAY_OF_MONTH, amount) | |
return this | |
} | |
fun Calendar.formatTo(formatter: SimpleDateFormat): String { | |
return formatter.format(this.timeInMillis) | |
} |
View build.gradle
task syncJavadoc(type: Sync) { | |
from javadoc.destinationDir | |
into rootProject.file('docs') | |
} |
View CountDown.java
Subscription subscription = Observable.interval(0, 1, TimeUnit.SECONDS) | |
.take(seconds + 1) | |
.map(new Func1<Long, Long>() { | |
@Override | |
public Long call(Long past) { | |
return seconds - past - 1; | |
} | |
}) | |
.filter(new Func1<Long, Boolean>() { | |
@Override |
View gist:f4753db527fb7dd6427053714e14f823
sudo apt-get install -y libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1 | |
View ForceableChoiceLayout.java
/** | |
* 绑定Checkable控件的Layout. | |
*/ | |
public static class ForceableChoiceLayout extends DefaultChoiceView { | |
/** | |
* 是否强制设为选中状态 | |
*/ | |
private boolean mForceChecked; |
View BorderLinearLayout.java
package com.parkingwang.widget; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.util.AttributeSet; | |
import android.widget.LinearLayout; | |
import com.parkingwang.app.R; |
View ToggleView.java
/* | |
* Copyright (c) 2015. Xi'an iRain IOT Technology Service CO., Ltd. All Rights Reserved. | |
*/ | |
package com.parkingwang.widget; | |
import android.content.Context; | |
import android.content.res.ColorStateList; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; |
NewerOlder