|
|
@@ -1,23 +1,16 @@
|
|
|
package com.kfzs.duanduan.adp;
|
|
|
|
|
|
-import android.annotation.SuppressLint;
|
|
|
import android.content.Context;
|
|
|
import android.graphics.Bitmap;
|
|
|
import android.graphics.BitmapFactory;
|
|
|
-import android.graphics.Color;
|
|
|
-import android.graphics.drawable.ColorDrawable;
|
|
|
import android.text.TextUtils;
|
|
|
-import android.util.Log;
|
|
|
-import android.view.Gravity;
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
import android.widget.AbsListView;
|
|
|
import android.widget.BaseAdapter;
|
|
|
-import android.widget.GridView;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.LinearLayout;
|
|
|
-import android.widget.RelativeLayout;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
|
|
|
@@ -25,7 +18,6 @@ import com.bumptech.glide.Glide;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.kfzs.duanduan.proto.GameTypeOuterClass;
|
|
|
import com.kfzs.duanduan.proto.GameTypeSpecialOuterClass;
|
|
|
-import com.kfzs.duanduan.G;
|
|
|
import com.kfzs.duanduan.utils.dlg.SkipUtils;
|
|
|
import com.kfzs.duanduan.view.diag.MyGridview;
|
|
|
|
|
|
@@ -41,7 +33,7 @@ import java.util.List;
|
|
|
public class ClassificationAdapter extends BaseAdapter { private ArrayList<String> mList;
|
|
|
private LayoutInflater mInflater;
|
|
|
private Context mContext;
|
|
|
- List<GameTypeSpecialOuterClass.GameTypeSpecial> listGameTS;
|
|
|
+// List<GameTypeSpecialOuterClass.GameTypeSpecial> listGameTS;
|
|
|
|
|
|
public ClassificationAdapter(ArrayList list, Context context) {
|
|
|
this.mList = list;
|
|
|
@@ -67,62 +59,61 @@ public class ClassificationAdapter extends BaseAdapter { private ArrayList<Stri
|
|
|
@Override
|
|
|
public View getView(int position, View convertView, ViewGroup parent) {
|
|
|
Object o = getItem(position);
|
|
|
- if(position == 0 ){
|
|
|
- return createTopGridView();
|
|
|
- }else {
|
|
|
- GameTypeOuterClass.GameType gameType = ((GameTypeOuterClass.GameType) o);
|
|
|
- convertView = mInflater.inflate(R.layout.classification_item, null);
|
|
|
- ImageView iconIv = (ImageView) convertView.findViewById(R.id.icon_iv);
|
|
|
- TextView one_tv = (TextView) convertView.findViewById(R.id.one_tv);
|
|
|
- TextView two_tv = (TextView) convertView.findViewById(R.id.two_tv);
|
|
|
- TextView three_tv = (TextView) convertView.findViewById(R.id.three_tv);
|
|
|
- TextView four_tv = (TextView) convertView.findViewById(R.id.four_tv);
|
|
|
- TextView five_tv = (TextView) convertView.findViewById(R.id.five_tv);
|
|
|
- TextView six_tv = (TextView) convertView.findViewById(R.id.six_tv);
|
|
|
- LinearLayout game_classified_layout = convertView.findViewById(R.id.game_classified_layout);
|
|
|
- if(position == 1){
|
|
|
- game_classified_layout.setVisibility(View.VISIBLE);
|
|
|
- }else {
|
|
|
- game_classified_layout.setVisibility(View.GONE);
|
|
|
- }
|
|
|
- if(gameType.getSecondTypesList() != null && gameType.getSecondTypesList().size() > 0){
|
|
|
- for(int i=0;i<gameType.getSecondTypesList().size();i++){
|
|
|
- GameTypeOuterClass.GameType gameTypeSecond = gameType.getSecondTypesList().get(i);
|
|
|
- switch (i){
|
|
|
- case 0:
|
|
|
- setTextView(mContext,gameType,one_tv, i);
|
|
|
- one_tv.setOnClickListener(new Onclick(gameTypeSecond));
|
|
|
- break;
|
|
|
- case 1:
|
|
|
- setTextView(mContext,gameType,two_tv, i);
|
|
|
- two_tv.setOnClickListener(new Onclick(gameTypeSecond));
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- setTextView(mContext,gameType,three_tv, i);
|
|
|
- three_tv.setOnClickListener(new Onclick(gameTypeSecond));
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- setTextView(mContext,gameType,four_tv, i);
|
|
|
- four_tv.setOnClickListener(new Onclick(gameTypeSecond));
|
|
|
- break;
|
|
|
- case 4:
|
|
|
- setTextView(mContext,gameType,five_tv, i);
|
|
|
- five_tv.setOnClickListener(new Onclick(gameTypeSecond));
|
|
|
- break;
|
|
|
- case 5:
|
|
|
- setTextView(mContext,gameType,six_tv, i);
|
|
|
- six_tv.setOnClickListener(new Onclick(gameTypeSecond));
|
|
|
- break;
|
|
|
- }
|
|
|
+// if(position == 0 ){
|
|
|
+// return createTopGridView();
|
|
|
+// }
|
|
|
+ GameTypeOuterClass.GameType gameType = ((GameTypeOuterClass.GameType) o);
|
|
|
+ convertView = mInflater.inflate(R.layout.classification_item, null);
|
|
|
+ ImageView iconIv = (ImageView) convertView.findViewById(R.id.icon_iv);
|
|
|
+ TextView one_tv = (TextView) convertView.findViewById(R.id.one_tv);
|
|
|
+ TextView two_tv = (TextView) convertView.findViewById(R.id.two_tv);
|
|
|
+ TextView three_tv = (TextView) convertView.findViewById(R.id.three_tv);
|
|
|
+ TextView four_tv = (TextView) convertView.findViewById(R.id.four_tv);
|
|
|
+ TextView five_tv = (TextView) convertView.findViewById(R.id.five_tv);
|
|
|
+ TextView six_tv = (TextView) convertView.findViewById(R.id.six_tv);
|
|
|
+// LinearLayout game_classified_layout = convertView.findViewById(R.id.game_classified_layout);
|
|
|
+// if(position == 0){
|
|
|
+// game_classified_layout.setVisibility(View.VISIBLE);
|
|
|
+// }else {
|
|
|
+// game_classified_layout.setVisibility(View.GONE);
|
|
|
+// }
|
|
|
+ if(gameType.getSecondTypesList() != null && gameType.getSecondTypesList().size() > 0){
|
|
|
+ for(int i=0;i<gameType.getSecondTypesList().size();i++){
|
|
|
+ GameTypeOuterClass.GameType gameTypeSecond = gameType.getSecondTypesList().get(i);
|
|
|
+ switch (i){
|
|
|
+ case 0:
|
|
|
+ setTextView(mContext,gameType,one_tv, i);
|
|
|
+ one_tv.setOnClickListener(new Onclick(gameTypeSecond));
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ setTextView(mContext,gameType,two_tv, i);
|
|
|
+ two_tv.setOnClickListener(new Onclick(gameTypeSecond));
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ setTextView(mContext,gameType,three_tv, i);
|
|
|
+ three_tv.setOnClickListener(new Onclick(gameTypeSecond));
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ setTextView(mContext,gameType,four_tv, i);
|
|
|
+ four_tv.setOnClickListener(new Onclick(gameTypeSecond));
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ setTextView(mContext,gameType,five_tv, i);
|
|
|
+ five_tv.setOnClickListener(new Onclick(gameTypeSecond));
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ setTextView(mContext,gameType,six_tv, i);
|
|
|
+ six_tv.setOnClickListener(new Onclick(gameTypeSecond));
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
- iconIv.setOnClickListener(new Onclick(gameType));
|
|
|
- Glide.with(mContext)
|
|
|
- .load(gameType.getIcon()+"")
|
|
|
- .error(android.R.drawable.stat_notify_error)
|
|
|
- .into(iconIv);
|
|
|
- return convertView;
|
|
|
}
|
|
|
+ iconIv.setOnClickListener(new Onclick(gameType));
|
|
|
+ Glide.with(mContext)
|
|
|
+ .load(gameType.getIcon()+"")
|
|
|
+ .error(android.R.drawable.stat_notify_error)
|
|
|
+ .into(iconIv);
|
|
|
+ return convertView;
|
|
|
}
|
|
|
|
|
|
private void setTextView(Context context, GameTypeOuterClass.GameType o, TextView v, int i){
|
|
|
@@ -147,183 +138,183 @@ public class ClassificationAdapter extends BaseAdapter { private ArrayList<Stri
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void toBindTopviewData(List<GameTypeSpecialOuterClass.GameTypeSpecial> listGameTS){
|
|
|
- this.listGameTS = listGameTS;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 顶部 gridview
|
|
|
- * @return
|
|
|
- */
|
|
|
- private View createTopGridView(){
|
|
|
-
|
|
|
- View view = null;
|
|
|
- GridviewHolder holder = null;
|
|
|
- if( holder == null){
|
|
|
- view = mInflater.inflate(R.layout.classification_gridview_item, null);
|
|
|
- holder = new GridviewHolder(view);
|
|
|
- }else{
|
|
|
- holder = (GridviewHolder) view.getTag();
|
|
|
- }
|
|
|
-
|
|
|
- holder.adapter.toBindTopviewData(listGameTS);
|
|
|
- holder.adapter.notifyDataSetChanged();
|
|
|
- return view;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 创建图片容器
|
|
|
- * @return
|
|
|
- */
|
|
|
- @SuppressLint("ResourceType")
|
|
|
- public View createTopView() {
|
|
|
- LinearLayout linearLayout = new LinearLayout(mContext);
|
|
|
- if(listGameTS == null || listGameTS.size()<8){
|
|
|
- return linearLayout;
|
|
|
- }
|
|
|
- linearLayout.setOrientation(LinearLayout.VERTICAL);
|
|
|
- // 获取屏幕宽度
|
|
|
- int W = G.WIDTH <G.HEIGHT ? G.WIDTH : G.HEIGHT;
|
|
|
- int cricleRadius = W / 2 ;
|
|
|
- Log.e("-------------", cricleRadius+"");
|
|
|
- // 根据每行个数设置布局大小
|
|
|
- linearLayout.setPadding(5, 5, 5, 5);
|
|
|
- linearLayout.setGravity(Gravity.CENTER);
|
|
|
- // 设置图片大小
|
|
|
- linearLayout.setLayoutParams(new AbsListView.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT , LinearLayout.LayoutParams.WRAP_CONTENT));
|
|
|
- /*--------------------------big img----------------------------------*/
|
|
|
- LinearLayout bigLinearLayout = new LinearLayout(mContext);
|
|
|
- bigLinearLayout.setOrientation(LinearLayout.HORIZONTAL);
|
|
|
- bigLinearLayout.setGravity(Gravity.CENTER);
|
|
|
- // 设置图片大小
|
|
|
- bigLinearLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT , LinearLayout.LayoutParams.WRAP_CONTENT));
|
|
|
- bigLinearLayout.setId(0);
|
|
|
-
|
|
|
- ImageView bigCircleImageView = new ImageView(mContext);
|
|
|
- bigCircleImageView.setLayoutParams(new LinearLayout.LayoutParams(cricleRadius, cricleRadius));
|
|
|
-// Bitmap map = BitmapFactory.decodeResource(mContext.getResources(),R.drawable.classification_tengxun);
|
|
|
-// bigCircleImageView.setImageBitmap(map);
|
|
|
- Glide.with(mContext)
|
|
|
- .load(listGameTS.get(0).getIcon())
|
|
|
- .error(android.R.drawable.stat_notify_error)
|
|
|
- .into(bigCircleImageView);
|
|
|
- bigCircleImageView.setId(1);
|
|
|
- bigCircleImageView.setPadding(0,3,0,3);
|
|
|
-
|
|
|
- bigCircleImageView.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- startToActivity(listGameTS.get(0), mContext);
|
|
|
- }
|
|
|
- });
|
|
|
- bigLinearLayout.addView(bigCircleImageView);
|
|
|
-
|
|
|
- RelativeLayout bigLinearLayout2 = new RelativeLayout(mContext);
|
|
|
- bigLinearLayout2.setPadding(5, 5, 5, 5);
|
|
|
- bigLinearLayout2.setLayoutParams(new LinearLayout.LayoutParams(cricleRadius , cricleRadius));
|
|
|
- bigLinearLayout2.setId(2);
|
|
|
-
|
|
|
- ImageView ircleImageView1 = new ImageView(mContext);
|
|
|
- RelativeLayout.LayoutParams imageView1Params = new RelativeLayout.LayoutParams(cricleRadius/2-5,cricleRadius/2-5);
|
|
|
- ircleImageView1.setLayoutParams(imageView1Params);
|
|
|
- Glide.with(mContext)
|
|
|
- .load(listGameTS.get(1).getIcon())
|
|
|
- .error(android.R.drawable.stat_notify_error)
|
|
|
- .into(ircleImageView1);
|
|
|
- ircleImageView1.setId(21);
|
|
|
- ircleImageView1.setPadding(0,0,2,0);
|
|
|
- ircleImageView1.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- startToActivity(listGameTS.get(1), mContext);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- ImageView ircleImageView2 = new ImageView(mContext);
|
|
|
- RelativeLayout.LayoutParams imageView1Params2 = new RelativeLayout.LayoutParams(cricleRadius/2-5,cricleRadius/2-5);
|
|
|
- imageView1Params2.addRule(RelativeLayout.RIGHT_OF, ircleImageView1.getId());
|
|
|
- ircleImageView2.setLayoutParams(imageView1Params2);
|
|
|
- Glide.with(mContext)
|
|
|
- .load(listGameTS.get(2).getIcon())
|
|
|
- .error(android.R.drawable.stat_notify_error)
|
|
|
- .into(ircleImageView2);
|
|
|
- ircleImageView2.setId(22);
|
|
|
- ircleImageView2.setPadding(3,0,0,0);
|
|
|
- ircleImageView2.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- startToActivity(listGameTS.get(2), mContext);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- ImageView ircleImageView3 = new ImageView(mContext);
|
|
|
- RelativeLayout.LayoutParams imageView1Params3 = new RelativeLayout.LayoutParams(cricleRadius/2-5,cricleRadius/2-5);
|
|
|
- imageView1Params3.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
|
|
|
- ircleImageView3.setLayoutParams(imageView1Params3);
|
|
|
-
|
|
|
- Glide.with(mContext)
|
|
|
- .load(listGameTS.get(3).getIcon())
|
|
|
- .error(android.R.drawable.stat_notify_error)
|
|
|
- .into(ircleImageView3);
|
|
|
- ircleImageView3.setId(23);
|
|
|
- ircleImageView3.setPadding(0,5,0,0);
|
|
|
- ircleImageView3.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- startToActivity(listGameTS.get(3), mContext);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- ImageView ircleImageView4 = new ImageView(mContext);
|
|
|
- RelativeLayout.LayoutParams imageView1Params4 = new RelativeLayout.LayoutParams(cricleRadius/2-5,cricleRadius/2-5);
|
|
|
- imageView1Params4.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
|
|
|
- imageView1Params4.addRule(RelativeLayout.RIGHT_OF, ircleImageView3.getId());
|
|
|
- ircleImageView4.setLayoutParams(imageView1Params4);
|
|
|
-// Bitmap map4 = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.classification_erciyuan);
|
|
|
-// ircleImageView4.setImageBitmap(map4);
|
|
|
- Glide.with(mContext)
|
|
|
- .load(listGameTS.get(4).getIcon())
|
|
|
- .error(android.R.drawable.stat_notify_error)
|
|
|
- .into(ircleImageView4);
|
|
|
- ircleImageView4.setId(24);
|
|
|
- ircleImageView4.setPadding(5, 5, 0, 0);
|
|
|
- ircleImageView4.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- startToActivity(listGameTS.get(4), mContext);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- bigLinearLayout2.addView(ircleImageView1);
|
|
|
- bigLinearLayout2.addView(ircleImageView2);
|
|
|
- bigLinearLayout2.addView(ircleImageView3);
|
|
|
- bigLinearLayout2.addView(ircleImageView4);
|
|
|
-
|
|
|
- bigLinearLayout.addView(bigLinearLayout2);
|
|
|
-
|
|
|
- linearLayout.addView(bigLinearLayout);
|
|
|
- /*------------------------------------------------------------*/
|
|
|
-
|
|
|
- /*--------------------------bottom img----------------------------------*/
|
|
|
-
|
|
|
- LinearLayout bottomLinearLayout = new LinearLayout(mContext);
|
|
|
- bottomLinearLayout.setPadding(5, 5, 5, 5);
|
|
|
- bottomLinearLayout.setOrientation(LinearLayout.HORIZONTAL);
|
|
|
- bottomLinearLayout.setGravity(Gravity.CENTER);
|
|
|
- // 设置图片大小
|
|
|
- bottomLinearLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT , LinearLayout.LayoutParams.WRAP_CONTENT));
|
|
|
- bottomLinearLayout.setId(3);
|
|
|
-
|
|
|
- bottomLinearLayout.addView(createImageView(R.drawable.classification_chijizhuanq, cricleRadius/2-5, listGameTS.get(5)));
|
|
|
- bottomLinearLayout.addView(createImageView(R.drawable.classification_wangyizhuanqu, cricleRadius/2-5, listGameTS.get(6)));
|
|
|
- bottomLinearLayout.addView(createImageView(R.drawable.classification_xianxia, cricleRadius/2-5, listGameTS.get(7)));
|
|
|
- bottomLinearLayout.addView(createImageView(R.drawable.classification_gengduoyouxo, cricleRadius/2-5, null));
|
|
|
-
|
|
|
- linearLayout.addView(bottomLinearLayout);
|
|
|
- /*--------------------------bottom img----------------------------------*/
|
|
|
-
|
|
|
- return linearLayout;
|
|
|
- }
|
|
|
+// public void toBindTopviewData(List<GameTypeSpecialOuterClass.GameTypeSpecial> listGameTS){
|
|
|
+// this.listGameTS = listGameTS;
|
|
|
+// }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 顶部 gridview
|
|
|
+// * @return
|
|
|
+// */
|
|
|
+// private View createTopGridView(){
|
|
|
+//
|
|
|
+// View view = null;
|
|
|
+// GridviewHolder holder = null;
|
|
|
+// if( holder == null){
|
|
|
+// view = mInflater.inflate(R.layout.classification_gridview_item, null);
|
|
|
+// holder = new GridviewHolder(view);
|
|
|
+// }else{
|
|
|
+// holder = (GridviewHolder) view.getTag();
|
|
|
+// }
|
|
|
+//
|
|
|
+// holder.adapter.toBindTopviewData(listGameTS);
|
|
|
+// holder.adapter.notifyDataSetChanged();
|
|
|
+// return view;
|
|
|
+// }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 创建图片容器
|
|
|
+// * @return
|
|
|
+// */
|
|
|
+// @SuppressLint("ResourceType")
|
|
|
+// public View createTopView() {
|
|
|
+// LinearLayout linearLayout = new LinearLayout(mContext);
|
|
|
+// if(listGameTS == null || listGameTS.size()<8){
|
|
|
+// return linearLayout;
|
|
|
+// }
|
|
|
+// linearLayout.setOrientation(LinearLayout.VERTICAL);
|
|
|
+// // 获取屏幕宽度
|
|
|
+// int W = G.WIDTH <G.HEIGHT ? G.WIDTH : G.HEIGHT;
|
|
|
+// int cricleRadius = W / 2 ;
|
|
|
+// Log.e("-------------", cricleRadius+"");
|
|
|
+// // 根据每行个数设置布局大小
|
|
|
+// linearLayout.setPadding(5, 5, 5, 5);
|
|
|
+// linearLayout.setGravity(Gravity.CENTER);
|
|
|
+// // 设置图片大小
|
|
|
+// linearLayout.setLayoutParams(new AbsListView.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT , LinearLayout.LayoutParams.WRAP_CONTENT));
|
|
|
+// /*--------------------------big img----------------------------------*/
|
|
|
+// LinearLayout bigLinearLayout = new LinearLayout(mContext);
|
|
|
+// bigLinearLayout.setOrientation(LinearLayout.HORIZONTAL);
|
|
|
+// bigLinearLayout.setGravity(Gravity.CENTER);
|
|
|
+// // 设置图片大小
|
|
|
+// bigLinearLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT , LinearLayout.LayoutParams.WRAP_CONTENT));
|
|
|
+// bigLinearLayout.setId(0);
|
|
|
+//
|
|
|
+// ImageView bigCircleImageView = new ImageView(mContext);
|
|
|
+// bigCircleImageView.setLayoutParams(new LinearLayout.LayoutParams(cricleRadius, cricleRadius));
|
|
|
+//// Bitmap map = BitmapFactory.decodeResource(mContext.getResources(),R.drawable.classification_tengxun);
|
|
|
+//// bigCircleImageView.setImageBitmap(map);
|
|
|
+// Glide.with(mContext)
|
|
|
+// .load(listGameTS.get(0).getIcon())
|
|
|
+// .error(android.R.drawable.stat_notify_error)
|
|
|
+// .into(bigCircleImageView);
|
|
|
+// bigCircleImageView.setId(1);
|
|
|
+// bigCircleImageView.setPadding(0,3,0,3);
|
|
|
+//
|
|
|
+// bigCircleImageView.setOnClickListener(new View.OnClickListener() {
|
|
|
+// @Override
|
|
|
+// public void onClick(View v) {
|
|
|
+// startToActivity(listGameTS.get(0), mContext);
|
|
|
+// }
|
|
|
+// });
|
|
|
+// bigLinearLayout.addView(bigCircleImageView);
|
|
|
+//
|
|
|
+// RelativeLayout bigLinearLayout2 = new RelativeLayout(mContext);
|
|
|
+// bigLinearLayout2.setPadding(5, 5, 5, 5);
|
|
|
+// bigLinearLayout2.setLayoutParams(new LinearLayout.LayoutParams(cricleRadius , cricleRadius));
|
|
|
+// bigLinearLayout2.setId(2);
|
|
|
+//
|
|
|
+// ImageView ircleImageView1 = new ImageView(mContext);
|
|
|
+// RelativeLayout.LayoutParams imageView1Params = new RelativeLayout.LayoutParams(cricleRadius/2-5,cricleRadius/2-5);
|
|
|
+// ircleImageView1.setLayoutParams(imageView1Params);
|
|
|
+// Glide.with(mContext)
|
|
|
+// .load(listGameTS.get(1).getIcon())
|
|
|
+// .error(android.R.drawable.stat_notify_error)
|
|
|
+// .into(ircleImageView1);
|
|
|
+// ircleImageView1.setId(21);
|
|
|
+// ircleImageView1.setPadding(0,0,2,0);
|
|
|
+// ircleImageView1.setOnClickListener(new View.OnClickListener() {
|
|
|
+// @Override
|
|
|
+// public void onClick(View v) {
|
|
|
+// startToActivity(listGameTS.get(1), mContext);
|
|
|
+// }
|
|
|
+// });
|
|
|
+//
|
|
|
+// ImageView ircleImageView2 = new ImageView(mContext);
|
|
|
+// RelativeLayout.LayoutParams imageView1Params2 = new RelativeLayout.LayoutParams(cricleRadius/2-5,cricleRadius/2-5);
|
|
|
+// imageView1Params2.addRule(RelativeLayout.RIGHT_OF, ircleImageView1.getId());
|
|
|
+// ircleImageView2.setLayoutParams(imageView1Params2);
|
|
|
+// Glide.with(mContext)
|
|
|
+// .load(listGameTS.get(2).getIcon())
|
|
|
+// .error(android.R.drawable.stat_notify_error)
|
|
|
+// .into(ircleImageView2);
|
|
|
+// ircleImageView2.setId(22);
|
|
|
+// ircleImageView2.setPadding(3,0,0,0);
|
|
|
+// ircleImageView2.setOnClickListener(new View.OnClickListener() {
|
|
|
+// @Override
|
|
|
+// public void onClick(View v) {
|
|
|
+// startToActivity(listGameTS.get(2), mContext);
|
|
|
+// }
|
|
|
+// });
|
|
|
+//
|
|
|
+// ImageView ircleImageView3 = new ImageView(mContext);
|
|
|
+// RelativeLayout.LayoutParams imageView1Params3 = new RelativeLayout.LayoutParams(cricleRadius/2-5,cricleRadius/2-5);
|
|
|
+// imageView1Params3.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
|
|
|
+// ircleImageView3.setLayoutParams(imageView1Params3);
|
|
|
+//
|
|
|
+// Glide.with(mContext)
|
|
|
+// .load(listGameTS.get(3).getIcon())
|
|
|
+// .error(android.R.drawable.stat_notify_error)
|
|
|
+// .into(ircleImageView3);
|
|
|
+// ircleImageView3.setId(23);
|
|
|
+// ircleImageView3.setPadding(0,5,0,0);
|
|
|
+// ircleImageView3.setOnClickListener(new View.OnClickListener() {
|
|
|
+// @Override
|
|
|
+// public void onClick(View v) {
|
|
|
+// startToActivity(listGameTS.get(3), mContext);
|
|
|
+// }
|
|
|
+// });
|
|
|
+//
|
|
|
+// ImageView ircleImageView4 = new ImageView(mContext);
|
|
|
+// RelativeLayout.LayoutParams imageView1Params4 = new RelativeLayout.LayoutParams(cricleRadius/2-5,cricleRadius/2-5);
|
|
|
+// imageView1Params4.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
|
|
|
+// imageView1Params4.addRule(RelativeLayout.RIGHT_OF, ircleImageView3.getId());
|
|
|
+// ircleImageView4.setLayoutParams(imageView1Params4);
|
|
|
+//// Bitmap map4 = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.classification_erciyuan);
|
|
|
+//// ircleImageView4.setImageBitmap(map4);
|
|
|
+// Glide.with(mContext)
|
|
|
+// .load(listGameTS.get(4).getIcon())
|
|
|
+// .error(android.R.drawable.stat_notify_error)
|
|
|
+// .into(ircleImageView4);
|
|
|
+// ircleImageView4.setId(24);
|
|
|
+// ircleImageView4.setPadding(5, 5, 0, 0);
|
|
|
+// ircleImageView4.setOnClickListener(new View.OnClickListener() {
|
|
|
+// @Override
|
|
|
+// public void onClick(View v) {
|
|
|
+// startToActivity(listGameTS.get(4), mContext);
|
|
|
+// }
|
|
|
+// });
|
|
|
+//
|
|
|
+// bigLinearLayout2.addView(ircleImageView1);
|
|
|
+// bigLinearLayout2.addView(ircleImageView2);
|
|
|
+// bigLinearLayout2.addView(ircleImageView3);
|
|
|
+// bigLinearLayout2.addView(ircleImageView4);
|
|
|
+//
|
|
|
+// bigLinearLayout.addView(bigLinearLayout2);
|
|
|
+//
|
|
|
+// linearLayout.addView(bigLinearLayout);
|
|
|
+// /*------------------------------------------------------------*/
|
|
|
+//
|
|
|
+// /*--------------------------bottom img----------------------------------*/
|
|
|
+//
|
|
|
+// LinearLayout bottomLinearLayout = new LinearLayout(mContext);
|
|
|
+// bottomLinearLayout.setPadding(5, 5, 5, 5);
|
|
|
+// bottomLinearLayout.setOrientation(LinearLayout.HORIZONTAL);
|
|
|
+// bottomLinearLayout.setGravity(Gravity.CENTER);
|
|
|
+// // 设置图片大小
|
|
|
+// bottomLinearLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT , LinearLayout.LayoutParams.WRAP_CONTENT));
|
|
|
+// bottomLinearLayout.setId(3);
|
|
|
+//
|
|
|
+// bottomLinearLayout.addView(createImageView(R.drawable.classification_chijizhuanq, cricleRadius/2-5, listGameTS.get(5)));
|
|
|
+// bottomLinearLayout.addView(createImageView(R.drawable.classification_wangyizhuanqu, cricleRadius/2-5, listGameTS.get(6)));
|
|
|
+// bottomLinearLayout.addView(createImageView(R.drawable.classification_xianxia, cricleRadius/2-5, listGameTS.get(7)));
|
|
|
+// bottomLinearLayout.addView(createImageView(R.drawable.classification_gengduoyouxo, cricleRadius/2-5, null));
|
|
|
+//
|
|
|
+// linearLayout.addView(bottomLinearLayout);
|
|
|
+// /*--------------------------bottom img----------------------------------*/
|
|
|
+//
|
|
|
+// return linearLayout;
|
|
|
+// }
|
|
|
|
|
|
/**
|
|
|
* 创建imageView
|
|
|
@@ -384,21 +375,21 @@ public class ClassificationAdapter extends BaseAdapter { private ArrayList<Stri
|
|
|
return new AbsListView.LayoutParams(w, h);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * gridview holder
|
|
|
- */
|
|
|
- class GridviewHolder{
|
|
|
- MyGridview gridview;
|
|
|
- ClassificationGridviewAdapter adapter;
|
|
|
-
|
|
|
- public GridviewHolder(View view) {
|
|
|
- this.gridview = view.findViewById(R.id.classification_gridview);
|
|
|
- this.adapter = new ClassificationGridviewAdapter( listGameTS, mContext);
|
|
|
- gridview.setAdapter(adapter);
|
|
|
-// gridview.setSelector(new ColorDrawable(Color.TRANSPARENT));
|
|
|
- view.setTag(this);
|
|
|
- }
|
|
|
- }
|
|
|
+// /**
|
|
|
+// * gridview holder
|
|
|
+// */
|
|
|
+// class GridviewHolder{
|
|
|
+// MyGridview gridview;
|
|
|
+// ClassificationGridviewAdapter adapter;
|
|
|
+//
|
|
|
+// public GridviewHolder(View view) {
|
|
|
+// this.gridview = view.findViewById(R.id.classification_gridview);
|
|
|
+// this.adapter = new ClassificationGridviewAdapter( listGameTS, mContext);
|
|
|
+// gridview.setAdapter(adapter);
|
|
|
+//// gridview.setSelector(new ColorDrawable(Color.TRANSPARENT));
|
|
|
+// view.setTag(this);
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
/**
|
|
|
* 获取图片的颜色
|