Skip to content

Instantly share code, notes, and snippets.

View glumes's full-sized avatar
🎯
Focusing

glumes glumes

🎯
Focusing
View GitHub Profile
@glumes
glumes / JavaByteUtil.md
Last active June 29, 2017 16:09
java 进制转换的工具代码
 /**
     * 十六进制字符串转换为字节数组
     *
     * @param paramString
     * @return
     */
    public static byte[] hexStringToByte(String paramString) {
        int j = paramString.length();
        byte[] arrayOfByte = new byte[j / 2];
@glumes
glumes / AndroidCamera2TouchToFocus.java
Created September 26, 2017 09:01 — forked from royshil/AndroidCamera2TouchToFocus.java
How to implement Touch-to-Focus in Android using Camera2 APIs
//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;
@glumes
glumes / PermissionsUtils.java
Created August 6, 2018 11:09
Android Permission Utils
public class PermissionsUtils {
/**
* 检测权限
*
* @return true:已授权; false:未授权;
*/
public static boolean checkPermission(Context context, String permission) {
if (ContextCompat.checkSelfPermission(context, permission) == PackageManager.PERMISSION_GRANTED)
ext {
kotlin_version = '1.2.70'
minSdkVersion = 22
compileSdkVersion = 26
targetSdkVersion = 26
supportLibraryVersion = "26.1.0"
constraintLayoutVersion = "1.1.3"
// Jetpack 相关