Skip to content

Instantly share code, notes, and snippets.

View cloud1105's full-sized avatar
🐈‍⬛
I may be slow to respond.

Leo Hu cloud1105

🐈‍⬛
I may be slow to respond.
View GitHub Profile
//生成Observer
Observer<String> observer = new Observer<String>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
@cloud1105
cloud1105 / DividerItemDecoration.java
Created March 9, 2016 02:16 — forked from alexfu/DividerItemDecoration.java
An ItemDecoration that draws dividers between items. Pulled from Android support demos.
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@cloud1105
cloud1105 / IntenUtils
Created October 26, 2013 06:46
take picture OR pick image from gallery
public class IntentUtils {
private static final String TAG = IntentUtils.class.getName();
public static Intent getPhotoCropIntent(File f, int width) {
Intent intent = new Intent("com.android.camera.action.CROP");
intent.setDataAndType(Uri.fromFile(f), "image/*");
intent.putExtra("crop", "true");
intent.putExtra("aspectX", 1);