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
fun View.focusAndShowKeyboard() { | |
/** | |
* This is to be called when the window already has focus. | |
*/ | |
fun View.showTheKeyboardNow() { | |
if (isFocused) { | |
post { | |
// We still post the call, just in case we are being notified of the windows focus | |
// but InputMethodManager didn't get properly setup yet. | |
val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager |
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
inline fun <reified T : Activity> Context.startActivity() { | |
val intent = Intent(this, T::class.java) | |
startActivity(intent) | |
} | |
startActivity<MainActivity>() |
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
🌞 Morning 84 commits █████▏░░░░░░░░░░░░░░░ 24.5% | |
🌆 Daytime 193 commits ███████████▊░░░░░░░░░ 56.3% | |
🌃 Evening 6 commits ▎░░░░░░░░░░░░░░░░░░░░ 1.7% | |
🌙 Night 60 commits ███▋░░░░░░░░░░░░░░░░░ 17.5% |
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
git stash list // patch 파일 만들 stash 확인 | |
git stash show -p stash@{0} > filename.patch |
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
/** | |
* Dynamically discover and add modules in our project | |
* */ | |
val moduleBuildFileName = "build.gradle.kts" | |
// A pattern to match the prefix of our modules | |
val eligibleModuleNamePattern = "a_pattern_to_match_our_module_names".toRegex() // (e.g.: (app|android-|kotlin-).*) | |
// Filter directories that indicate modules | |
val moduleFilter: FileFilter = FileFilter { pathname: File -> |
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/sh | |
set -e | |
######## KTLINT-GRADLE HOOK START ######## | |
CHANGED_FILES="$(git --no-pager diff --name-status --no-color --cached | awk '$1 != "D" && $2 ~ /\.kts|\.kt/ { print $2}')" | |
if [ -z "$CHANGED_FILES" ]; then | |
echo "No Kotlin staged files." | |
exit 0 | |
fi; |
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
fun Intent?.toDebugString(): String { | |
val intent = this ?: return "" | |
return StringBuilder().apply { | |
appendLine("--- Intent ---") | |
appendLine("type: ${intent.type}") | |
appendLine("package: ${intent.`package`}") | |
appendLine("scheme: ${intent.scheme}") | |
appendLine("component: ${intent.component}") | |
appendLine("flags: ${intent.flags}") | |
appendLine("categories: ${intent.categories}") |