$ adb shell input keyevent <keycode>| code | event | code | event | code | event |
|---|---|---|---|---|---|
| 0 | UNKNOWN | 30 | B | 60 | SHIFT_RIGHT |
| 1 | MENU | 31 | C | 61 | TAB |
| 2 | SOFT_RIGHT | 32 | D | 62 | SPACE |
| 3 | HOME | 33 | E | 63 | SYM |
| #!/bin/bash | |
| # params | |
| num=20 # total tests | |
| threads=5 # parallel processes | |
| # for script | |
| readonly CONST_NAN_PID=-1 | |
| # return 0 (true) if PID is running, otherwise return 1 (false) |
| public static Bitmap getBitmapFromRoundedBitmapDrawable(RoundedBitmapDrawable drawable) { | |
| Bitmap origin = null; | |
| try { | |
| Field[] declaredFields = RoundedBitmapDrawable.class.getDeclaredFields(); | |
| for (Field field : declaredFields) { | |
| if (field.getType().isAssignableFrom(Bitmap.class)) { | |
| field.setAccessible(true); | |
| origin = (Bitmap) field.get(drawable); | |
| break; | |
| } |
| func startServer(port string) { | |
| log.Println("Starting on port: " + port) | |
| serverMux := http.NewServeMux() | |
| serverMux.HandleFunc("/", handle) | |
| log.Println("ERROR: " + http.ListenAndServe(":" + port, serverMux).Error()) | |
| } |
| /** | |
| * Scale to center top or scale to center bottom | |
| * | |
| * @author sromku | |
| */ | |
| public class ImageScaleView extends ImageView { | |
| private MatrixCropType mMatrixType = MatrixCropType.TOP_CENTER; // default | |
| private enum MatrixCropType { |
$ adb shell input keyevent <keycode>| code | event | code | event | code | event |
|---|---|---|---|---|---|
| 0 | UNKNOWN | 30 | B | 60 | SHIFT_RIGHT |
| 1 | MENU | 31 | C | 61 | TAB |
| 2 | SOFT_RIGHT | 32 | D | 62 | SPACE |
| 3 | HOME | 33 | E | 63 | SYM |
| /** | |
| * The graph: | |
| * | |
| * ---- | |
| * / | |
| * / | |
| * / | |
| * ---- | |
| * | |
| * @author sromku |