Skip to content

Commit

Permalink
更换图片加载位置文件
Browse files Browse the repository at this point in the history
  • Loading branch information
r17171709 committed Jun 12, 2017
1 parent 92876d8 commit a38ffbd
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ImageLibrary/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
compile 'com.github.r17171709:AndroidCommonLibrary:v1.0.8'
compile 'com.github.r17171709:AndroidCommonLibrary:v1.0.12'
// CircleIndicator A lightweight viewpager indicator like in nexus 5 launcher
compile 'me.relex:circleindicator:1.2.2@aar'
// PhotoDraweeView PhotoView For Fresco
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.facebook.imagepipeline.common.ResizeOptions;
import com.facebook.imagepipeline.request.ImageRequest;
import com.facebook.imagepipeline.request.ImageRequestBuilder;
import com.renyu.commonlibrary.commonutils.ResourceUtils;
import com.renyu.imagelibrary.R;
import com.renyu.imagelibrary.bean.Photo;

Expand Down Expand Up @@ -89,7 +90,7 @@ public void onClick(View v) {
return;
}
models.get(position).setSelect(!flag);
holder.photopicker_choice.setImageResource(!flag?R.mipmap.ic_choice_select:R.mipmap.ic_choice_normal);
holder.photopicker_choice.setImageResource(!flag? ResourceUtils.getMipmapId(context, "ic_choice_select"):ResourceUtils.getMipmapId(context, "ic_choice_normal"));
if (!flag) {
listener.add(models.get(position).getPath());
}
Expand All @@ -98,7 +99,7 @@ public void onClick(View v) {
}
}
});
holder.photopicker_choice.setImageResource(models.get(position).isSelect()?R.mipmap.ic_choice_select:R.mipmap.ic_choice_normal);
holder.photopicker_choice.setImageResource(models.get(position).isSelect()?ResourceUtils.getMipmapId(context, "ic_choice_select"):ResourceUtils.getMipmapId(context, "ic_choice_normal"));
}

@Override
Expand Down
3 changes: 1 addition & 2 deletions ImageLibrary/src/main/res/layout/adapter_photopicker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,5 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_margin="5dip"
android:src="@mipmap/ic_choice_normal"/>
android:layout_margin="5dip"/>
</RelativeLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.facebook.drawee.backends.pipeline.Fresco;
import com.renyu.imagelibrary.commonutils.Utils;

public class MainActivity extends AppCompatActivity {
Expand All @@ -13,7 +14,8 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_main);

com.blankj.utilcode.util.Utils.init(this);
Fresco.initialize(this);

Utils.takePicture(this, 1000);
Utils.choicePic(this, 2, 100);
}
}

0 comments on commit a38ffbd

Please sign in to comment.