/**
* 十六进制字符串转换为字节数组
*
* @param paramString
* @return
*/
public static byte[] hexStringToByte(String paramString) {
int j = paramString.length();
byte[] arrayOfByte = new byte[j / 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
ext { | |
kotlin_version = '1.2.70' | |
minSdkVersion = 22 | |
compileSdkVersion = 26 | |
targetSdkVersion = 26 | |
supportLibraryVersion = "26.1.0" | |
constraintLayoutVersion = "1.1.3" | |
// Jetpack 相关 |
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 PermissionsUtils { | |
/** | |
* 检测权限 | |
* | |
* @return true:已授权; false:未授权; | |
*/ | |
public static boolean checkPermission(Context context, String permission) { | |
if (ContextCompat.checkSelfPermission(context, permission) == PackageManager.PERMISSION_GRANTED) |
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
//Override in your touch-enabled view (this can be differen than the view you use for displaying the cam preview) | |
@Override | |
public boolean onTouch(View view, MotionEvent motionEvent) { | |
final int actionMasked = motionEvent.getActionMasked(); | |
if (actionMasked != MotionEvent.ACTION_DOWN) { | |
return false; | |
} | |
if (mManualFocusEngaged) { | |
Log.d(TAG, "Manual focus already engaged"); | |
return true; |