Skip to content

Instantly share code, notes, and snippets.

@XuQK
XuQK / AndroidBug5497Workaround.java
Created May 2, 2018 02:04
解决全屏模式下"adjustResize"失效,软键盘会遮挡住"EditText"的问题
public class AndroidBug5497Workaround {
// For more information, see https://issuetracker.google.com/issues/36911528
// To use this class, simply invoke assistActivity() on an Activity that already has its content view set.
public static void assistActivity (View content) {
new AndroidBug5497Workaround(content);
}
private View mChildOfContent;
private int usableHeightPrevious;
# initialization file (not found)
@XuQK
XuQK / getCellphoneNumberThroughName.java
Last active November 19, 2016 13:25
通过联系人名字获取其行动电话号码
public static String getNumberThroughName(String name) {
//获取联系人的 ID 标识
Uri contactUri = ContactsContract.Contacts.CONTENT_URI;
String[] queryNameField = new String[] {name};
// 将 Contacts 表里 _ID 这一列,对应 DISPLAY_NAME 为 name 的一行单独提取出来组成数据表
Cursor contactCursor = getActivity().getContentResolver().query(contactUri,
new String[] {ContactsContract.Contacts._ID},
ContactsContract.Contacts.DISPLAY_NAME + " = ?",
queryNameField,
null);
@XuQK
XuQK / <SCHEMA_ID>.custom.yaml
Created November 23, 2012 03:18
Rime输入法特殊符号输入。
#只弄了我需要的,自己有需求的可以添加,我还另外改了几个标点符号,便于我自己使用
#建议直接复制进你的custom文档。
#欲使用本文件,你需要把文字候选数设置为7个,当然你也可以改变选择特殊符号的按键。
#作者E-mail:[email protected]
# Rime specific symbol settings
# encoding: utf-8无BOM
patch:
"punctuator/half_shape":