Skip to content

Commit

Permalink
优化代码结构
Browse files Browse the repository at this point in the history
  • Loading branch information
xielipeng committed Nov 15, 2016
1 parent 10c8061 commit 2bc2897
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;

Expand Down Expand Up @@ -69,9 +68,7 @@ public void takeFail(TResult result, String msg) {
@Override
public void takeSuccess(TResult result) {
super.takeSuccess(result);
Log.d(TAG, "takeSuccess: " + result.getImages().toString());
mImgs = result.getImages();
Log.d(TAG, "takeSuccess: " + mImgs.size());

mAdapter = new ImgAdapter(R.layout.recyclerview_item_image, mImgs);
mRecyclerView.setAdapter(mAdapter);
Expand All @@ -92,14 +89,14 @@ protected void startAnim(Animator anim, int index) {

@Override
protected void convert(BaseViewHolder holder, TImage item) {
Log.d(TAG, "convert: " + item.getPath());
ImageView imageView = holder.getView(R.id.iv_image);
if (imageView != null) {
Log.d(TAG, "convert: image...");
Glide.with(MyAppliction.getInstance()).load(item.getPath())
Glide.with(MyAppliction.getInstance())
.load(item.getPath())
.error(R.mipmap.ic_launcher)
.into(imageView);
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class MyAppliction extends Application {
@Override
public void onCreate() {
super.onCreate();
instance=this;
instance = this;
}

public static MyAppliction getInstance() {
Expand Down
17 changes: 0 additions & 17 deletions app/src/main/java/org/xielipeng/takephotodemo/modle/Image.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ public void setAllowFullScreen(boolean allowFullScreen) {
protected boolean isCrop; // 是否压缩
protected boolean isCompress; // 是否裁剪

/**
*
* @param context
* @param limit 图片张数
* @param isCrop 是否裁剪
* @param isCompress 是否压缩
*/
protected void popup(Context context, int limit, boolean isCrop, boolean isCompress) {
this.limit = limit;
this.isCrop = isCrop;
Expand Down

0 comments on commit 2bc2897

Please sign in to comment.