| | |
| | | import android.content.SharedPreferences; |
| | | import android.content.pm.PackageInfo; |
| | | import android.content.pm.PackageManager; |
| | | import android.graphics.Canvas; |
| | | import android.graphics.Rect; |
| | | import android.graphics.drawable.AnimationDrawable; |
| | | import android.graphics.drawable.GradientDrawable; |
| | | import android.os.Bundle; |
| | | import android.os.Handler; |
| | | import android.os.Message; |
| | | import android.provider.Settings; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | import androidx.viewpager.widget.PagerAdapter; |
| | | import androidx.viewpager.widget.ViewPager; |
| | | import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; |
| | | import androidx.recyclerview.widget.GridLayoutManager; |
| | | import androidx.recyclerview.widget.LinearLayoutManager; |
| | | import androidx.recyclerview.widget.RecyclerView; |
| | | |
| | | import android.util.Log; |
| | | import android.view.Gravity; |
| | | import android.view.LayoutInflater; |
| | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.lzj.gallery.library.views.BannerViewPager; |
| | | import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator; |
| | | import com.viewpagerindicator.LinePageIndicator; |
| | | import com.wpc.library.RetainViewFragment; |
| | | import com.wpc.library.content.ConnectivityChangeHelper; |
| | | import com.wpc.library.util.NetUtils; |
| | | import com.wpc.library.util.SystemCommon; |
| | | import com.wpc.library.util.cache.DiskLruCache; |
| | | import com.wpc.library.util.common.DimenUtils; |
| | | import com.wpc.library.util.common.StorageUtils; |
| | | import com.wpc.library.util.common.StringUtils; |
| | | import com.wpc.library.widget.MyGridView; |
| | | import com.wpc.library.widget.RatioLayout; |
| | | import com.tejia.lijin.app.BasicTextHttpResponseHandler; |
| | | import com.tejia.lijin.app.R; |
| | | import com.tejia.lijin.app.ShoppingApi; |
| | | import com.tejia.lijin.app.ShoppingApplication; |
| | | import com.tejia.lijin.app.entity.FirstCategory; |
| | | import com.tejia.lijin.app.entity.HomeBanner; |
| | | import com.tejia.lijin.app.entity.JumpDetail; |
| | |
| | | import com.tejia.lijin.app.ui.timeLimitedSpike.TimeLimitedSpikeActivity; |
| | | import com.tejia.lijin.app.util.FlowLayout; |
| | | import com.tejia.lijin.app.util.JumpActivityUtil; |
| | | import com.tejia.lijin.app.util.ui.HomeUIUtil; |
| | | import com.tejia.lijin.app.util.umengCustomEvent.MainCustomEvent; |
| | | import com.tejia.lijin.app.util.user.UserUtil; |
| | | import com.wpc.library.RetainViewFragment; |
| | | import com.wpc.library.content.ConnectivityChangeHelper; |
| | | import com.wpc.library.util.NetUtils; |
| | | import com.wpc.library.util.ScreenUtils; |
| | | import com.wpc.library.util.SystemCommon; |
| | | import com.wpc.library.util.cache.DiskLruCache; |
| | | import com.wpc.library.util.common.DimenUtils; |
| | | import com.wpc.library.util.common.StorageUtils; |
| | | import com.wpc.library.util.common.StringUtils; |
| | | import com.wpc.library.widget.MyGridView; |
| | | import com.wpc.library.widget.RatioLayout; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.json.JSONException; |
| | |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | import androidx.recyclerview.widget.GridLayoutManager; |
| | | import androidx.recyclerview.widget.LinearLayoutManager; |
| | | import androidx.recyclerview.widget.RecyclerView; |
| | | import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; |
| | | import androidx.viewpager.widget.PagerAdapter; |
| | | import androidx.viewpager.widget.ViewPager; |
| | | |
| | | import static android.content.Context.MODE_PRIVATE; |
| | | |
| | | /** |
| | |
| | | */ |
| | | |
| | | public class RecommendFragment extends RetainViewFragment implements View.OnClickListener { |
| | | // private RecyclerView rv_first_page, rv_special_offer; |
| | | private static final String TAG = "RecommendFragment"; |
| | | private LinearLayout ll_fragment_activity, ll_special_offer, ll_limit_time_buy, ll_jinbi_exchange_buy; |
| | | private MyGridView gv_limit_time_goods, gv_jinbi_exchange_goods; |
| | | private SwipeRefreshLayout rl_first_page; |
| | | private ImageView iv_activity_bg, iv_slid_top, iv_input; |
| | | // private MyScrollView sv_content; |
| | | private FrameLayout fl_fragment_activity; |
| | | private RatioLayout rl_recommend_activity2; |
| | | // private TextView tv_recommend_goods_hint; |
| | | private RecyclerView rv_recommend_goods, rv_special_offer; |
| | | private View v_divider; |
| | | private FlowLayout flow_hot; |
| | | private RatioLayout rl_top_banner; |
| | | ScrollView sv_hot; |
| | | private View bottom; |
| | | private ImageView iv_loading, iv_hot_img; |
| | | private TextView tv_loading; |
| | | |
| | | ViewPager vp_banner, vp_recommend_activity2; |
| | | private LinePageIndicator indicator_recommend; |
| | | com.lzj.gallery.library.views.BannerViewPager vp_banner; |
| | | ViewPager vp_recommend_activity2; |
| | | private LinearLayout ll_no_net, ll_no_data, ll_request_failture; |
| | | |
| | | private List<HomeBanner> mBanners = new ArrayList<>(); |
| | |
| | | private List<String> lList = new ArrayList<>(); |
| | | private List<String> lList2 = new ArrayList<>(); |
| | | |
| | | private RecommendTopAdapter bannerAdapter;//banner Adapter |
| | | private RecommendActivityAdapter activityAdapter; |
| | | private HotCategoryAdapter specialAdapter2; |
| | | private RecommendCircleSpecialAdapter specialAdapter2; |
| | | private RecommendGoodsAdapter goodsAdapter;//精选商品 Adapter |
| | | private LimitTimeBuyAdapter limitTimeBuyAdapter, jinbiExchangeAdapter; |
| | | private DiskLruCache cache; |
| | |
| | | |
| | | int visibilyNum = -1; |
| | | |
| | | |
| | | RecyclerView.ItemDecoration circleSpecialItemDecoration = new RecyclerView.ItemDecoration() { |
| | | @Override |
| | | public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) { |
| | | super.onDraw(c, parent, state); |
| | | } |
| | | |
| | | @Override |
| | | public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) { |
| | | super.onDrawOver(c, parent, state); |
| | | } |
| | | |
| | | @Override |
| | | public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { |
| | | super.getItemOffsets(outRect, view, parent, state); |
| | | int index = parent.getChildAdapterPosition(view); |
| | | int total = parent.getAdapter().getItemCount(); |
| | | int space = RecommendCircleSpecialAdapter.SPCAE_DP; |
| | | |
| | | if (index % 2 == 0) { |
| | | outRect.bottom = DimenUtils.dipToPixels(space, view.getContext()); |
| | | Log.i(TAG, circleSpecials.get(index).getName()); |
| | | } else |
| | | outRect.bottom = 0; |
| | | |
| | | |
| | | if ((index == total - 1) || (index == total - 2 && total % 2 == 0)) { |
| | | outRect.right = 0; |
| | | } else { |
| | | outRect.right = DimenUtils.dipToPixels(space, view.getContext()); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | private void init(View contentView) { |
| | | rv_recommend_goods = contentView.findViewById(R.id.rv_recommend_goods); |
| | | rl_first_page = contentView.findViewById(R.id.rl_first_page); |
| | | iv_slid_top = contentView.findViewById(R.id.iv_slid_top); |
| | | final View top = LayoutInflater.from(rv_recommend_goods.getContext()) |
| | | .inflate(R.layout.item_recommend_top, null); |
| | | rl_top_banner = top.findViewById(R.id.rl_top_banner); |
| | | top.setBackground(HomeUIUtil.getHomeTopBg("#FF227B", "#FF2A3E")); |
| | | ll_fragment_activity = top.findViewById(R.id.ll_fragment_activity); |
| | | ll_special_offer = top.findViewById(R.id.ll_special_offer); |
| | | ll_limit_time_buy = top.findViewById(R.id.ll_limit_time_buy); |
| | |
| | | fl_fragment_activity = top.findViewById(R.id.fl_fragment_activity); |
| | | rl_recommend_activity2 = top.findViewById(R.id.rl_recommend_activity2); |
| | | iv_activity_bg = top.findViewById(R.id.iv_activity_bg); |
| | | vp_banner = top.findViewById(R.id.vp_recommend); |
| | | indicator_recommend = top.findViewById(R.id.indicator_recommend); |
| | | vp_banner = top.findViewById(R.id.vp_banner); |
| | | rv_special_offer = top.findViewById(R.id.rv_special_offer); |
| | | flow_hot = top.findViewById(R.id.flow_hot); |
| | | iv_input = top.findViewById(R.id.iv_input); |
| | | vp_recommend_activity2 = top.findViewById(R.id.vp_recommend_activity2); |
| | | // tv_recommend_goods_hint = top.findViewById(R.id.tv_recommend_goods_hint); |
| | | v_divider = top.findViewById(R.id.v_divider); |
| | | tv_hour_1 = top.findViewById(R.id.tv_hour_1); |
| | | tv_hour_2 = top.findViewById(R.id.tv_hour_2); |
| | |
| | | if (last == total - 1 && mList.size() < count && isLoad) { |
| | | page++; |
| | | isLoad = false; |
| | | tv_loading.setText("正在加载更多数据"); |
| | | tv_loading.setText(getResources().getString(R.string.loading_more_text)); |
| | | iv_loading.setVisibility(View.VISIBLE); |
| | | guessLikeByDevice(); |
| | | } |
| | |
| | | |
| | | //设置列表可以水平滑动,两行 |
| | | GridLayoutManager layoutManager = new GridLayoutManager(getContext(), 2, GridLayoutManager.HORIZONTAL, false); |
| | | // mRecyclerView = new CustomeRecyclerView(this); |
| | | rv_special_offer.setLayoutManager(layoutManager); |
| | | specialAdapter2 = new HotCategoryAdapter(getActivity(), circleSpecials); |
| | | specialAdapter2 = new RecommendCircleSpecialAdapter(getActivity(), circleSpecials); |
| | | rv_special_offer.setAdapter(specialAdapter2); |
| | | |
| | | seekBar = top.findViewById(R.id.slide_indicator_point); |
| | | seekBar.setPadding(0, 0, 0, 0); |
| | | seekBar.setThumbOffset(0); |
| | | seekBar.setVisibility(View.GONE); |
| | | // seekBar.setVisibility(View.GONE); |
| | | |
| | | rv_special_offer.addItemDecoration(circleSpecialItemDecoration); |
| | | |
| | | rv_special_offer.addOnScrollListener(new RecyclerView.OnScrollListener() { |
| | | @Override |
| | |
| | | } |
| | | }); |
| | | |
| | | vp_banner.setCurrentItem(0, true); |
| | | vp_recommend_activity2.setCurrentItem(0, true); |
| | | bannerAdapter = new RecommendTopAdapter(mBanners, getActivity(), false); |
| | | vp_banner.setAdapter(bannerAdapter); |
| | | activityAdapter = new RecommendActivityAdapter(mBanners2, getActivity()); |
| | | vp_recommend_activity2.setAdapter(activityAdapter); |
| | | rv_recommend_goods.setLayoutManager(new LinearLayoutManager(getContext())); |
| | | goodsAdapter = new RecommendGoodsAdapter(this, mList, "jingxuan"); |
| | | goodsAdapter = new RecommendGoodsAdapter(getContext(), mList, "jingxuan"); |
| | | rv_recommend_goods.setAdapter(goodsAdapter); |
| | | goodsAdapter.addFooterView(bottom); |
| | | goodsAdapter.addHeaderView(top); |
| | | initTimeHandle(); |
| | | setBannerData(); |
| | | } |
| | | |
| | | |
| | | private void setBannerData() { |
| | | |
| | | List<String> urlList = new ArrayList<>(); |
| | | for (HomeBanner ad : mBanners) |
| | | urlList.add(ad.getSrc()); |
| | | if (urlList.size() > 0) { |
| | | if (!vp_banner.hasAdapter()) { |
| | | vp_banner.initBanner(urlList, false, 0.4375f)//开启3D画廊效果 |
| | | .addPageMargin(10, 10)//参数1page之间的间距,参数2中间item距离边界的间距 |
| | | .addStartTimer(3)//自动轮播3秒间隔 |
| | | .addPointBottom(0)//底部间距 |
| | | .addPoint(5, R.drawable.shape_banner_indicator_highlight, R.drawable.shape_banner_indicator) |
| | | .addDefaultImg(R.drawable.shape_banner_default) |
| | | .addRoundCorners(DimenUtils.dip2px(getContext(), 10))//圆角 |
| | | .finishConfig()//这句必须加 |
| | | .addBannerListener(new BannerViewPager.OnClickBannerListener() { |
| | | @Override |
| | | public void onBannerClick(int position) { |
| | | if (position >= mBanners.size()) |
| | | return; |
| | | JumpActivityUtil.jumpPage(getActivity(), mBanners.get(position).getJumpDetail(), mBanners.get(position).getParams()); |
| | | } |
| | | }); |
| | | } else { |
| | | vp_banner.notifyDataSetChanged(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | private void addHot(final RecommendHot recommendHot) { |
| | | if (recommendHot == null) { |
| | |
| | | if (mBanners.size() > 0) { |
| | | mBanners.clear(); |
| | | } |
| | | float width = SystemCommon.getScreenWidth(getContext()); |
| | | indicator_recommend.setLineWidth((width - (DimenUtils.dip2px(getContext(), 30))) / list1.size()); |
| | | indicator_recommend.setGapWidth(0); |
| | | indicator_recommend.setSelectedColor(getResources().getColor(R.color.white)); |
| | | indicator_recommend.setUnselectedColor(getResources().getColor(R.color.transport_white3)); |
| | | indicator_recommend.setStrokeWidth(DimenUtils.dip2px(getContext(), 2)); |
| | | |
| | | if (list1 == null || list1.size() == 0) { |
| | | rl_top_banner.setVisibility(View.GONE); |
| | | } else { |
| | | rl_top_banner.setVisibility(View.VISIBLE); |
| | | } |
| | | |
| | | mBanners.clear(); |
| | | mBanners.addAll(list1); |
| | | bannerAdapter.notifyDataSetChanged(); |
| | | setBannerData(); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | gradientDrawable.setSize(DimenUtils.dip2px(getContext(), 50) * 5 / (circleSpecials.size() / 2) |
| | | , DimenUtils.dip2px(getContext(), 4)); |
| | | } |
| | | // seekBar.setVisibility(mSpecial2s.size() <= 10 ? View.GONE : View.VISIBLE); |
| | | seekBar.setVisibility(circleSpecials.size() <= 8 ? View.GONE : View.VISIBLE); |
| | | |
| | | if (list2 == null || list2.size() == 0) { |
| | | rv_special_offer.setVisibility(View.GONE); |
| | |
| | | } else { |
| | | fl_fragment_activity.setVisibility(View.VISIBLE); |
| | | } |
| | | showActivity1(list3, url); |
| | | showBigActivity(list3, url); |
| | | } |
| | | |
| | | } |
| | |
| | | public void onResume() { |
| | | super.onResume(); |
| | | mChangeHelper.registerReceiver(); |
| | | indicator_recommend.setViewPager(vp_banner); |
| | | vp_banner.postDelayed(mAutoScroller, 2000); |
| | | vp_recommend_activity2.postDelayed(mAutoScroller2, 2000); |
| | | sv_hot.postDelayed(mAutoScroller3, 2000); |
| | | |
| | | scanSpecial(System.currentTimeMillis()); |
| | | } |
| | | |
| | | private void scanSpecial(Long curTime) { |
| | | long stayTime1 = curTime - bannerAdapter.clickTime; |
| | | long stayTime2 = curTime - specialAdapter2.clickTime; |
| | | long stayTime3 = curTime - activityAdapter.clickTime; |
| | | long stayTime4 = curTime - clickTime4; |
| | | if (bannerAdapter.clickTime > 0 && stayTime1 > 15 * 1000) { |
| | | PushEventData info = new PushEventData(); |
| | | info.setId(bannerAdapter.clickId); |
| | | Gson gson = new GsonBuilder().serializeNulls().create(); |
| | | String data = gson.toJson(info); |
| | | bannerAdapter.clickTime = 0; |
| | | bannerAdapter.clickId = ""; |
| | | } |
| | | |
| | | if (specialAdapter2.clickTime > 0 && stayTime2 > 15 * 1000) { |
| | | PushEventData info = new PushEventData(); |
| | | info.setId(specialAdapter2.clickId); |
| | |
| | | clickId4 = ""; |
| | | } |
| | | } |
| | | |
| | | private Runnable mAutoScroller = new Runnable() { |
| | | |
| | | @Override |
| | | public void run() { |
| | | PagerAdapter adapter = vp_banner.getAdapter(); |
| | | if (adapter != null && adapter.getCount() != 0) { |
| | | vp_banner.setCurrentItem((vp_banner.getCurrentItem() + 1) |
| | | % adapter.getCount(), true); |
| | | } |
| | | vp_banner.postDelayed(this, 5000); |
| | | } |
| | | }; |
| | | |
| | | private Runnable mAutoScroller2 = new Runnable() { |
| | | |
| | |
| | | public void onPause() { |
| | | super.onPause(); |
| | | mChangeHelper.unregisterReceiver(); |
| | | vp_banner.removeCallbacks(mAutoScroller); |
| | | vp_recommend_activity2.removeCallbacks(mAutoScroller2); |
| | | sv_hot.removeCallbacks(mAutoScroller3); |
| | | } |
| | |
| | | && mList.size() == 0) { |
| | | pd.show(); |
| | | } |
| | | String uid = getContext().getSharedPreferences("user", MODE_PRIVATE).getString("uid", ""); |
| | | ShoppingApi.getRecommendIndex(vp_banner.getContext(), uid, new BasicTextHttpResponseHandler() { |
| | | ShoppingApi.getRecommendIndex(vp_banner.getContext(), UserUtil.getUid(ShoppingApplication.application), new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onFinish() { |
| | | super.onFinish(); |
| | |
| | | if (mBanners.size() > 0) { |
| | | mBanners.clear(); |
| | | } |
| | | float width = SystemCommon.getScreenWidth(getContext()); |
| | | indicator_recommend.setLineWidth((width - (DimenUtils.dip2px(getContext(), 30))) / list1.size()); |
| | | indicator_recommend.setGapWidth(0); |
| | | indicator_recommend.setSelectedColor(getResources().getColor(R.color.white)); |
| | | indicator_recommend.setUnselectedColor(getResources().getColor(R.color.transport_white3)); |
| | | indicator_recommend.setStrokeWidth(DimenUtils.dip2px(getContext(), 2)); |
| | | |
| | | mBanners.addAll(list1); |
| | | bannerAdapter.notifyDataSetChanged(); |
| | | if (list1 == null || list1.size() == 0) { |
| | | rl_top_banner.setVisibility(View.GONE); |
| | | } else { |
| | | rl_top_banner.setVisibility(View.VISIBLE); |
| | | } |
| | | setBannerData(); |
| | | |
| | | DiskLruCache.Editor editor0 = cache |
| | | .edit(getKey("BannerAd")); |
| | |
| | | } |
| | | circleSpecials.addAll(list2); |
| | | specialAdapter2.notifyDataSetChanged(); |
| | | // seekBar.setVisibility(mSpecial2s.size() <= 10 ? View.GONE : View.VISIBLE); |
| | | seekBar.setVisibility(circleSpecials.size() <= 8 ? View.GONE : View.VISIBLE); |
| | | if (circleSpecials.size() > 10) { |
| | | GradientDrawable gradientDrawable = (GradientDrawable) seekBar.getThumb(); |
| | | //根据列表的个数,动态设置游标的大小,设置游标的时候,progress进度的颜色设置为和seekbar的颜色设置的一样的,所以就不显示进度了。 |
| | |
| | | String url = jsonObject.optJSONObject("data") |
| | | .optJSONObject("activityArea").optString("bottomPicture"); |
| | | |
| | | showActivity1(list3, url); |
| | | showBigActivity(list3, url); |
| | | if (list3 == null || list3.size() == 0) { |
| | | fl_fragment_activity.setVisibility(View.GONE); |
| | | } else { |
| | |
| | | .optJSONArray("list").toString(), |
| | | new TypeToken<List<SpecialOffer2>>() { |
| | | }.getType()); |
| | | list5.clear(); |
| | | showActivity2(list5); |
| | | |
| | | if (list5 == null || list5.size() == 0) { |
| | |
| | | // goodsAdapter.notifyItemRangeChanged(goodsAdapter.getItemCount(), list.size());//倒序批量刷新列表 |
| | | count = jsonObject.optJSONObject("data").optInt("count"); |
| | | // tv_recommend_goods_hint.setVisibility(mList.size() > 0 ? View.VISIBLE : View.GONE); |
| | | v_divider.setVisibility(mList.size() > 0 ? View.VISIBLE : View.GONE); |
| | | |
| | | if (mList.size() == count) { |
| | | bottom.setVisibility(View.VISIBLE); |
| | |
| | | }); |
| | | } |
| | | |
| | | /* |
| | | 活动专题3 |
| | | |
| | | /** |
| | | * 大活动专题 |
| | | * |
| | | * @param mList |
| | | * @param bottomPic |
| | | */ |
| | | private void showActivity1(final List<SpecialOffer2> mList, String bottomPic) { |
| | | private void showBigActivity(final List<SpecialOffer2> mList, String bottomPic) { |
| | | if (mList.size() > 0) { |
| | | float screenWidth = SystemCommon.getScreenWidth(vp_banner.getContext()); |
| | | int screenWidth = ScreenUtils.getScreenWidth(getContext()); |
| | | ViewGroup.MarginLayoutParams p1 = (ViewGroup.MarginLayoutParams) ((View) fl_fragment_activity.getParent()).getLayoutParams(); |
| | | |
| | | int rowSpace=DimenUtils.dip2px(getContext(),10); |
| | | int smallImageWidth; |
| | | int bigImageWidth=screenWidth-p1.leftMargin-p1.rightMargin; |
| | | |
| | | float actTotalHeight = (screenWidth - DimenUtils.dip2px(getContext(), 20)) * 7 / 20; |
| | | for (int i = 0; i < mList.size(); i++) { |
| | | if (i > 0 && i % 2 == 0) { |
| | |
| | | } |
| | | FrameLayout.LayoutParams params0 = new FrameLayout.LayoutParams((int) (screenWidth - |
| | | DimenUtils.dip2px(getContext(), 20)), (int) actTotalHeight); |
| | | params0.leftMargin = DimenUtils.dip2px(getContext(), 10); |
| | | params0.rightMargin = DimenUtils.dip2px(getContext(), 10); |
| | | params0.leftMargin = DimenUtils.dip2px(getContext(), 0); |
| | | params0.rightMargin = DimenUtils.dip2px(getContext(), 0); |
| | | params0.topMargin = DimenUtils.dip2px(getContext(), 15); |
| | | params0.bottomMargin = DimenUtils.dip2px(getContext(), 10); |
| | | ll_fragment_activity.setLayoutParams(params0); |
| | |
| | | |
| | | iv_activity_bg.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams |
| | | .MATCH_PARENT, (int) actTotalHeight + DimenUtils.dip2px(getContext(), 25))); |
| | | Glide.with(getContext()).load(bottomPic).into(iv_activity_bg); |
| | | // Glide.with(getContext()).load(bottomPic).into(iv_activity_bg); |
| | | |
| | | for (int i = 0; i < mList.size(); i++) { |
| | | if (i == 0) { |
| | |
| | | (int) (screenWidth - DimenUtils.dip2px(getContext(), 20)) * 7 / 20); |
| | | params.gravity = Gravity.TOP; |
| | | iv.setLayoutParams(params); |
| | | iv.setScaleType(ImageView.ScaleType.CENTER_CROP); |
| | | iv.setScaleType(ImageView.ScaleType.FIT_XY); |
| | | |
| | | Glide.with(getContext()).load(info.getPicture()).into(iv); |
| | | iv.setOnClickListener(new View.OnClickListener() { |