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
/** | |
* Created by Miao1007 on 2/2/15. | |
* | |
* Original Code: https://gist.github.com/miao1007/3f7e9b5f011fc188eba6 | |
*/ | |
public class GradientTransformation implements Transformation { | |
int startColor = Color.argb(240,0,0,0); | |
int endColor = Color.TRANSPARENT; |
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 FlyMeUtils { | |
/** | |
* setDarkStatusBar on FlyMe | |
* 设置状态栏字体为暗色 仅魅族有效 | |
*/ | |
public static void setDarkStatusBar(Activity activity, boolean isDark) { | |
WindowManager.LayoutParams lp = activity.getWindow().getAttributes(); | |
try { | |
Class<?> instance = Class.forName("android.view.WindowManager$LayoutParams"); |
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
buildTypes { | |
release { | |
minifyEnabled true //run proguard | |
shrinkResources true | |
proguardFile 'proguard-square.pro' | |
// Default proguard files(including support libs) | |
proguardFiles getDefaultProguardFile('proguard-android.txt') | |
} | |
} |
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
/** | |
* Created by leon on 2/16/15. | |
* Download update apk with SystemService. | |
* require: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> | |
*/ | |
public class DownloadUtils { | |
public static String MINETYPE_APPLCATION = "application/vnd.android.package-archive"; | |
public static long DownloadApkWithProgress(Context context, String url) { |
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
dependencies { | |
compile 'io.reactivex:rxjava:1.0.12' | |
compile 'com.squareup.okhttp:okhttp:2.5.0' | |
compile 'com.squareup.retrofit:retrofit:2.0.0-beta1' | |
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta1' | |
compile 'com.squareup.retrofit:adapter-rxjava:2.0.0-beta1' | |
} |
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 okio.ByteString; | |
/** | |
* Created by leon on 8/23/15. | |
* 数据传输单元转换封装 | |
*/ | |
public class APDUUtils { | |
/** | |
* Eg: getBitInByte(0x80,7) == true |
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
#!/bin/sh | |
#install go with brew | |
brew update | |
brew install go | |
#make go dir | |
cd ~ | |
mkdir goroot | |
mkdir gopath |
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
#!/bin/sh | |
#delay 30 minute | |
delay=-v-30M | |
#image location | |
location=$HOME/Pictures/himawari8 | |
date=$(date -u $delay "+%Y/%m/%d") | |
file_name=$(date -u $delay "+%H")$(echo "($(date -u $delay "+%M"))/10 * 10" | bc)"00_0_0.png" | |
url=http://himawari8-dl.nict.go.jp/himawari8/img/D531106/1d/550/$date/$file_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
package com.github.miao1007.myapplication; | |
import android.annotation.TargetApi; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.drawable.ColorDrawable; | |
import android.os.Build; |
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
package com.xxxx.xxxx.xxx.utils; | |
import org.jsoup.Jsoup; | |
import org.jsoup.nodes.Document; | |
import org.jsoup.nodes.Element; | |
import org.jsoup.select.Elements; | |
import java.io.File; | |
import java.util.ArrayList; | |
import java.util.List; |
OlderNewer