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
val View.lifecycleOwner: LifecycleOwner | |
get() { | |
synchronized(this) { | |
/* | |
* After Lifecycle enters the DESTROYED state, its coroutineScope will be canceled and can no longer be used. | |
* So you must create a new Lifecycle every time onAttachedToWindow | |
*/ | |
check(ViewCompat.isAttachedToWindow(this)) { | |
"View.lifecycleOwner can only be called after onAttachedToWindow and before onDetachedFromWindow" | |
} |
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.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import android.util.Base64; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.security.InvalidAlgorithmParameterException; | |
import java.security.InvalidKeyException; |
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
要实现透明的Activity很简单,只需要给Activity设置一个透明的主题即可 | |
<activity | |
android:name="xxxxxxxx" | |
android:theme="@android:style/Theme.Translucent"> | |
<intent-filter> | |
<action android:name="android.intent.action.LAUCHER" /> | |
<category android:name="android.intent.category.DEFAULT" /> | |
</intent-filter> | |
</activity> |
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 java.io.*; | |
import java.net.URI; | |
import java.nio.file.FileSystem; | |
import java.nio.file.*; | |
import java.nio.file.attribute.BasicFileAttributes; | |
import java.util.HashMap; | |
import java.util.LinkedList; | |
import java.util.Map; | |
public class ChannelApkGenerator { |
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 java.io.*; | |
import java.util.LinkedList; | |
import java.util.List; | |
public class BatchConfiguration { | |
public int version = -1; | |
public List<MCPComment> commentList; | |
private BatchConfiguration() { |
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
include(":app", ":router", ":router-annotation", ":router-compiler", ":download", ":app-installer", ":app-packages") | |
project(":download").projectDir = File("../download/download") | |
project(":app-installer").projectDir = File("../app-installer/app-installer") | |
project(":app-packages").projectDir = File("../app-packages/app-packages") |
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
originParams='"hello world"' | |
originParamsFormatted=`echo ${originParams//'"'/'\"'}` # 输出结果 \"hello world\" |
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 | |
# 如果需要监控指定命令的执行结果,失败时自动发邮件,就只需在最前面用此命令执行即可,例如 monitor echo "hello world" | |
# 得到当前脚本文件所在的绝对路径 | |
basePath=$(cd `dirname $0`; pwd) | |
# 执行并记录状态码 | |
# 如果原本参数里有双引号或单引号的话,直接执行 '$@',会失败 | |
# 用 echo "$@" 打印后看不到原本的双引号或单引号,例如 hive -e "select * from test" 就会变成 hive -e select * from test |
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
basePath=$(cd `dirname $0`; pwd) |
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
startTimeFormatted=`date '+%Y-%m-%d %a %H:%M:%S'` |
NewerOlder