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
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'` |
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
startTime=$[$(date +%s%N)/1000000] |
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
usedTimeHourFormatted="`awk 'BEGIN{printf "%.1f\n",('${endTime}'-'${startTime}')/'3600000'}'`小时" |
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
package me.panpf.event | |
import android.annotation.TargetApi | |
import android.app.Activity | |
import android.app.Application | |
import android.os.Build | |
import android.os.Bundle | |
import android.support.annotation.RequiresApi | |
import android.support.v4.app.FragmentActivity | |
import android.view.View |
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
@file:Suppress("unused") | |
package me.panpf.args.ktx | |
import android.app.Activity | |
import android.os.Build | |
import android.os.Bundle | |
import android.os.IBinder | |
import android.os.Parcelable | |
import android.support.annotation.RequiresApi |
NewerOlder