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
# Glide 加载本地图片 | |
public static final String ANDROID_RESOURCE = "android.resource://"; | |
public static final String FOREWARD_SLASH = "/"; | |
private static Uri resourceIdToUri(Context context, int resourceId) { | |
return Uri.parse(ANDROID_RESOURCE + context.getPackageName() + FOREWARD_SLASH + resourceId); | |
} | |
//这可能是任何 Uri。为了演示的目的我们只是用一个 launcher icon 去创建了一个 Uri |
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
Can't build android. Execution failed for task ':generateJsonModelDebug'. | |
因为没有ninja | |
https://stackoverflow.com/questions/54500937/cocos2d-x-android-build-failed |
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
#!/bin/env python | |
from PIL import Image | |
from os.path import realpath | |
from os import getcwd | |
from sys import argv | |
from setproctitle import setproctitle |
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
allprojects { | |
repositories { | |
jcenter() | |
} | |
gradle.taskGraph.whenReady { | |
tasks.each { task -> | |
if (task.name.equals('mockableAndroidJar')) { | |
task.enabled = false | |
} | |
} |
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
adb tcpip 5555 # 5555为一个自定义的端口,只要与下一行命令的端口保持统一即可 | |
adb connect 192.168.0.101:5555 # 192.168.0.101为手机无线网络的ip地址 | |
adb usb |
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
``` | |
ViewOutlineProvider实现圆角 | |
roundImage.setOutlineProvider(new ViewOutlineProvider() { | |
@Override | |
public void getOutline(View view, Outline outline) { | |
outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), 30); | |
} | |
}); | |
roundImage.setClipToOutline(true); |
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
https://juejin.im/post/5d689058e51d4562054103e0 |
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
- 长按进入拖拽 | |
- 增加拖拽时间监听 | |
``` | |
import android.content.ClipData; | |
import android.content.ClipDescription; | |
import android.graphics.Color; | |
import android.net.Uri; | |
import android.os.ParcelFileDescriptor; |
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
/* | |
* Copyright (C) 2016 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
#/bin/bash | |
function createGif() { | |
if [ -e $mp4_name ]; then | |
rm -rf $mp4_name | |
fi | |
echo "record the screen" | |
adb shell screenrecord $mp4_name --size 1080x1920 --time-limit 10 | |
echo "download the screen file" |