This file contains hidden or 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
| // Put it in your Activity and it'll apply to all EditTexts including those within fragments within that activity | |
| override fun dispatchTouchEvent(event: MotionEvent): Boolean { | |
| if (event.action == MotionEvent.ACTION_DOWN) { | |
| val v = currentFocus | |
| if (v is EditText) { | |
| val outRect = Rect() | |
| v.getGlobalVisibleRect(outRect) | |
| if (!outRect.contains(event.rawX.toInt(), event.rawY.toInt())) { | |
| v.clearFocus() | |
| val imm: InputMethodManager = |
This file contains hidden or 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
| #define GET_BYTE(val, n) (((val) >> (8*(n))) & 0xFF) | |
| #define GET_BYTE_FROM_END(val, n) (((val) >> (8*(sizeof((val)) - 1 - (n)))) & 0xFF) | |
| #define BSWAP16(val) \ | |
| ( (((val) >> 8) & 0x00FF) | (((val) << 8) & 0xFF00) ) | |
| #define BSWAP32(val) \ | |
| ( (((val) >> 24) & 0x000000FF) | (((val) >> 8) & 0x0000FF00) | \ | |
| (((val) << 8) & 0x00FF0000) | (((val) << 24) & 0xFF000000) ) |
This file contains hidden or 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
| /* INCLUDES *******************************************************************/ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| /* TYPES **********************************************************************/ | |
| #define BYTE unsigned char | |
| #define PBYTE BYTE* |
NewerOlder