| | |
| | | import android.content.Intent; |
| | | import android.content.SharedPreferences; |
| | | import android.content.pm.ApplicationInfo; |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | |
| | | import android.widget.Toast; |
| | | |
| | | import com.bumptech.glide.Glide; |
| | | import com.bumptech.glide.load.engine.DiskCacheStrategy; |
| | | import com.bumptech.glide.request.RequestOptions; |
| | | import com.google.gson.FieldNamingPolicy; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | import com.lcjian.library.widget.MyListView; |
| | | import com.weikou.beibeivideo.BeibeiVideoApplication; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.entity.HomeType; |
| | | import com.weikou.beibeivideo.entity.HomeVideo; |
| | | import com.weikou.beibeivideo.entity.VideoInfo; |
| | |
| | | import com.weikou.beibeivideo.ui.common.VideosLiveActivity; |
| | | import com.weikou.beibeivideo.ui.discover.StarsActivity; |
| | | import com.weikou.beibeivideo.ui.media.VideoDetailActivity; |
| | | import com.weikou.beibeivideo.util.AdPromptDialog; |
| | | import com.weikou.beibeivideo.util.AppMarket; |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.GlideCircleTransform; |
| | | import com.weikou.beibeivideo.util.downutil.ApkUtil; |
| | | import com.yeshi.buwanshequ.R; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | |
| | | } else { |
| | | try { |
| | | Glide.with(context).load(mHomeType.getIcon()) |
| | | .diskCacheStrategy(DiskCacheStrategy.SOURCE).placeholder(R.drawable.ic_stars_collection).into(recommendViewHolder.tv_category_icon); |
| | | .apply(new RequestOptions().placeholder(R.drawable.ic_stars_collection)) |
| | | .into(recommendViewHolder.tv_category_icon); |
| | | |
| | | |
| | | } catch (IllegalArgumentException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | // "com.weikou.beibeivideo.ui.common.MVideosActivity")) {//去好评 |
| | | // mateAppMarket(mHomeType); |
| | | // } else { |
| | | Gson gson = new GsonBuilder() |
| | | .setFieldNamingPolicy(FieldNamingPolicy.UPPER_CAMEL_CASE) |
| | | .create(); |
| | | VideoType type = gson.fromJson(mHomeType.getParams().replace( |
| | | "\\" + "\"", "\""), VideoType.class); |
| | | try { |
| | | intent = new Intent(v.getContext(), Class.forName(mHomeType.getActivity())); |
| | | intent.putExtra("video_type", type); |
| | | intent.putExtra("type_name", type.getName()); |
| | | intent.putExtra("isPush", false); |
| | | v.getContext().startActivity(intent); |
| | | } catch (ClassNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | Gson gson = new GsonBuilder() |
| | | .setFieldNamingPolicy(FieldNamingPolicy.UPPER_CAMEL_CASE) |
| | | .create(); |
| | | VideoType type = gson.fromJson(mHomeType.getParams().replace( |
| | | "\\" + "\"", "\""), VideoType.class); |
| | | try { |
| | | intent = new Intent(v.getContext(), Class.forName(mHomeType.getActivity())); |
| | | intent.putExtra("video_type", type); |
| | | intent.putExtra("type_name", type.getName()); |
| | | intent.putExtra("isPush", false); |
| | | v.getContext().startActivity(intent); |
| | | } catch (ClassNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | // } |
| | | } |
| | | } |
| | |
| | | final HotStar hotstar = list.get(0); |
| | | try { |
| | | Glide.with(context).load(hotstar.getPortrait()) |
| | | .placeholder(R.drawable.ic_star_portrait_defailt) |
| | | .error(R.drawable.ic_star_portrait_defailt) |
| | | .centerCrop() |
| | | .transform(new GlideCircleTransform(context)) |
| | | .apply(new RequestOptions().skipMemoryCache(false).centerCrop().placeholder(R.drawable.ic_star_portrait_defailt).error(R.drawable.ic_star_portrait_defailt).transform(new GlideCircleTransform(context)) |
| | | ) |
| | | .into(iv_pic); |
| | | } catch (IllegalArgumentException e) { |
| | | e.printStackTrace(); |
| | |
| | | final HotStar hotstar1 = list.get(1); |
| | | try { |
| | | Glide.with(context).load(hotstar1.getPortrait()) |
| | | .placeholder(R.drawable.ic_star_portrait_defailt) |
| | | .error(R.drawable.ic_star_portrait_defailt) |
| | | .centerCrop() |
| | | .transform(new GlideCircleTransform(context)) |
| | | .apply(new RequestOptions().centerCrop().placeholder(R.drawable.ic_star_portrait_defailt).error(R.drawable.ic_star_portrait_defailt).transform(new GlideCircleTransform(context))) |
| | | |
| | | .into(iv_pic1); |
| | | } catch (IllegalArgumentException e) { |
| | | e.printStackTrace(); |
| | |
| | | final HotStar hotstar2 = list.get(2); |
| | | try { |
| | | Glide.with(context).load(hotstar2.getPortrait()) |
| | | .placeholder(R.drawable.ic_star_portrait_defailt) |
| | | .error(R.drawable.ic_star_portrait_defailt) |
| | | .centerCrop() |
| | | .transform(new GlideCircleTransform(context)) |
| | | .apply(new RequestOptions().centerCrop().placeholder(R.drawable.ic_star_portrait_defailt).error(R.drawable.ic_star_portrait_defailt).transform(new GlideCircleTransform(context))) |
| | | .into(iv_pic2); |
| | | } catch (IllegalArgumentException e) { |
| | | e.printStackTrace(); |
| | |
| | | ll_video_show1.setVisibility(View.VISIBLE); |
| | | if (StringUtils.isEmpty(info.getPicture())) { |
| | | Glide.with(context).load(info.getVideo().getPicture()) |
| | | .placeholder(R.drawable.ic_default_cover) |
| | | .error(R.drawable.ic_default_cover) |
| | | .centerCrop().crossFade() |
| | | .diskCacheStrategy(DiskCacheStrategy.SOURCE) |
| | | .apply(new RequestOptions().centerCrop().placeholder(R.drawable.ic_star_portrait_defailt).error(R.drawable.ic_star_portrait_defailt).transform(new GlideCircleTransform(context))) |
| | | .into(iv_movie_cover); |
| | | } else { |
| | | try { |
| | | Glide.with(context).load(info.getPicture()) |
| | | .placeholder(R.drawable.ic_default_cover) |
| | | .error(R.drawable.ic_default_cover) |
| | | .centerCrop().crossFade() |
| | | .diskCacheStrategy(DiskCacheStrategy.SOURCE) |
| | | .apply(new RequestOptions().centerCrop().placeholder(R.drawable.ic_star_portrait_defailt).error(R.drawable.ic_star_portrait_defailt).transform(new GlideCircleTransform(context))) |
| | | .into(iv_movie_cover); |
| | | } catch (IllegalArgumentException e) { |
| | | e.printStackTrace(); |
| | |
| | | ll_video_show2.setVisibility(View.VISIBLE); |
| | | if (StringUtils.isEmpty(info1.getPicture())) { |
| | | Glide.with(context).load(info1.getVideo().getPicture()) |
| | | .placeholder(R.drawable.ic_default_cover) |
| | | .error(R.drawable.ic_default_cover) |
| | | .centerCrop().crossFade() |
| | | .diskCacheStrategy(DiskCacheStrategy.SOURCE) |
| | | .apply(new RequestOptions().centerCrop().placeholder(R.drawable.ic_star_portrait_defailt).error(R.drawable.ic_star_portrait_defailt).transform(new GlideCircleTransform(context))) |
| | | .into(iv_movie_cover1); |
| | | } else { |
| | | try { |
| | | Glide.with(context).load(info1.getPicture()) |
| | | .placeholder(R.drawable.ic_default_cover) |
| | | .error(R.drawable.ic_default_cover) |
| | | .centerCrop().crossFade() |
| | | .diskCacheStrategy(DiskCacheStrategy.SOURCE) |
| | | .apply(new RequestOptions().centerCrop().placeholder(R.drawable.ic_default_cover).error(R.drawable.ic_default_cover).transform(new GlideCircleTransform(context))) |
| | | // .diskCacheStrategy(DiskCacheStrategy.SOURCE) |
| | | .into(iv_movie_cover1); |
| | | } catch (IllegalArgumentException e) { |
| | | e.printStackTrace(); |
| | |
| | | // if (mType.getName().contains("福利")) {//0不评论,1评论 去好评 |
| | | // mateAppMarket1(info); |
| | | // } else { |
| | | Intent intent = new Intent(v.getContext(), VideoDetailActivity.class); |
| | | intent.putExtra("video_info", info); |
| | | v.getContext().startActivity(intent); |
| | | Intent intent = new Intent(v.getContext(), VideoDetailActivity.class); |
| | | intent.putExtra("video_info", info); |
| | | v.getContext().startActivity(intent); |
| | | // } |
| | | } |
| | | |