|
|
@@ -1,7 +1,6 @@
|
|
|
package kr.co.zumo.app.lifeplus.view.screen.my.coin;
|
|
|
|
|
|
import android.content.Context;
|
|
|
-import android.net.Uri;
|
|
|
import android.os.Bundle;
|
|
|
import android.support.annotation.NonNull;
|
|
|
import android.support.annotation.Nullable;
|
|
|
@@ -17,12 +16,12 @@ import java.util.List;
|
|
|
|
|
|
import kr.co.zumo.app.R;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.CategoryBannerBean;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.CoinBannerBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.coop.CoopGoodsBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.coop.CoopRecommendBean;
|
|
|
import kr.co.zumo.app.lifeplus.helper.ActionBarHelper;
|
|
|
import kr.co.zumo.app.lifeplus.util.StringUtil;
|
|
|
import kr.co.zumo.app.lifeplus.view.Event;
|
|
|
-import kr.co.zumo.app.lifeplus.view.IEventListener;
|
|
|
import kr.co.zumo.app.lifeplus.view.custom.category.banner.MainBannerView;
|
|
|
import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
|
|
|
|
|
|
@@ -41,7 +40,6 @@ public class MyCoinMainFragment extends FragmentBase<MyCoinMainPresenter> implem
|
|
|
private TextView textCoin;
|
|
|
private ImageView imageViewArrowMyCoinDetail;
|
|
|
private MainBannerView mainBannerViewCoin;
|
|
|
- private List<CategoryBannerBean> imageBeanList;
|
|
|
private LinearLayout layoutCoopGoodsContainer;
|
|
|
|
|
|
@Override
|
|
|
@@ -56,13 +54,6 @@ public class MyCoinMainFragment extends FragmentBase<MyCoinMainPresenter> implem
|
|
|
imageViewArrowMyCoinDetail = findViewById(R.id.image_view_arrow_my_colin_detail);
|
|
|
mainBannerViewCoin = findViewById(R.id.coin_banner_view);
|
|
|
layoutCoopGoodsContainer = findViewById(R.id.layout_coops_recommend);
|
|
|
- doBannerDataSetting();
|
|
|
- mainBannerViewCoin.init(getActivity(), imageBeanList, new IEventListener() {
|
|
|
- @Override
|
|
|
- public void onEvent(Event event) {
|
|
|
-
|
|
|
- }
|
|
|
- }, false);
|
|
|
|
|
|
textViewMyCoinDetail.setOnClickListener(view -> {presenter.onEvent(new Event.Builder(Event.MY_COIN_DETAIL).build());});
|
|
|
imageViewArrowMyCoinDetail.setOnClickListener(view -> {presenter.onEvent(new Event.Builder(Event.MY_COIN_DETAIL).build());});
|
|
|
@@ -98,16 +89,6 @@ public class MyCoinMainFragment extends FragmentBase<MyCoinMainPresenter> implem
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- public void doBannerDataSetting() {
|
|
|
- imageBeanList = new ArrayList<>();
|
|
|
- Uri uri = Uri.parse("android.resource://" + getActivity().getPackageName() + "/drawable/img_banner_mycoin");
|
|
|
- CategoryBannerBean bannerBean = new CategoryBannerBean();
|
|
|
- bannerBean.setImageUrl(uri.toString());
|
|
|
- bannerBean.setTitle("");
|
|
|
- imageBeanList.add(bannerBean);
|
|
|
- imageBeanList.add(bannerBean);
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public void draw(CoopRecommendBean coopRecommendBean) {
|
|
|
CoopGoodsBean goodsNow = coopRecommendBean.getGoodsNow();
|
|
|
@@ -130,6 +111,31 @@ public class MyCoinMainFragment extends FragmentBase<MyCoinMainPresenter> implem
|
|
|
textCoin.setText(coin);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void drawBanner(List<CoinBannerBean> list) {
|
|
|
+ if (null != list) {
|
|
|
+ int len = list.size();
|
|
|
+ if (len > 0) {
|
|
|
+ List<CategoryBannerBean> imageBeanList = new ArrayList<>();
|
|
|
+
|
|
|
+ for (int i = 0; i < len; ++i) {
|
|
|
+ CategoryBannerBean bannerBean = new CategoryBannerBean();
|
|
|
+ bannerBean.setImageUrl(list.get(i).getImageUrl());
|
|
|
+ bannerBean.setTitle("");
|
|
|
+ imageBeanList.add(bannerBean);
|
|
|
+ }
|
|
|
+
|
|
|
+ mainBannerViewCoin.init(getActivity(), imageBeanList, event -> {
|
|
|
+ presenter.onEvent(event);
|
|
|
+ }, false);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ mainBannerViewCoin.setVisibility(View.GONE);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
private void drawCoopGoodsList(CoopGoodsBean bean) {
|
|
|
LayoutInflater layoutInflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
|
@@ -138,7 +144,7 @@ public class MyCoinMainFragment extends FragmentBase<MyCoinMainPresenter> implem
|
|
|
|
|
|
CoopRecommendGoodsHolder holder = new CoopRecommendGoodsHolder(coopGoodsView);
|
|
|
holder.init(bean, event -> {
|
|
|
- presenter.onBannerClick(bean.getGoodsUrl());
|
|
|
+ presenter.onGoodsClick(bean.getGoodsUrl());
|
|
|
});
|
|
|
}
|
|
|
}
|