依赖
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta4'
compile 'com.squareup.okhttp3:okhttp:3.1.2'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.0-beta4'
compile 'io.reactivex:rxjava:1.1.0'
compile 'io.reactivex:rxandroid:1.1.0'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.okio:okio:1.13.0'
compile 'com.facebook.fresco:fresco:0.11.0'
compile 'it.sephiroth.android.library.picasso:picasso:2.5.2.4b'
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
compile 'org.easybatch:easybatch-gson:5.1.0'
compile 'com.youth.banner:banner:1.4.9'
compile 'com.github.bumptech.glide:glide:3.7.0' compile
'com.nostra13.universalimageloader:universal-image-loader:1.9.5' compile
'org.greenrobot:eventbus:3.1.1' compile
'com.dou361.ijkplayer:jjdxm-ijkplayer:1.0.5'
权限
android :name= "android.permission.INTERNET" />
android :name= "android.permission.READ_EXTERNAL_STORAGE" />
android :name= "android.permission.WRITE_EXTERNAL_STORAGE" />
android :name= "android.permission.ACCESS_NETWORK_STATE" />
主布局
xmlns: android = "http://schemas.android.com/apk/res/android"
xmlns: tools = "http://schemas.android.com/tools"
android :layout_width= "match_parent"
android :layout_height= "match_parent"
android :orientation= "vertical"
tools :context= "com.example.players.activity.MainActivity" >
layout= "@layout/simple_player_view_player"
android :layout_width= "match_parent"
android :layout_height= "380dp" />
android :id= "@+id/sdv"
android :layout_width= "500dp"
android :layout_height= "250dp" />
android :id= "@+id/tv1"
android :textSize= "18dp"
android :layout_width= "wrap_content"
android :layout_height= "wrap_content" />
android :id= "@+id/tv2"
android :textSize= "18dp"
android :layout_width= "wrap_content"
android :layout_height= "wrap_content" />
android :id= "@+id/tv3"
android :textSize= "18dp"
android :layout_marginTop= "20dp"
android :layout_width= "wrap_content"
android :layout_height= "wrap_content" />
android :orientation= "horizontal"
android :layout_width= "match_parent"
android :layout_height= "wrap_content" >
android :id= "@+id/jiarugouwuche"
android :text= " 加入购物车 "
android :layout_width= "250dp"
android :layout_height= "wrap_content" />
android :text= " 立即购买 "
android :layout_width= "250dp"
android :layout_height= "wrap_content" />
activity_gwc.xml
xmlns: android = "http://schemas.android.com/apk/res/android"
android :layout_width= "match_parent"
android :layout_height= "match_parent" >
android :id= "@+id/recycler_View"
android :layout_width= "match_parent"
android :layout_height= "wrap_content" />
android :layout_width= "match_parent"
android :layout_height= "60dp"
android :gravity= "center_vertical"
android :orientation= "horizontal"
android :padding= "10dp"
android :layout_alignParentBottom= "true" >
android :id= "@+id/quanxuan"
android :layout_width= "wrap_content"
android :layout_height= "wrap_content"
android :background= "@drawable/shopcart_unselected"
android :button= "@null" />
android :layout_width= "wrap_content"
android :layout_height= "wrap_content"
android :layout_marginLeft= "10dp"
android :text= " 全选 "
android :textSize= "23sp"
android :textStyle= "bold" />
android :layout_width= "0dp"
android :layout_height= "wrap_content"
android :layout_marginLeft= "10dp"
android :layout_weight= "1"
android :orientation= "vertical"
android :padding= "10dp" >
android :id= "@+id/total_price"
android :layout_width= "wrap_content"
android :layout_height= "wrap_content"
android :text= " 总价 : ¥0 元 "
android :textColor= "#e53e42"
android :textSize= "20sp" />
android :id= "@+id/total_num"
android :layout_width= "wrap_content"
android :layout_height= "wrap_content"
android :text= " 共 0 件商品 "
android :textSize= "20sp" />
android :layout_width= "wrap_content"
android :layout_height= "wrap_content"
android :background= "@drawable/qujiesuan"
android :gravity= "center"
android :text= " 去结算 "
android :textColor= "#fff"
android :textSize= "25sp" />
custom_jiajian.xml
xmlns: android = "http://schemas.android.com/apk/res/android"
android :layout_width= "match_parent"
android :orientation= "horizontal"
android :gravity= "center_vertical"
android :layout_height= "wrap_content" >
android :background= "#fff"
android :textSize= "20sp"
android :id= "@+id/reverse"
android :text= " 一 "
android :layout_width= "50dp"
android :layout_height= "wrap_content" />
android :textStyle= "bold"
android :textSize= "23sp"
android :layout_width= "wrap_content"
android :layout_height= "wrap_content"
android :text= "1"
android :id= "@+id/count"
/>
android :id= "@+id/add"
android :background= "#fff"
android :textSize= "25sp"
android :text= "+"
android :layout_width= "50dp"
android :layout_height= "wrap_content" />
item.xml
xmlns: android = "http://schemas.android.com/apk/res/android"
android :layout_width= "match_parent"
android :layout_height= "match_parent"
android :orientation= "vertical"
>
android :id= "@+id/sdv"
android :layout_width= "500dp"
android :layout_height= "300dp" />
android :id= "@+id/tv1"
android :textSize= "18dp"
android :layout_width= "wrap_content"
android :layout_height= "wrap_content" />
android :id= "@+id/tv2"
android :textSize= "18dp"
android :layout_width= "wrap_content"
android :layout_height= "wrap_content" />
android :id= "@+id/tv3"
android :textSize= "18dp"
android :layout_marginTop= "20dp"
android :layout_width= "wrap_content"
android :layout_height= "wrap_content" />
recy_cart_item.xml
xmlns: android = "http://schemas.android.com/apk/res/android"
android :layout_width= "match_parent"
android :orientation= "vertical"
android :padding= "15dp"
android :layout_height= "match_parent" >
android :orientation= "horizontal"
android :layout_width= "match_parent"
android :layout_height= "wrap_content" >
android :id= "@+id/shop_checkbox"
android :layout_width= "50dp"
android :layout_height= "50dp" />
android :layout_marginLeft= "20dp"
android :text= " 良品铺子 "
android :layout_width= "wrap_content"
android :layout_height= "wrap_content"
android :textSize= "23sp"
android :textStyle= "bold"
android :id= "@+id/shop_name"
/>
android :gravity= "center_vertical"
android :orientation= "horizontal"
android :layout_width= "match_parent"
android :layout_height= "wrap_content" >
android :id= "@+id/item_checkbox"
android :layout_width= "wrap_content"
android :layout_height= "wrap_content" />
android :id= "@+id/item_face"
android :src= "@mipmap/ic_launcher"
android :layout_width= "120dp"
android :layout_height= "120dp" />
android :layout_marginLeft= "10dp"
android :orientation= "vertical"
android :layout_width= "0dp"
android :layout_weight= "1"
android :layout_height= "wrap_content" >
android :id= "@+id/item_name"
android :textSize= "20sp"
android :text= " 三只松鼠 "
android :layout_width= "wrap_content"
android :layout_weight= "1"
android :layout_height= "0dp"
/>
android :textColor= "#f00"
android :id= "@+id/item_price"
android :textSize= "23sp"
android :text= "299"
android :layout_width= "wrap_content"
android :layout_height= "0dp"
android :layout_weight= "1"
/>
android :id= "@+id/custom_jiajian"
android :layout_width= "wrap_content"
android :layout_height= "0dp"
android :layout_weight= "1"
/>
android :id= "@+id/item_delete"
android :layout_marginRight= "10dp"
android :src= "@drawable/shopcart_delete"
android :layout_width= "30dp"
android :layout_height= "30dp" />
public interface IbeanVeiw {
void showModerl (MyBean myBean);
void showButtonjr (JiaRuGWC jiaRuGWC);
}
IbeanView_jr
public interface IbeanView_jr {
void showButtonjr (CartBean cartBean);
} HomeModerl
public class HomeModerl implements IHome {
@Override
public void showHome (final Movie movie) {
ApiService.API_SERVICE .getData()
.subscribeOn(Schedulers.io ())
.observeOn(AndroidSchedulers.mainThread ())
.subscribe(new Observer() {
@Override
public void onCompleted () {
}
@Override
public void onError (Throwable e) {
}
@Override
public void onNext (MyBean myBean) {
movie .complete(myBean);
}
});
}
@Override
public void showjr (final Movie_jr movie_jr) {
ApiService.API_SERVICE_jr .getDatajr()
.subscribeOn(Schedulers.io ())
.observeOn(AndroidSchedulers.mainThread ())
.subscribe(new Observer() {
@Override
public void onCompleted () {
}
@Override
public void onError (Throwable e) {
}
@Override
public void onNext (JiaRuGWC jiaRuGWC) {
movie_jr .complete(jiaRuGWC);
}
});
}
@Override
public void showjr2 (final Movie_jr2 movie_jr2) {
ApiService.API_SERVICE_jr2 .getDatajr2()
.subscribeOn(Schedulers.io ())
.observeOn(AndroidSchedulers.mainThread ())
.subscribe(new Observer() {
@Override
public void onCompleted () {
}
@Override
public void onError (Throwable e) {
}
@Override
public void onNext (CartBean cartBean) {
movie_jr2 .complete(cartBean);
}
});
}
} IHome
public interface IHome {
void showHome (Movie movie);
interface Movie {
void complete (MyBean myBean);
}
void showjr (Movie_jr movie_jr);
interface Movie_jr {
void complete (JiaRuGWC jiaRuGWC);
}
void showjr2 (Movie_jr2 movie_jr2);
interface Movie_jr2 {
void complete (CartBean cartBean);
}
}
PresenterView
public class PresenterView implements IPresenter {
IHome home ;
SoftReference softReference ;
public PresenterView (IbeanVeiw view) {
attch(view);
home = new HomeModerl();
}
public void showMoie () {
home .showHome(new IHome.Movie() {
@Override
public void complete (MyBean myBean) {
softReference .get().showModerl(myBean);
}
});
}
public void showjr () {
home .showjr(new IHome.Movie_jr() {
@Override
public void complete (JiaRuGWC jiaRuGWC) {
softReference .get().showButtonjr(jiaRuGWC);
}
});
}
@Override
public void attch (IbeanVeiw view) {
softReference = new SoftReference(view);
}
@Override
public void datach () {
softReference .clear();
}
}
PresenterView_jr
public class PresenterView_jr implements IPresenter {
IHome home ;
SoftReference softReference ;
public PresenterView_jr (IbeanView_jr veiw) {
attch(veiw);
home = new HomeModerl();
}
public void showjr2 () {
home .showjr2(new IHome.Movie_jr2() {
@Override
public void complete (CartBean cartBean) {
softReference .get().showButtonjr(cartBean);
}
});
}
@Override
public void attch (IbeanView_jr view) {
softReference = new SoftReference(view);
}
@Override
public void datach () {
softReference .clear();
}
} RecAdapter
public class RecAdapter extends RecyclerView.Adapter {
Context context ;
List list ;
public RecAdapter (Context context, List list) {
this .context =context;
this .list =list;
}
@Override
public MyHolder onCreateViewHolder (ViewGroup parent, int viewType) {
View view = View.inflate (context , R.layout.item , null );
MyHolder myHolder = new MyHolder(view);
return myHolder;
}
@Override
public void onBindViewHolder (MyHolder holder, int position) {
holder.imageView .setImageURI(Uri.parse (list .get(position).getImages()));
holder.textView1 .setText(list .get(position).getTitle());
holder.textView2 .setText(list .get(position).getSubhead());
holder.textView3 .setText(list .get(position).getPrice() + "" );
}
@Override
public int getItemCount () {
return list == null ? 0 : list .size();
}
public class MyHolder extends RecyclerView.ViewHolder {
private final ImageView imageView ;
private final TextView textView1 ;
private final TextView textView2 ;
private final TextView textView3 ;
public MyHolder (View itemView) {
super (itemView);
imageView = (ImageView) itemView.findViewById(R.id.sdv );
textView1 = (TextView) itemView.findViewById(R.id.tv1 );
textView2 = (TextView) itemView.findViewById(R.id.tv2 );
textView3 = (TextView) itemView.findViewById(R.id.tv3 );
}
}
} RecyAdapter
public class RecyAdapter extends RecyclerView.Adapter {
Context context ;
// 创建大的集合
private List list ;
// 存放商家的 id 和商家的名称的 map 集合
private Map,String> map = new HashMap<>();
public RecyAdapter (Context context) {
this .context = context;
}
/**
* 添加数据并更新显示
* */
public void add (CartBean cartBean){
// 传进来的是 bean 对象
if (list == null ){
list = new ArrayList<>();
}
// 第一层遍历商家和商品
for (CartBean.DataBean shop : cartBean.getData()){
// 把商品的 id 和商品的名称添加到 map 集合里 ,, 为了之后方便调用
map .put(shop.getSellerid(), shop.getSellerName());
// 第二层遍历里面的商品
for (int i=0 ; i;i++){
// 添加到 list 集合里
list .add(shop.getList().get(i));
}
}
// 调用方法 设置显示或隐藏 商铺名
setFirst(list );
notifyDataSetChanged();
}
/**
* 设置数据源 , 控制是否显示商家
* */
private void setFirst (List list) {
if (list.size()>0 ){
// 如果是第一条数据就设置 isFirst 为 1
list.get(0 ).setIsFirst(1 );
// 从第二条开始遍历
for (int i=1 ; i;i++){
// 如果和前一个商品是同一家商店的
if (list.get(i).getSellerid() == list.get(i-1 ).getSellerid()){
// 设置成 2 不显示商铺
list.get(i).setIsFirst(2 );
}else {// 设置成 1 显示商铺
list.get(i).setIsFirst(1 );
// 如果当前条目选中 , 把当前的商铺也选中
if (list.get(i).isItem_check()==true ){
list.get(i).setShop_check(list.get(i).isItem_check());
}
}
}
}
}
@Override
public MyViewHolder onCreateViewHolder (ViewGroup parent, int viewType) {
View view = View.inflate (context , R.layout.recy_cart_item ,null );
MyViewHolder myViewHolder = new MyViewHolder(view);
return myViewHolder;
}
@Override
public void onBindViewHolder (final MyViewHolder holder, final int position) {
/**
* 设置商铺的 shop_checkbox 和商铺的名字 显示或隐藏
* */
if (list .get(position).getIsFirst()==1 ){
// 显示商家
holder.shop_checkbox .setVisibility(View.VISIBLE );
holder.shop_name .setVisibility(View.VISIBLE );
// 设置 shop_checkbox 的选中状态
holder.shop_checkbox .setChecked(list .get(position).isShop_check());
holder.shop_name .setText(map .get(String.valueOf (list .get(position).getSellerid())));
}else {//2
// 隐藏商家
holder.shop_name .setVisibility(View.GONE );
holder.shop_checkbox .setVisibility(View.GONE );
}
// 拆分 images 字段
String[] split = list .get(position).getImages().split(" \\ |" );
// 设置商品的图片
ImageLoader.getInstance ().displayImage(split[0 ], holder.item_face );
// 控制商品的 item_checkbox,, 根据字段改变
holder.item_checkbox .setChecked(list .get(position).isItem_check());
holder.item_name .setText(list .get(position).getTitle());
holder.item_price .setText(list .get(position).getPrice()+"" );
// 调用 customjiajian 里面的方法设置 加减号中间的数字
holder.customJiaJian .setEditText(list .get(position).getNum());
// 商铺的 shop_checkbox 点击事件 , 控制商品的 item_checkbox
holder.shop_checkbox .setOnClickListener(new View.OnClickListener() {
@Override
public void onClick (View v) {
// 先改变数据源中的 shop_check
list .get(position ).setShop_check(holder .shop_checkbox .isChecked());
for (int i=0 ; i<list .size(); i++){
// 如果是同一家商铺的 都给成相同状态
if (list .get(position ).getSellerid()==list .get(i).getSellerid()){
// 当前条目的选中状态 设置成 当前商铺的选中状态
list .get(i).setItem_check(holder .shop_checkbox .isChecked());
}
}
// 刷新适配器
notifyDataSetChanged();
// 调用求和的方法
sum(list );
}
});
// 商品的 item_checkbox 点击事件 , 控制商铺的 shop_checkbox
holder.item_checkbox .setOnClickListener(new View.OnClickListener() {
@Override
public void onClick (View v) {
// 先改变数据源中的 item_checkbox
list .get(position ).setItem_check(holder .item_checkbox .isChecked());
// 反向控制商铺的 shop_checkbox
for (int i=0 ; i<list .size(); i++){
for (int j=0 ; j<list .size(); j++){
// 如果两个商品是同一家店铺的 并且 这两个商品的 item_checkbox 选中状态不一样
if (list .get(i).getSellerid()==list .get(j).getSellerid() && !list .get(j).isItem_check()){
// 就把商铺的 shop_checkbox 改成 false
list .get(i).setShop_check(false );
break;
}else {
// 同一家商铺的商品 选中状态都一样 , 就把商铺 shop_checkbox 状态改成 true
list .get(i).setShop_check(true );
}
}
}
// 更新适配器
notifyDataSetChanged();
// 调用求和的方法
sum(list );
}
});
// 删除条目的点击事件
holder.item_delete .setOnClickListener(new View.OnClickListener() {
@Override
public void onClick (View v) {
list .remove(position ); // 移除集合中的当前数据
// 删除完当前的条目 重新判断商铺的显示隐藏
setFirst(list );
// 调用重新求和
sum(list );
notifyDataSetChanged();
}
});
// 加减号的监听 ,
holder.customJiaJian .setCustomListener(new CustomJiaJian.CustomListener() {
@Override
public void jiajian (int count) {
// 改变数据源中的数量
list .get(position ).setNum(count);
notifyDataSetChanged();
sum(list );
}
@Override
// 输入值 求总价
public void shuRuZhi (int count) {
list .get(position ).setNum(count);
notifyDataSetChanged();
sum(list );
}
});
}
/**
* 计算总价的方法
* */
private void sum (List list){
int totalNum = 0 ; // 初始的总价为 0
float totalMoney = 0.0f ;
boolean allCheck = true;
for (int i=0 ; i;i++){
// 把 已经选中的 条目 计算价格
if (list.get(i).isItem_check()){
totalNum += list.get(i).getNum();
totalMoney += list.get(i).getNum() * list.get(i).getPrice();
}else {
// 如果有个未选中 , 就标记为 false
allCheck = false;
}
}
// 接口回调出去 把总价 总数量 和 allcheck 传给 view 层
updateListener .setTotal(totalMoney+"" , totalNum+"" , allCheck);
}
//view 层调用这个方法 , 点击 quanxuan 按钮的操作
public void quanXuan (boolean checked) {
for (int i=0 ; i<list .size(); i++){
list .get(i).setShop_check(checked);
list .get(i).setItem_check(checked);
}
notifyDataSetChanged();
sum(list );
}
@Override
public int getItemCount () {
return list ==null ?0 :list .size();
}
public static class MyViewHolder extends RecyclerView.ViewHolder {
private final CheckBox shop_checkbox ;
private final TextView shop_name ;
private final CheckBox item_checkbox ;
private final TextView item_name ;
private final TextView item_price ;
private final CustomJiaJian customJiaJian ;
private final ImageView item_delete ;
private final ImageView item_face ;
public MyViewHolder (View itemView) {
super (itemView);
shop_checkbox = (CheckBox) itemView.findViewById(R.id.shop_checkbox );
shop_name = (TextView) itemView.findViewById(R.id.shop_name );
item_checkbox = (CheckBox) itemView.findViewById(R.id.item_checkbox );
item_name = (TextView) itemView.findViewById(R.id.item_name );
item_price = (TextView) itemView.findViewById(R.id.item_price );
customJiaJian = (CustomJiaJian) itemView.findViewById(R.id.custom_jiajian );
item_delete = (ImageView) itemView.findViewById(R.id.item_delete );
item_face = (ImageView) itemView.findViewById(R.id.item_face );
}
}
UpdateListener updateListener ;
public void setUpdateListener (UpdateListener updateListener){
this .updateListener = updateListener;
}
// 接口
public interface UpdateListener{
public void setTotal (String total, String num, boolean allCheck);
}
} 主布局
public class MainActivity extends BaseActivity implements IbeanVeiw {
private PresenterView presenterView ;
PresenterView presenter ;
@Override
protected void onCreate (Bundle savedInstanceState) {
super .onCreate(savedInstanceState);
setContentView(R.layout.activity_main );
ButterKnife.bind (this );
presenterView = new PresenterView(this );
shipin();
presenterView .showMoie();
}
private void shipin () {
String url = "http://ips.ifeng.com/video19.ifeng.com/video09/2014/06/16/1989823-102-086-0009.mp4" ;
// String url = Environment.getExternalStorageDirectory()
// .getAbsolutePath() + "/local/adc.mp4";
play = new PlayerView(this )
.setTitle(" 什么 " )
.setScaleType(PlayStateParams.fitparent )
.hideMenu(true )
.forbidTouch(false )
.setPlaySource(url);
play .startPlay();
}
@Override
public void showModerl (MyBean myBean) {
String images = myBean.getData().getImages();
String subhead = myBean.getData().getSubhead();
String title = myBean.getData().getTitle();
String price = myBean.getData().getPrice() + "" ;
DraweeController controller = Fresco.newDraweeControllerBuilder ()
.setUri(images)
.setAutoPlayAnimations(true )
.build();
sdv .setController(controller);
tv1 .setText(title);
tv2 .setText(subhead);
tv3 .setText(price);
jiarugouwuche .setOnClickListener(new View.OnClickListener() {
@Override
public void onClick (View view) {
presenterView .showjr();
}
});
}
@Override
public void showButtonjr (JiaRuGWC jiaRuGWC) {
String code = jiaRuGWC.getCode();
if (code.equals("0" )){
Toast.makeText (this, jiaRuGWC.getMsg(), Toast.LENGTH_SHORT ).show();
}else {
Toast.makeText (this, jiaRuGWC.getMsg(), Toast.LENGTH_SHORT ).show();
}
startActivity(new Intent(this, GwcActivity.class ));
}
@Override
protected void createpresenter () {
presenter = new PresenterView(this );
}
@Override
protected void onStop () {
super .onStop();
play .stopPlay();
}
} GwcActivity
public class GwcActivity extends BaseActivity implements IbeanView_jr {
PresenterView_jr presenterView_jr ;
@BindView (R.id.recycler_View )
RecyclerView recyclerView ;
@BindView (R.id.quanxuan )
CheckBox quanxuan ;
@BindView (R.id.total_price )
TextView totalPrice ;
@BindView (R.id.total_num )
TextView totalNum ;
private TextView total_price ;
private TextView total_num ;
private RecyAdapter recyAdapter ;
@Override
protected void onCreate (Bundle savedInstanceState) {
super .onCreate(savedInstanceState);
setContentView(R.layout.activity_gwc );
ButterKnife.bind (this );
recyclerView = (RecyclerView) findViewById(R.id.recycler_View );
total_price = (TextView) findViewById(R.id.total_price );
total_num = (TextView) findViewById(R.id.total_num );
quanxuan = (CheckBox) findViewById(R.id.quanxuan );
quanxuan .setTag(1 ); //1 为不选中
//new 出适配器
recyAdapter = new RecyAdapter(this );
presenterView_jr =new PresenterView_jr(this );
presenterView_jr .showjr2();
recyclerView .setLayoutManager(new LinearLayoutManager(this ));
recyclerView .setAdapter(recyAdapter );
// 调用 recyAdapter 里面的接口 , 设置 全选按钮 总价 总数量
recyAdapter .setUpdateListener(new RecyAdapter.UpdateListener() {
@Override
public void setTotal (String total, String num, boolean allCheck) {
// 设置 ui 的改变
total_num .setText(" 共 " +num+" 件商品 " ); // 总数量
total_price .setText(" 总价 :¥" +total+" 元 " ); // 总价
if (allCheck){
quanxuan .setTag(2 );
quanxuan .setBackgroundResource(R.drawable.shopcart_selected );
}else {
quanxuan .setTag(1 );
quanxuan .setBackgroundResource(R.drawable.shopcart_unselected );
}
quanxuan .setChecked(allCheck);
}
});
// 这里只做 ui 更改 , 点击全选按钮 ,, 调到 adapter 里面操作
quanxuan .setOnClickListener(new View.OnClickListener() {
@Override
public void onClick (View v) {
// 调用 adapter 里面的方法 ,, 把当前 quanxuan 状态传递过去
int tag = (int ) quanxuan .getTag();
if (tag==1 ){
quanxuan .setTag(2 );
quanxuan .setBackgroundResource(R.drawable.shopcart_selected );
}else {
quanxuan .setTag(1 );
quanxuan .setBackgroundResource(R.drawable.shopcart_unselected );
}
recyAdapter .quanXuan(quanxuan .isChecked());
}
});
}
@Override
public void showButtonjr (CartBean cartBean) {
// 拿到返回来的数据 ,, 传给适配器数据
recyAdapter .add(cartBean);
}
@Override
protected void createpresenter () {
presenterView_jr = new PresenterView_jr(this );
}
}