// Path: SampleFresh/app/src/main/java/cn/sharesdk/demo/manager/platform/PlatformUITypeManager.java
// public class PlatformUITypeManager {
// 
// 	public static int getPlatformIcon(int share_type) {
// 		switch (share_type) {
// 			case Platform.SHARE_VIDEO: {
// 				return R.mipmap.base_video;
// 			}
// 			case Platform.SHARE_TEXT: {
// 				return R.mipmap.share_text;
// 			}
// 			case Platform.SHARE_IMAGE: {
// 				return R.mipmap.share_multimages;
// 			}
// 			case Platform.SHARE_APPS: {
// 				return R.mipmap.share_app;
// 			}
// 			case Platform.SHARE_FILE: {
// 				return R.mipmap.base_file;
// 			}
// 			case Platform.SHARE_EMOJI: {
// 				return R.mipmap.share_icon;
// 			}
// 			case Platform.SHARE_WXMINIPROGRAM: {
// 				return R.mipmap.share_mini_program;
// 			}
// 			case Platform.SHARE_MUSIC: {
// 				return R.mipmap.share_url_music;
// 			}
// 			case Platform.SHARE_LINKCARD: {
// 				return R.mipmap.share_url_music;
// 			}
// 			case Platform.SHARE_ZHIFUBAO: {
// 				return R.mipmap.share_webpage;
// 			}
// 			default: {
// 				return R.mipmap.share_webpage;
// 			}
// 		}
// 	}
// 
// 	public static int getPlatformName(int share_type) {
// 		switch (share_type) {
// 			case Platform.SHARE_VIDEO: {
// 				return R.string.platform_share_video;
// 			}
// 			case Platform.SHARE_TEXT: {
// 				return R.string.platform_share_text;
// 			}
// 			case Platform.SHARE_IMAGE: {
// 				return R.string.platform_share_image;
// 			}
// 			case Platform.SHARE_APPS: {
// 				return R.string.platform_share_app;
// 			}
// 			case Platform.SHARE_FILE: {
// 				return R.string.platform_share_file;
// 			}
// 			case Platform.SHARE_EMOJI: {
// 				return R.string.platform_share_emoji;
// 			}
// 			case Platform.SHARE_WXMINIPROGRAM: {
// 				return R.string.platform_share_mini_app;
// 			}
// 			case Platform.SHARE_WEBPAGE: {
// 				return R.string.platform_share_webpage;
// 			}
// 			case Platform.SHARE_MUSIC: {
// 				return R.string.platform_share_music;
// 			}
// 			case Platform.SHARE_LINKCARD: {
// 				return R.string.platform_share_linkcard;
// 			}
// 			case Platform.QQ_MINI_PROGRAM: {
// 				return R.string.platform_share_qqmini;
// 			}
// 			default: {
// 				return R.string.platform_share_webpage;
// 			}
// 		}
// 	}
// }


import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import java.util.List;
import androidx.recyclerview.widget.RecyclerView;
import cn.sharesdk.demo.R;
import cn.sharesdk.demo.manager.platform.PlatformUITypeManager;
package cn.sharesdk.demo.adapter;




/**
 * Created by yjin on 2017/5/17.
 */

public class SharePlatformAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
	private List<Integer> platForms;
	private Context context;
	private LayoutInflater inflater;
	private OnClickItemListener onClickItemListener;

	public void setOnClickItemListener(OnClickItemListener onClickItemListener){
		this.onClickItemListener = onClickItemListener;
	}

	public SharePlatformAdapter(List<Integer> lists,Context context){
		this.platForms = lists;
		this.context = context;
		inflater = LayoutInflater.from(context);
	}
	@Override
	public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
		View view = null;
		if(view == null){
			view = inflater.inflate(R.layout.share_platform_item,parent,false);
		}
		return new PlatFormViewHolder(view);
	}

	@Override
	public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) {
		final int shareType = platForms.get(position);
		if (holder != null && holder instanceof PlatFormViewHolder) {
			PlatFormViewHolder viewHolder = (PlatFormViewHolder) holder;
			viewHolder.platformIcon.setImageResource(PlatformUITypeManager.getPlatformIcon(shareType));
// Path: SampleFresh/app/src/main/java/cn/sharesdk/demo/manager/platform/PlatformUITypeManager.java
// public class PlatformUITypeManager {
// 
// 	public static int getPlatformIcon(int share_type) {
// 		switch (share_type) {
// 			case Platform.SHARE_VIDEO: {
// 				return R.mipmap.base_video;
// 			}
// 			case Platform.SHARE_TEXT: {
// 				return R.mipmap.share_text;
// 			}
// 			case Platform.SHARE_IMAGE: {
// 				return R.mipmap.share_multimages;
// 			}
// 			case Platform.SHARE_APPS: {
// 				return R.mipmap.share_app;
// 			}
// 			case Platform.SHARE_FILE: {
// 				return R.mipmap.base_file;
// 			}
// 			case Platform.SHARE_EMOJI: {
// 				return R.mipmap.share_icon;
// 			}
// 			case Platform.SHARE_WXMINIPROGRAM: {
// 				return R.mipmap.share_mini_program;
// 			}
// 			case Platform.SHARE_MUSIC: {
// 				return R.mipmap.share_url_music;
// 			}
// 			case Platform.SHARE_LINKCARD: {
// 				return R.mipmap.share_url_music;
// 			}
// 			case Platform.SHARE_ZHIFUBAO: {
// 				return R.mipmap.share_webpage;
// 			}
// 			default: {
// 				return R.mipmap.share_webpage;
// 			}
// 		}
// 	}
// 
// 	public static int getPlatformName(int share_type) {
// 		switch (share_type) {
// 			case Platform.SHARE_VIDEO: {
// 				return R.string.platform_share_video;
// 			}
// 			case Platform.SHARE_TEXT: {
// 				return R.string.platform_share_text;
// 			}
// 			case Platform.SHARE_IMAGE: {
// 				return R.string.platform_share_image;
// 			}
// 			case Platform.SHARE_APPS: {
// 				return R.string.platform_share_app;
// 			}
// 			case Platform.SHARE_FILE: {
// 				return R.string.platform_share_file;
// 			}
// 			case Platform.SHARE_EMOJI: {
// 				return R.string.platform_share_emoji;
// 			}
// 			case Platform.SHARE_WXMINIPROGRAM: {
// 				return R.string.platform_share_mini_app;
// 			}
// 			case Platform.SHARE_WEBPAGE: {
// 				return R.string.platform_share_webpage;
// 			}
// 			case Platform.SHARE_MUSIC: {
// 				return R.string.platform_share_music;
// 			}
// 			case Platform.SHARE_LINKCARD: {
// 				return R.string.platform_share_linkcard;
// 			}
// 			case Platform.QQ_MINI_PROGRAM: {
// 				return R.string.platform_share_qqmini;
// 			}
// 			default: {
// 				return R.string.platform_share_webpage;
// 			}
// 		}
// 	}
// }


// Path: SampleFresh/app/src/main/java/cn/sharesdk/demo/adapter/SharePlatformAdapter.java
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import java.util.List;
import androidx.recyclerview.widget.RecyclerView;
import cn.sharesdk.demo.R;
import cn.sharesdk.demo.manager.platform.PlatformUITypeManager;

package cn.sharesdk.demo.adapter;




/**
 * Created by yjin on 2017/5/17.
 */

public class SharePlatformAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
	private List<Integer> platForms;
	private Context context;
	private LayoutInflater inflater;
	private OnClickItemListener onClickItemListener;

	public void setOnClickItemListener(OnClickItemListener onClickItemListener){
		this.onClickItemListener = onClickItemListener;
	}

	public SharePlatformAdapter(List<Integer> lists,Context context){
		this.platForms = lists;
		this.context = context;
		inflater = LayoutInflater.from(context);
	}
	@Override
	public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
		View view = null;
		if(view == null){
			view = inflater.inflate(R.layout.share_platform_item,parent,false);
		}
		return new PlatFormViewHolder(view);
	}

	@Override
	public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) {
		final int shareType = platForms.get(position);
		if (holder != null && holder instanceof PlatFormViewHolder) {
			PlatFormViewHolder viewHolder = (PlatFormViewHolder) holder;
			viewHolder.platformIcon.setImageResource(PlatformUITypeManager.getPlatformIcon(shareType));
			viewHolder.platformName.setText(PlatformUITypeManager.getPlatformName(shareType));