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
nmap <S-l> gt | |
nmap <S-h> gT | |
nmap <S-w>L :action VimWindowRight<CR> | |
nmap <S-w>H :action VimWindowLeft<CR> | |
nmap <S-w>J :action VimWindowDown<CR> | |
nmap <S-w>K :action VimWindowUp<CR> | |
nmap <M-j> 5j5<C-e> | |
nmap <M-k> 5k5<C-y> | |
"for window <C-r>" in insert mode, for mac cmd+v | |
imap <C-r>" <esc>:action EditorPaste<CR>a |
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
// ============ vim ============ // | |
"vim.easymotion": true, | |
"vim.incsearch": true, | |
"vim.useSystemClipboard": true, | |
"vim.useCtrlKeys": true, | |
"vim.hlsearch": true, | |
"vim.otherModesKeyBindingsNonRecursive": [ | |
{ | |
"before": [ | |
"L" |
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
//common validate = 1 | |
const val VALIDATE = 0x000000000000101 | |
const val INVALIDATE = 0x000000000000102 | |
//common string = 2 | |
const val INVALIDATE_EMPTY = 0x000000000000201 or INVALIDATE | |
//email validate = 3 | |
const val INVALIDATE_EMAIL = 0x000000000000301 or INVALIDATE | |
const val INVALIDATE_EMAIL_FORMAT = 0x000000000000302 or INVALIDATE_EMAIL |
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 @receiver:ValidateString Int.isValidate(): Boolean = this and VALIDATE == VALIDATE | |
fun @receiver:ValidateString Int.isInvalidate(): Boolean = this and INVALIDATE == INVALIDATE | |
fun String?.validateCommon(): Int { | |
if (this.isNullOrEmpty()) return INVALIDATE_EMPTY | |
return VALIDATE | |
} | |
fun @receiver:ValidateString Int.isInvalidateEmail(): Boolean = this and INVALIDATE_EMAIL == INVALIDATE_EMAIL | |
fun String?.validateEmail(): Int { | |
if (this.validateCommon().isInvalidate()) return this.validateCommon() |
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.IntDef | |
import java.util.regex.Pattern | |
/** | |
* Created by「 The Khaeng 」on 27 Mar 2018 :) | |
*/ | |
//common validate at index 0 | |
const val VALIDATE = 0x0001 | |
const val INVALIDATE = 0x0002 |
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
//common validate at index 0 | |
const val VALIDATE = 0x0001 | |
const val INVALIDATE = 0x0002 | |
//common string validate at index 1 | |
const val INVALIDATE_EMPTY = 0x0010 or INVALIDATE | |
//email validate at index 2 | |
const val INVALIDATE_EMAIL = 0x0100 or INVALIDATE | |
const val INVALIDATE_EMAIL_FORMAT = 0x0200 or INVALIDATE_EMAIL |
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 com.thekhaeng.systemui.view | |
import android.content.Context | |
import android.graphics.Rect | |
import android.os.Build | |
import android.support.annotation.RequiresApi | |
import android.util.AttributeSet | |
import android.view.View | |
import android.view.WindowInsets | |
import com.thekhaeng.systemui.R |
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
var statusBarHeight: Int = 0 | |
ViewCompat.setOnApplyWindowInsetsListener(rootView) { view, windowInsets -> | |
statusBarHeight = windowInsets.systemWindowInsetTop | |
return windowInsets //pass insets down to child 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
class CustomLayout : LinearLayout { | |
... | |
@Suppress("OverridingDeprecatedMember") | |
override | |
fun fitSystemWindows(insets: Rect): Boolean { | |
// Pre API 20: do something with insets | |
return true //consume inset: not pass insets down |
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
ViewCompat.setOnApplyWindowInsetsListener(rootView) { view, windowInsets -> | |
// do something with insets | |
return windowInsets.consumeSystemWindowInsets() //consume inset: not pass insets down | |
//or | |
return windowInsets //pass insets down to child view | |
} |
NewerOlder