Skip to content

Instantly share code, notes, and snippets.

浩码农 msdx

Block or report user

Report or block msdx

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@msdx
msdx / TakePhoto.java
Last active Jan 8, 2016
Open camera.
View TakePhoto.java
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 / CameraSize.java
Created Jan 8, 2016
set pictureSize and previewSize
View CameraSize.java
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 / ClipImage.java
Last active Sep 21, 2017
大图裁剪
View ClipImage.java
package com.parkingwang.app.account.vehicle.takephoto;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.BitmapRegionDecoder;
import android.graphics.Matrix;
import android.graphics.Rect;
View TakePhotoActivity.java
import android.app.Activity;
import android.content.Intent;
import android.graphics.ImageFormat;
import android.hardware.Camera;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.ViewGroup;
@msdx
msdx / ToggleView.java
Created Mar 11, 2016
添加控件状态
View ToggleView.java
/*
* Copyright (c) 2015. Xi'an iRain IOT Technology Service CO., Ltd. All Rights Reserved.
*/
package com.parkingwang.widget;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Canvas;
@msdx
msdx / BorderLinearLayout.java
Created Apr 13, 2016
带上下分割线的 LinearLayout
View BorderLinearLayout.java
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;
View ForceableChoiceLayout.java
/**
* 绑定Checkable控件的Layout.
*/
public static class ForceableChoiceLayout extends DefaultChoiceView {
/**
* 是否强制设为选中状态
*/
private boolean mForceChecked;
View gist:f4753db527fb7dd6427053714e14f823
sudo apt-get install -y libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1
@msdx
msdx / CountDown.java
Created Oct 26, 2017
rxjava countdown
View CountDown.java
Subscription subscription = Observable.interval(0, 1, TimeUnit.SECONDS)
.take(seconds + 1)
.map(new Func1<Long, Long>() {
@Override
public Long call(Long past) {
return seconds - past - 1;
}
})
.filter(new Func1<Long, Boolean>() {
@Override
View build.gradle
task syncJavadoc(type: Sync) {
from javadoc.destinationDir
into rootProject.file('docs')
}
You can’t perform that action at this time.