DevStore首页 > DEV资源 > 源码下载 > 源码详情

腾讯视频在线播放

 
断水流 | 2017-08-12 14:51    浏览量(1803)    评论(4)    收藏(2)
功能分类:娱乐 支持平台:Android 运行环境:Android
开发语言:Java 开发工具:Android Studio 源码大小:4.46MB
下载源码 76 人下载

源码简介

腾讯,乐视,视频在线播放

源码截图

DevStore所有源码来自用户上传分享,版权问题及牵扯到商业纠纷均与DevStore无关。

源码片段

package com.cz.babySister.adapter;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.bumptech.glide.Glide;
import com.cz.babySister.R;
import com.cz.babySister.activity.MainActivity;
import com.cz.babySister.interfaces.MyOnclickLiener;
import com.cz.babySister.javabean.TvBean;
import com.cz.babySister.service.NetService;
import com.cz.babySister.utils.StringResource;

import java.util.List;

public class MoviesAdapter extends RecyclerView.Adapter
{

	private Context context;
	private List list;
	private MyOnclickLiener click;
	private SharedPreferences player;

	public MoviesAdapter(Context context, List list)
	{
		this.context = context;
		this.list = list;
		player = context.getSharedPreferences("player", Activity.MODE_PRIVATE);
	}

	public void setOnclickLiener(MyOnclickLiener l)
	{
		click = l;
	}
	@Override
	public int getItemCount()
	{
		if(null==list)
		{
			return 0;
		}
		else
		{
			return list.size();
		}
	}

	@Override
	public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int position)
	{
		View view =  LayoutInflater.from(context).inflate(R.layout.movies_list,parent,false);
		return new TvHolder(view);
	}

	private class TvHolder extends RecyclerView.ViewHolder
	{
		private ImageView online_img;
		private ImageView down_img;
		private TextView online_title;
		private LinearLayout movies_layout;

		private TvHolder(View view)
		{
			super(view);
			movies_layout = (LinearLayout)view.findViewById(R.id.movies_layout);
			down_img = (ImageView)view.findViewById(R.id.update_list_down);
			online_img = (ImageView)view.findViewById(R.id.update_list_img);
			online_title = (TextView)view.findViewById(R.id.update_list_title);
			if(MainActivity.screenWidth>0)
			{
				RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, (int)(MainActivity.screenWidth/2.8));
				online_img.setLayoutParams(params);
			}
		}
	}

	@Override
	public void onBindViewHolder(final RecyclerView.ViewHolder holder, int index)
	{
		try
		{
			final int position = holder.getAdapterPosition();
			final TvHolder tvHolder = (TvHolder)holder;
			final TvBean bean = list.get(position);
			final String title = bean.getName();
			tvHolder.online_title.setText(title);
			String imgurl = bean.getImg();
			if(null==imgurl)
			{
				imgurl = "";
			}

			if(MainActivity.isVip)
			{
				if(StringResource.onlineJiMap.get(bean.getUrl())!=null)
				{
					String videoUrl = StringResource.onlineJiMap.get(bean.getUrl());
					if(null!=videoUrl&&!"".equals(videoUrl))
					{
						tvHolder.down_img.setVisibility(View.VISIBLE);
					}
					else
					{
						tvHolder.down_img.setVisibility(View.GONE);
					}
				}
				else
				{
					tvHolder.down_img.setVisibility(View.GONE);
				}
			}
			else
			{
				float count = player.getFloat("wanpu_number",0f);
				if(count>=150)
				{
						if(StringResource.onlineJiMap.get(bean.getUrl())!=null&&StringResource.onlineJiMap.get(bean.getUrl()).endsWith(".mp4"))
						{
							String videoUrl = StringResource.onlineJiMap.get(bean.getUrl());
							if(null!=videoUrl&&!"".equals(videoUrl))
							{
								tvHolder.down_img.setVisibility(View.VISIBLE);
							}
							else
							{
								tvHolder.down_img.setVisibility(View.GONE);
							}
						}
						else
						{
							tvHolder.down_img.setVisibility(View.GONE);
						}
				}
				else
				{
					tvHolder.down_img.setVisibility(View.GONE);
				}
			}

			Glide.with(context).load(imgurl).placeholder(R.mipmap.ic_nonepic).error(R.mipmap.ic_nonepic).into(tvHolder.online_img);
			tvHolder.movies_layout.setOnClickListener(new View.OnClickListener()
			{
				@Override
				public void onClick(View v)
				{
					if(null!=click)
					{
						click.onclick(v,position);
					}
				}
			});

			tvHolder.down_img.setOnClickListener(new View.OnClickListener()
			{
				@Override
				public void onClick(View v)
				{
					String videoUrl = StringResource.onlineJiMap.get(bean.getUrl());
					if(null!=videoUrl&&!"".equals(videoUrl))
					{
						NetService.getInstance().setDownLoad(videoUrl,title);
					}
				}
			});
    	}
	catch(Exception e)
	{
		e.printStackTrace();
	}
	}

}
  •   赞(0) 赞 +1 赞(0) 已赞
  •   收藏(2) 收藏 +1 已收藏 取消
  •   下载(76)
评论(4)
逆风草

逆风草 2017-11-07 14:30:05

说好的源码呢
回复(0) 赞(0) 赞(1)
xusigh

xusigh 2017-10-26 14:25:16

12积分以上可以看爱情动作片
回复(1) 赞(1) 赞(2)
 
  • xusigh:
    回复@xusigh:在个人里面有短视频和积分视频..
    回复2017-10-26 14:26:49
风之者

风之者 2017-09-02 14:02:22

这是一个骗子
回复(0) 赞(2) 赞(3)
久违

久违 2017-08-15 11:26:59

没有用 没有源码 就是把自己的软件打广告
回复(0) 赞(0) 赞(1)
  • 推荐
  • 审核
  • 收录
  • 获取活力值

源码上传作者

  • 0 能力值
  • 2 源码
  • 0 评测
  • 0 资料