Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

glumes glumes

🎯
Focusing
Block or report user

Report or block glumes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

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