Skip to content

Instantly share code, notes, and snippets.

浩码农 msdx

Block or report user

Report or block msdx

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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"
@msdx
msdx / Json.kt
Last active Nov 16, 2018
kotlin 泛型问题
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
@msdx
msdx / bintray.gradle
Created Nov 12, 2018
Android Gradle Javadoc Task
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
}
}
}
@msdx
msdx / TypeExtensions.kt
Last active Oct 17, 2018
Kotlin extensions
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')
}
@msdx
msdx / CountDown.java
Created Oct 26, 2017
rxjava countdown
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;
@msdx
msdx / BorderLinearLayout.java
Created Apr 13, 2016
带上下分割线的 LinearLayout
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;
@msdx
msdx / ToggleView.java
Created Mar 11, 2016
添加控件状态
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;
You can’t perform that action at this time.