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 <T extends View> T $(int id) { | |
return (T) super.findViewById(id); | |
} | |
public <T extends View> T $(View view, int id) { | |
return (T) view.findViewById(id); | |
} |
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.zrd.waukeen.common; | |
import android.content.Context; | |
import android.util.SparseArray; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
public class CommonViewHolder { | |
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
android {}外 定义 获取时间的函数 | |
def release_time() { | |
return new Date().format("yyyy-MM-dd_HH-mm-ss") | |
} | |
更改apk 名称 | |
//修改release apk名称 | |
android.applicationVariants.all { |
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
//质量压缩 | |
private Bitmap compressImage(Bitmap image) { | |
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |
image.compress(Bitmap.CompressFormat.JPEG, 100, baos);//质量压缩方法,这里100表示不压缩,把压缩后的数据存放到baos中 | |
int options = 100; | |
while ( baos.toByteArray().length / 1024>100) { //循环判断如果压缩后图片是否大于100kb,大于继续压缩 | |
baos.reset();//重置baos即清空baos | |
image.compress(Bitmap.CompressFormat.JPEG, options, baos);//这里压缩options%,把压缩后的数据存放到baos中 | |
options -= 10;//每次都减少10 |
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 jimbray on 2018/11/18. | |
* Email: jimbray16@gmail.com | |
*/ | |
public class RosBridgeClientManager { | |
private static final String TAG = RosBridgeClientManager.class.getSimpleName(); | |
private static RosBridgeClientManager instance; |
OlderNewer