Skip to content

Instantly share code, notes, and snippets.

View msdx's full-sized avatar

浩码农 msdx

View GitHub Profile
@msdx
msdx / ForceableChoiceLayout.java
Created September 19, 2016 04:15
ForceableChoiceLayout
/**
* 绑定Checkable控件的Layout.
*/
public static class ForceableChoiceLayout extends DefaultChoiceView {
/**
* 是否强制设为选中状态
*/
private boolean mForceChecked;
@msdx
msdx / BorderLinearLayout.java
Created April 13, 2016 03:25
带上下分割线的 LinearLayout
package com.parkingwang.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import com.parkingwang.app.R;
@msdx
msdx / CameraSize.java
Created January 8, 2016 05:47
set pictureSize and previewSize
private void openCamera() {
if (mCamera == null) {
try {
mCamera = Camera.open();
} catch (RuntimeException e) {
mCamera = null;
}
}
if (mCamera == null) {
MessageProxy.showError(this, R.string.msg_camera_invalid);
@msdx
msdx / TakePhoto.java
Last active January 8, 2016 03:24
Open camera.
private void openCamera() {
if (mCamera == null) {
try {
mCamera = Camera.open();
} catch (RuntimeException e) {
mCamera = null;
}
}
if (mCamera == null) {
MessageProxy.showError(this, R.string.msg_camera_invalid);