Skip to content

Instantly share code, notes, and snippets.

@JS-Zheng
JS-Zheng / EditTextUtils.java
Created August 21, 2016 09:04
focusLastCharOfEditText
public void focusLastCharOfEditText(View view) {
if (view instanceof EditText) {
EditText editText = (EditText) view;
int pos = editText.getText().length();
editText.setSelection(pos);
editText.requestFocusFromTouch();
InputMethodManager imm = (InputMethodManager)getContext().getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
@JS-Zheng
JS-Zheng / Main.java
Created January 6, 2018 04:21
Hello, World!
public class Main {
public static void main(String[] args) {
// Just a comment
System.out.println("Hello, World!");
}
}
// Result:
// Hello, World!
@JS-Zheng
JS-Zheng / sgr.h
Created December 27, 2019 09:05
ANSI escape code - Select Graphic Rendition
//
// Created by Jason Zheng on 2019/12/4.
//
#ifndef SGR_H
#define SGR_H
#include <stdio.h>
#include <string.h>
@JS-Zheng
JS-Zheng / README.md
Created December 1, 2024 17:06
VRC (View for Role-Category) System: A Flexible Note-Taking