Skip to content

Instantly share code, notes, and snippets.

View lugeek's full-sized avatar

JiaMing Lu lugeek

View GitHub Profile
// Podfile.local中添加这个依赖进去
pod 'LookinServer', :configurations => ['Debug'], :git => 'https://github.com/QMUI/LookinServer', :tag => '1.0.0'
# ---------------------------------------
echo "shell定义字典"
#必须先声明
declare -A dic
dic=([key1]="value1" [key2]="value2" [key3]="value3")
#打印指定key的value
echo ${dic["key1"]}
#打印所有key值
echo ${!dic[*]}
public static int getStatusBarHeight(Context context){
Class<?> c = null;
Object obj = null;
Field field = null;
int x = 0, statusBarHeight = 0;
try {
c = Class.forName("com.android.internal.R$dimen");
obj = c.newInstance();
field = c.getField("status_bar_height");
x = Integer.parseInt(field.get(obj).toString());
@lugeek
lugeek / gist:c970765e73abf50925991e61cf2e6fef
Created March 21, 2017 15:44
Android:use xml to center some views,singleline textview and the right view will not disappear
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="200dp"
android:orientation="horizontal"
tools:context="com.lugeek.dividertest.MainActivity">