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
/** | |
* 判断是否是 Tablet | |
* | |
* @param activity Activity | |
* @return true, if is tablet device | |
*/ | |
public static boolean isTablet(Activity activity) { | |
DisplayMetrics dm = new DisplayMetrics(); | |
activity.getWindowManager().getDefaultDisplay().getMetrics(dm); | |
double diagonalPixels = Math.sqrt(Math.pow(dm.widthPixels, 2) + Math.pow(dm.heightPixels, 2)); |
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
/** | |
* 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