handler图片自动切换+listview+GridView+侧滑菜单+fragment

news/2024/11/28 8:22:37/

//效果图如下


//首先把所需要的依赖包导入  gson jar包、imageLoader jar包、design jar包,,,然后导入library,新建项目,把library导入项目中

//添加权限

<uses-permission android:name="android.permission.INTERNET"></uses-permission>
android:name=".MyApplication"
微笑 微笑 微笑drawable包下 selector_rb 布局

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"><item android:color="@color/colorPrimary" android:state_checked="false"></item><item android:color="@color/colorAccent" android:state_checked="true"></item>
</selector>
微笑 微笑 微笑layout包下 activity_main 布局

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="com.samsung.sunfuliang10252.MainActivity"><android.support.v4.widget.DrawerLayout
        android:id="@+id/drawer_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"><LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"><FrameLayout
                android:id="@+id/fr_main"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"></FrameLayout><RadioGroup
                android:id="@+id/rg"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"><RadioButton
                    android:id="@+id/rb_shouye"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:button="@null"
                    android:checked="true"
                    android:gravity="center"
                    android:text="首页"
                    android:textColor="@drawable/selector_rb" /><RadioButton
                    android:id="@+id/rb_fenlei"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:button="@null"
                    android:gravity="center"
                    android:text="分类"
                    android:textColor="@drawable/selector_rb" /><RadioButton
                    android:id="@+id/rb_faxian"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:button="@null"
                    android:gravity="center"
                    android:text="发现"
                    android:textColor="@drawable/selector_rb" /><RadioButton
                    android:id="@+id/rb_gouwuche"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:button="@null"
                    android:gravity="center"
                    android:text="购物车"
                    android:textColor="@drawable/selector_rb" /><RadioButton
                    android:id="@+id/rb_wode"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:button="@null"
                    android:gravity="center"
                    android:text="我的"
                    android:textColor="@drawable/selector_rb" /></RadioGroup></LinearLayout><LinearLayout
            android:layout_width="240dp"
            android:layout_height="match_parent"
            android:layout_gravity="start"
            android:background="#fff"
            android:gravity="center_horizontal"
            android:orientation="vertical"><ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="30dp"
                android:src="@mipmap/ic_launcher" /><TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="10dp"
                android:text="个人设置" /><TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="10dp"
                android:text="缓存" /><TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="10dp"
                android:text="夜间模式" /><TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="10dp"
                android:text="配置" /></LinearLayout></android.support.v4.widget.DrawerLayout></LinearLayout>
微笑 微笑 微笑layout包下 fl_gv_item 布局

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:orientation="vertical"><ImageView
        android:id="@+id/fl_gv_img"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_margin="10dp" /><TextView
        android:id="@+id/fl_gv_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:ellipsize="end"
        android:lines="2" />
</LinearLayout>
微笑 微笑 微笑layout包下 fr_faxian 布局

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"><android.support.design.widget.TabLayout
        android:id="@+id/tab_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:tabGravity="fill"
        app:tabIndicatorColor="@color/colorAccent"
        app:tabMode="fixed"
        app:tabSelectedTextColor="@color/colorPrimaryDark"
        app:tabTextColor="@color/colorPrimary" /><android.support.v4.view.ViewPager
        android:id="@+id/vp"
        android:layout_width="match_parent"
        android:layout_height="match_parent"></android.support.v4.view.ViewPager>
</LinearLayout>
微笑 微笑 微笑layout包下 fr_fenlei 布局

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"><ListView
        android:id="@+id/lv_gl"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"></ListView><GridView
        android:id="@+id/gv_gl"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="3"
        android:numColumns="3"></GridView></LinearLayout>
微笑 微笑 微笑layout包下 fr_others 布局

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"><TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/name"
        android:text="分类" /></LinearLayout>
微笑 微笑 微笑layout包下 fr_shouye 布局

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"><com.handmark.pulltorefresh.library.PullToRefreshScrollView
        android:id="@+id/ptr_sv"
        android:layout_width="match_parent"
        android:layout_height="match_parent"><LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"><!--<com.youth.banner.Banner-->
            <!--android:id="@+id/banner"-->
            <!--android:layout_width="match_parent"-->
            <!--android:layout_height="200dp"></com.youth.banner.Banner>-->
            <ImageView
                android:id="@+id/image_head"
                android:layout_width="match_parent"
                android:layout_height="200dp" /><com.samsung.sunfuliang10252.MyGridView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:id="@+id/gv"
                android:numColumns="2"></com.samsung.sunfuliang10252.MyGridView></LinearLayout></com.handmark.pulltorefresh.library.PullToRefreshScrollView></LinearLayout>
微笑 微笑 微笑layout包下 gv_item 布局

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"><ImageView
        android:id="@+id/gv_img"
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:layout_margin="10dp"
        android:scaleType="centerCrop" /><TextView
        android:id="@+id/gv_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ellipsize="end"
        android:lines="2" /></LinearLayout>
微笑 微笑 微笑layout包下 ptr_lv_item_img 布局

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"><TextView
        android:id="@+id/title_img"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:gravity="center"
        android:textSize="20dp" /><ImageView
        android:id="@+id/img"
        android:layout_width="80dp"
        android:layout_height="80dp" />
</LinearLayout>
微笑 微笑 微笑layout包下 ptr_lv_item_word 布局

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"><TextView
        android:id="@+id/title_word"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:textSize="20dp" /></LinearLayout>
微笑 微笑 微笑layout包下 tab_jingxuan 布局

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ptr="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"><com.handmark.pulltorefresh.library.PullToRefreshListView
        android:id="@+id/ptr_lv"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        ptr:ptrAnimationStyle="flip"
        ptr:ptrDrawable="@drawable/default_ptr_flip"
        ptr:ptrHeaderBackground="#383838"
        ptr:ptrHeaderTextColor="#FFFFFF"></com.handmark.pulltorefresh.library.PullToRefreshListView></LinearLayout>
微笑 微笑 微笑layout包下 tab_others 布局

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"><TextView
        android:id="@+id/name"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:text="tab" /></LinearLayout>
微笑 微笑 微笑主包下 MainActivity 类

import android.support.annotation.IdRes;
import android.support.v4.app.Fragment;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.RadioGroup;import fragments.Fr_FaXian;
import fragments.Fr_FenLei;
import fragments.Fr_GouWuChe;
import fragments.Fr_ShouYe;
import fragments.Fr_WoDe;public class MainActivity extends AppCompatActivity {private RadioGroup rg;private DrawerLayout drawerlayout;@Override
    protected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);//加载控件
        initView();//菜单栏点击监听
        setRgClickListener();//默认加载布局
        addFragment(new Fr_ShouYe());}private void setRgClickListener() {rg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {@Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {switch (checkedId) {case R.id.rb_shouye:addFragment(new Fr_ShouYe());break;case R.id.rb_faxian:addFragment(new Fr_FaXian());break;case R.id.rb_gouwuche:addFragment(new Fr_GouWuChe());break;case R.id.rb_wode:addFragment(new Fr_WoDe());break;case R.id.rb_fenlei:addFragment(new Fr_FenLei());break;}}});}private void initView() {drawerlayout = (DrawerLayout) findViewById(R.id.drawer_layout);rg = (RadioGroup) findViewById(R.id.rg);}//装载视图
    private void addFragment(Fragment f) {getSupportFragmentManager().beginTransaction().replace(R.id.fr_main, f).commit();};}
微笑 微笑 微笑主包下 MyApplication 类

public class MyApplication extends Application {@Override
    public void onCreate() {super.onCreate();ImageLoaderUtil.initConfig(this);}
}
微笑 微笑 微笑主包下 MyGridView 类

import android.content.Context;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.util.AttributeSet;
import android.widget.GridView;public class MyGridView extends GridView {public MyGridView(Context context) {super(context);}public MyGridView(Context context, AttributeSet attrs) {super(context, attrs);}public MyGridView(Context context, AttributeSet attrs, int defStyleAttr) {super(context, attrs, defStyleAttr);}@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)public MyGridView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {super(context, attrs, defStyleAttr, defStyleRes);}@Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);super.onMeasure(widthMeasureSpec, expandSpec);}
}
微笑 微笑 微笑adapters包下 FenLei_Gv 类

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;import com.nostra13.universalimageloader.core.ImageLoader;
import com.samsung.sunfuliang10252.R;import java.util.List;import bean.FenLeiResult;
import utils.ImageLoaderUtil;public class FenLei_Gv extends BaseAdapter {private List<FenLeiResult.DataBean> list;private Context context;public FenLei_Gv(List<FenLeiResult.DataBean> list, Context context) {this.list = list;this.context = context;}@Override
    public int getCount() {return list.size();}@Override
    public Object getItem(int position) {return list.get(position);}@Override
    public long getItemId(int position) {return position;}@Override
    public View getView(int position, View convertView, ViewGroup parent) {ViewHolder holder;if (convertView == null) {convertView = View.inflate(context, R.layout.fl_gv_item, null);holder = new ViewHolder();holder.textView = (TextView) convertView.findViewById(R.id.fl_gv_text);holder.imageView = (ImageView) convertView.findViewById(R.id.fl_gv_img);convertView.setTag(holder);} else {holder = (ViewHolder) convertView.getTag();}holder.textView.setText(list.get(position).getTitle());ImageLoader.getInstance().displayImage(list.get(position).getImg(), holder.imageView, ImageLoaderUtil.getImageOptions());return convertView;}class ViewHolder {ImageView imageView;TextView textView;}}
微笑 微笑 微笑adapters包下 FenLei_lv 类

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;import java.util.List;import bean.Lv_data;public class FenLei_lv extends BaseAdapter {private List<Lv_data> list;private Context context;public FenLei_lv(List<Lv_data> list, Context context) {this.list = list;this.context = context;}@Override
    public int getCount() {return list.size();}@Override
    public Object getItem(int position) {return list.get(position);}@Override
    public long getItemId(int position) {return position;}@Override
    public View getView(int position, View convertView, ViewGroup parent) {convertView = View.inflate(context, android.R.layout.simple_expandable_list_item_1, null);TextView text = (TextView) convertView.findViewById(android.R.id.text1);text.setText(list.get(position).getName());return convertView;}
}
微笑 微笑 微笑adapters包下 GvAdapter 类

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;import com.nostra13.universalimageloader.core.ImageLoader;
import com.samsung.sunfuliang10252.R;import java.util.List;import bean.FaXianResult;
import utils.ImageLoaderUtil;public class GvAdapter extends BaseAdapter {private List<FaXianResult.DataBean> list;private Context context;public GvAdapter(List<FaXianResult.DataBean> list, Context context) {this.list = list;this.context = context;}@Override
    public int getCount() {return list.size();}@Override
    public Object getItem(int position) {return list.get(position);}@Override
    public long getItemId(int position) {return position;}@Override
    public View getView(int position, View convertView, ViewGroup parent) {ViewHolder holder;if (convertView == null) {convertView = View.inflate(context, R.layout.gv_item, null);holder = new ViewHolder();holder.imageView = (ImageView) convertView.findViewById(R.id.gv_img);holder.textView = (TextView) convertView.findViewById(R.id.gv_text);convertView.setTag(holder);} else {holder = (ViewHolder) convertView.getTag();}holder.textView.setText(list.get(position).getTitle());ImageLoader.getInstance().displayImage(list.get(position).getImg(), holder.imageView, ImageLoaderUtil.getImageOptions());return convertView;}class ViewHolder {ImageView imageView;TextView textView;}}
微笑 微笑 微笑adapters包下 LvAdapter 类

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;import com.nostra13.universalimageloader.core.ImageLoader;
import com.samsung.sunfuliang10252.R;import java.util.List;import bean.FaXianResult;
import utils.ImageLoaderUtil;public class LvAdapter extends BaseAdapter {private final int TYPE_WORD = 0;private final int TYPE_IMG = 1;private List<FaXianResult.DataBean> list;private Context context;public LvAdapter(List<FaXianResult.DataBean> list, Context context) {this.list = list;this.context = context;}@Override
    public int getViewTypeCount() {return 2;}@Override
    public int getItemViewType(int position) {if (position % 2 == 0) {return TYPE_WORD;} else {return TYPE_IMG;}}@Override
    public int getCount() {return list.size();}@Override
    public Object getItem(int position) {return list.get(position);}@Override
    public long getItemId(int position) {return position;}@Override
    public View getView(int position, View convertView, ViewGroup parent) {int type = getItemViewType(position);switch (type) {case TYPE_WORD:ViewHolderWord holderWord;if (convertView == null) {convertView = View.inflate(context, R.layout.ptr_lv_item_word, null);holderWord = new ViewHolderWord();holderWord.textView = (TextView) convertView.findViewById(R.id.title_word);convertView.setTag(holderWord);} else {holderWord = (ViewHolderWord) convertView.getTag();}holderWord.textView.setText(list.get(position).getTitle());return convertView;case TYPE_IMG:ViewHolderImg holderImg;if (convertView == null) {convertView = View.inflate(context, R.layout.ptr_lv_item_img, null);holderImg = new ViewHolderImg();holderImg.textView = (TextView) convertView.findViewById(R.id.title_img);holderImg.imageView = (ImageView) convertView.findViewById(R.id.img);convertView.setTag(holderImg);} else {holderImg = (ViewHolderImg) convertView.getTag();}holderImg.textView.setText(list.get(position).getTitle());ImageLoader.getInstance().displayImage(list.get(position).getImg(), holderImg.imageView, ImageLoaderUtil.getImageOptions());return convertView;}return convertView;}class ViewHolderWord {TextView textView;}class ViewHolderImg {TextView textView;ImageView imageView;}
}
微笑 微笑 微笑adapters包下 TabAdapter 类

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;import java.util.List;public class TabAdapter extends FragmentPagerAdapter {private List<String> list;private List<Fragment> listf;public TabAdapter(FragmentManager fm, List<String> list, List<Fragment> listf) {super(fm);this.list = list;this.listf = listf;}@Override
    public CharSequence getPageTitle(int position) {return list.get(position);}@Override
    public Fragment getItem(int position) {return listf.get(position);}@Override
    public int getCount() {return listf.size();}
}
微笑 微笑 微笑bean包下 FaXianResult 类

public class FaXianResult {/**
     * code : 1
     * success : true
     * width : 0
     * height : 0
     * data : [{"userImg":"http://img1.yulin520.com/news/HPUCVP74IFR0OKCZ9QQH.jpg#405_304","impressEditId":334,"impressType":0,"occupation":"证劵投资","url":"http://www.yulin520.com/a2a/h5/impress/i1/334?a=1508897417857","createTime":1466160199000,"hxKey":"60fd9c2377f81ba1ccca450fb794e016","img":"http://img1.yulin520.com/news/HPUCVP74IFR0OKCZ9QQH.jpg#405_304","yulin":"81373","introduction":"83/巨蟹座/ 开朗幽默,热情善良,追求刺激/喜欢温柔,体贴,可爱,善良的女孩/金融","replyTimes":17,"remark":"","click":0,"topTime":1469503026000,"recommend":0,"userAge":33,"star":58,"title":"刘峰鸣 :能文能武,Call Me峰鸣哥","source":0,"userName":"LLL","reporter":0,"status":1,"content":""},{"userImg":"http://img1.yulin520.com/news/BPKZUX0MNFR0OT0WLCOD.png#598_450","impressEditId":319,"impressType":0,"occupation":"保险","url":"http://www.yulin520.com/a2a/h5/impress/i1/319?a=1508897417857","createTime":1465380170000,"hxKey":"dac884f7cc81691ba28a004091cbe122","img":"http://img1.yulin520.com/news/BPKZUX0MNFR0OT0WLCOD.png#598_450","yulin":"80821","introduction":"91/处女座/性格直白,爱好广泛,有点女汉子/喜欢性格开朗,三观契合,高冷文艺范,有肌肉,175+/公司职业","replyTimes":12,"remark":"","click":0,"topTime":1469503022000,"recommend":0,"userAge":25,"star":77,"title":"刘佳怡 :直白女汉子也有个文艺梦","source":0,"userName":"嘉咦咦咦","reporter":0,"status":1,"content":""},{"userImg":"http://img1.yulin520.com/news/UPPN83L0IFR0OBC1A4AK.jpg#800_600","impressEditId":324,"impressType":0,"occupation":"互联网","url":"http://www.yulin520.com/a2a/h5/impress/i1/324?a=1508897417857","createTime":1465722569000,"hxKey":"ebf75ccd1fba85f248988d40e572914e","img":"http://img1.yulin520.com/news/UPPN83L0IFR0OBC1A4AK.jpg#800_600","yulin":"80569","introduction":"87/处女座/善良可爱,安静温柔,爱独立思考/喜欢三观相似,经历相似,性格活泼的女孩/互联网设计师 ","replyTimes":13,"remark":"","click":0,"topTime":1468980785000,"recommend":0,"userAge":29,"star":52,"title":"陈松 :爱搞新花样的设计师","source":0,"userName":"Song","reporter":0,"status":1,"content":""},{"userImg":"http://img1.yulin520.com/news/SPPW8T9QHFR0OM3HID0X.jpg#1280_960","impressEditId":323,"impressType":0,"occupation":"银行","url":"http://www.yulin520.com/a2a/h5/impress/i1/323?a=1508897417857","createTime":1465721939000,"hxKey":"580786532670bc072b0aeb795bd6ddc7","img":"http://img1.yulin520.com/news/SPPW8T9QHFR0OM3HID0X.jpg#1280_960","yulin":"80983","introduction":"90/天蝎座/爱美食,爱分享,有点内向/喜欢阳光,干净,175+的男孩子/银行接待","replyTimes":16,"remark":"","click":0,"topTime":1468980773000,"recommend":0,"userAge":26,"star":101,"title":"秦心 :外形不娇小,心思很细腻","source":0,"userName":"秦心","reporter":0,"status":1,"content":""},{"userImg":"http://img1.yulin520.com/news/XPW8OZXMSFR0O015UA7D.jpg#598_597","impressEditId":337,"impressType":0,"occupation":"互联网","url":"http://www.yulin520.com/a2a/h5/impress/i1/337?a=1508897417857","createTime":1466162998000,"hxKey":"37dee7aaed1862c64c4fe38d75ccd52a","img":"http://img1.yulin520.com/news/XPW8OZXMSFR0O015UA7D.jpg#598_597","yulin":"81316","introduction":"93/水瓶座/温柔体贴,踏实细心/喜欢三观相符的女孩子/前端工程师","replyTimes":17,"remark":"","click":0,"topTime":1468574992000,"recommend":0,"userAge":23,"star":55,"title":"温其堂 :细心温柔IT\u201c熊猫\u201d","source":0,"userName":"榴莲","reporter":0,"status":1,"content":""},{"userImg":"http://img1.yulin520.com/news/RPZ58LLNXFR0OKFGFHGK.jpg#616_695","impressEditId":340,"impressType":0,"occupation":"银行","url":"http://www.yulin520.com/a2a/h5/impress/i1/340?a=1508897417857","createTime":1466500236000,"hxKey":"2a294b9ffd9fb38d7b5b8739c821720f","img":"http://img1.yulin520.com/news/RPZ58LLNXFR0OKFGFHGK.jpg#616_695","yulin":"81370","introduction":"92/金牛座 /性格随和,自信大方/喜欢脾气好,爱运动,对人友好的男生/公司职员","replyTimes":13,"remark":"","click":0,"topTime":1468574986000,"recommend":0,"userAge":24,"star":72,"title":"曾思慧: 爱冒险爱尖叫的真性情Girl","source":0,"userName":"pony","reporter":0,"status":1,"content":""},{"userImg":"http://img1.yulin520.com/news/NQ1HJD75IFR0OARCWFEG.jpg#501_499","impressEditId":341,"impressType":0,"occupation":"市场推广","url":"http://www.yulin520.com/a2a/h5/impress/i1/341?a=1508897417857","createTime":1466678686000,"hxKey":"9f2d5f4346dee0c4983cb77f9a1892e7","img":"http://img1.yulin520.com/news/NQ1HJD75IFR0OARCWFEG.jpg#501_499","yulin":"80908","introduction":"91/巨蟹座/乐观开朗,沉稳内敛,机智幽默/喜欢温柔,体贴,孝顺的女生","replyTimes":11,"remark":"","click":0,"topTime":1468203095000,"recommend":0,"userAge":25,"star":34,"title":"杨辉: 挑战自我从早起开始","source":0,"userName":"拯救","reporter":0,"status":1,"content":""},{"userImg":"http://img1.yulin520.com/news/SO9EZSX0QC90ONZY8SVZ.jpg#619_650","impressEditId":244,"impressType":0,"occupation":"市场推广","url":"http://www.yulin520.com/a2a/h5/impress/i1/244?a=1508897417857","createTime":1461738088000,"hxKey":"751120bb7102fa563f098ee8c33ecb67","img":"http://img1.yulin520.com/news/SO9EZSX0QC90ONZY8SVZ.jpg#619_650","yulin":"77323","introduction":"92年 狮子座/开朗东北妞/想开书店/公司职员","replyTimes":9,"remark":"","click":0,"topTime":1467618377000,"recommend":0,"userAge":24,"star":46,"title":"蔡嘉纯:咱东北菇凉特开朗","source":0,"userName":"bibibi","reporter":0,"status":1,"content":""},{"userImg":"http://img1.yulin520.com/news/OOAA5UE7EC90OM4X4AQ7.jpg#800_600","impressEditId":246,"impressType":0,"occupation":"信贷","url":"http://www.yulin520.com/a2a/h5/impress/i1/246?a=1508897417857","createTime":1461749927000,"hxKey":"785fd3ce68d2a280a99896946dc67bf2","img":"http://img1.yulin520.com/news/OOAA5UE7EC90OM4X4AQ7.jpg#800_600","yulin":"77479","introduction":"94年 水瓶座/曾经是淘气包/人缘好讲义气/金融业客户经理","replyTimes":11,"remark":"","click":0,"topTime":1467367384000,"recommend":0,"userAge":22,"star":41,"title":"李林:曾经的淘气小子","source":0,"userName":"李林","reporter":0,"status":1,"content":""},{"userImg":"http://img1.yulin520.com/news/FNTQDAWAJKF0OGYIUMRO.jpg#800_600","impressEditId":218,"impressType":0,"occupation":"互联网","url":"http://www.yulin520.com/a2a/h5/impress/i1/218?a=1508897417857","createTime":1460446369000,"hxKey":"406e5f1f020f65203d200b686cd11da3","img":"http://img1.yulin520.com/news/FNTQDAWAJKF0OGYIUMRO.jpg#800_600","yulin":"76330","introduction":"91年 天蝎座/积极乐观/追求新奇事物/互联网销售经理","replyTimes":16,"remark":"","click":0,"topTime":1467367368000,"recommend":0,"userAge":25,"star":53,"title":"唐政:眉清目秀好少年","source":0,"userName":"Truman","reporter":0,"status":1,"content":""}]
     * message : null
     */

    private int code;private boolean success;private int width;private int height;private Object message;private List<DataBean> data;public int getCode() {return code;}public void setCode(int code) {this.code = code;}public boolean isSuccess() {return success;}public void setSuccess(boolean success) {this.success = success;}public int getWidth() {return width;}public void setWidth(int width) {this.width = width;}public int getHeight() {return height;}public void setHeight(int height) {this.height = height;}public Object getMessage() {return message;}public void setMessage(Object message) {this.message = message;}public List<DataBean> getData() {return data;}public void setData(List<DataBean> data) {this.data = data;}public static class DataBean {/**
         * userImg : http://img1.yulin520.com/news/HPUCVP74IFR0OKCZ9QQH.jpg#405_304
         * impressEditId : 334
         * impressType : 0
         * occupation : 证劵投资
         * url : http://www.yulin520.com/a2a/h5/impress/i1/334?a=1508897417857
         * createTime : 1466160199000
         * hxKey : 60fd9c2377f81ba1ccca450fb794e016
         * img : http://img1.yulin520.com/news/HPUCVP74IFR0OKCZ9QQH.jpg#405_304
         * yulin : 81373
         * introduction : 83/巨蟹座/ 开朗幽默,热情善良,追求刺激/喜欢温柔,体贴,可爱,善良的女孩/金融
         * replyTimes : 17
         * remark :
         * click : 0
         * topTime : 1469503026000
         * recommend : 0
         * userAge : 33
         * star : 58
         * title : 刘峰鸣 :能文能武,Call Me峰鸣哥
         * source : 0
         * userName : LLL
         * reporter : 0
         * status : 1
         * content :
         */

        private String userImg;private int impressEditId;private int impressType;private String occupation;private String url;private long createTime;private String hxKey;private String img;private String yulin;private String introduction;private int replyTimes;private String remark;private int click;private long topTime;private int recommend;private int userAge;private int star;private String title;private int source;private String userName;private int reporter;private int status;private String content;public String getUserImg() {return userImg;}public void setUserImg(String userImg) {this.userImg = userImg;}public int getImpressEditId() {return impressEditId;}public void setImpressEditId(int impressEditId) {this.impressEditId = impressEditId;}public int getImpressType() {return impressType;}public void setImpressType(int impressType) {this.impressType = impressType;}public String getOccupation() {return occupation;}public void setOccupation(String occupation) {this.occupation = occupation;}public String getUrl() {return url;}public void setUrl(String url) {this.url = url;}public long getCreateTime() {return createTime;}public void setCreateTime(long createTime) {this.createTime = createTime;}public String getHxKey() {return hxKey;}public void setHxKey(String hxKey) {this.hxKey = hxKey;}public String getImg() {return img;}public void setImg(String img) {this.img = img;}public String getYulin() {return yulin;}public void setYulin(String yulin) {this.yulin = yulin;}public String getIntroduction() {return introduction;}public void setIntroduction(String introduction) {this.introduction = introduction;}public int getReplyTimes() {return replyTimes;}public void setReplyTimes(int replyTimes) {this.replyTimes = replyTimes;}public String getRemark() {return remark;}public void setRemark(String remark) {this.remark = remark;}public int getClick() {return click;}public void setClick(int click) {this.click = click;}public long getTopTime() {return topTime;}public void setTopTime(long topTime) {this.topTime = topTime;}public int getRecommend() {return recommend;}public void setRecommend(int recommend) {this.recommend = recommend;}public int getUserAge() {return userAge;}public void setUserAge(int userAge) {this.userAge = userAge;}public int getStar() {return star;}public void setStar(int star) {this.star = star;}public String getTitle() {return title;}public void setTitle(String title) {this.title = title;}public int getSource() {return source;}public void setSource(int source) {this.source = source;}public String getUserName() {return userName;}public void setUserName(String userName) {this.userName = userName;}public int getReporter() {return reporter;}public void setReporter(int reporter) {this.reporter = reporter;}public int getStatus() {return status;}public void setStatus(int status) {this.status = status;}public String getContent() {return content;}public void setContent(String content) {this.content = content;}}
}
微笑 微笑 微笑bean包下 FenLeiResult 类

public class FenLeiResult {/**
     * code : 1
     * success : true
     * width : 0
     * height : 0
     * data : [{"userImg":"http://img1.yulin520.com/news/IO3X6ANK4AZ0O8D2DCBI.jpg#600_800","impressEditId":234,"impressType":0,"occupation":"互联网","url":"http://www.yulin520.com/a2a/h5/impress/i1/234?a=1508909087667","createTime":1461208285000,"hxKey":"6d4e0008032fe0b0f4838ad4379a1469","img":"http://img1.yulin520.com/news/IO3X6ANK4AZ0O8D2DCBI.jpg#600_800","yulin":"76558","introduction":"86年 狮子座/爱运动的技术男/梦想开健身会所/系统工程师","replyTimes":13,"remark":"","click":0,"topTime":1463394348000,"recommend":0,"userAge":30,"star":37,"title":"陈泳青:健康是最有意义的追求","source":0,"userName":"阿青","reporter":0,"status":1,"content":""},{"userImg":"http://img1.yulin520.com/news/EOUYVNDG5FR0OWQ8UKRT.jpg#507_601","impressEditId":274,"impressType":0,"occupation":"前台","url":"http://www.yulin520.com/a2a/h5/impress/i1/274?a=1508909087667","createTime":1463127538000,"hxKey":"02485e7bc913a9705fcded89e2c11784","img":"http://img1.yulin520.com/news/EOUYVNDG5FR0OWQ8UKRT.jpg#507_601","yulin":"79198","introduction":"92年白羊座/潮州/乐观开朗白羊座女生/坚信爱要勇敢追/前台","replyTimes":5,"remark":"","click":0,"topTime":1463361228000,"recommend":0,"userAge":24,"star":18,"title":"孙颖:梦想是嫁高富帅?No","source":0,"userName":"Sunying~","reporter":0,"status":1,"content":""},{"userImg":"http://img1.yulin520.com/news/SOR6YH3ROFR0OEB9UL4C.jpg#567_600","impressEditId":275,"impressType":0,"occupation":"互联网","url":"http://www.yulin520.com/a2a/h5/impress/i1/275?a=1508909087667","createTime":1463133830000,"hxKey":"3f59ba8bf250747a2f471af042564a22","img":"http://img1.yulin520.com/news/SOR6YH3ROFR0OEB9UL4C.jpg#567_600","yulin":"78688","introduction":"89年双鱼座/甘肃/185CM/细心暖男/成熟稳重/爱是陪你环游世界/金融行业运营总监","replyTimes":9,"remark":"","click":0,"topTime":1463133830000,"recommend":0,"userAge":27,"star":19,"title":"任浩:  热心肠的运营总监","source":0,"userName":"缘来是你","reporter":0,"status":1,"content":""},{"userImg":"http://img1.yulin520.com/news/4OSS111GPFR0OHFFNUU8.jpg#867_720","impressEditId":272,"impressType":0,"occupation":"房地产","url":"http://www.yulin520.com/a2a/h5/impress/i1/272?a=1508909087667","createTime":1463111242000,"hxKey":"f46f8bd5d95b4d092736eded8b7b31f7","img":"http://img1.yulin520.com/news/4OSS111GPFR0OHFFNUU8.jpg#867_720","yulin":"78046","introduction":"89年双子座/开朗活泼/开过奶茶店/略微小固执/房地产","replyTimes":5,"remark":"","click":0,"topTime":1463140150000,"recommend":0,"userAge":26,"star":18,"title":"陈净:奶茶妹妹的得意人生","source":0,"userName":"叽里呱啦","reporter":0,"status":1,"content":""},{"userImg":"http://img1.yulin520.com/news/OORYSCTJ8FR0O8YIWRS5.jpg#665_600","impressEditId":273,"impressType":0,"occupation":"","url":"http://www.yulin520.com/a2a/h5/impress/i1/273?a=1508909087667","createTime":1463122422000,"hxKey":"f60647b978f65d816e9c724aba3e5cf2","img":"http://img1.yulin520.com/news/OORYSCTJ8FR0O8YIWRS5.jpg#665_600","yulin":"78595","introduction":"89年处女座/善于制造气氛的开心宝/喜欢微胖妹子IT工程师","replyTimes":7,"remark":"","click":0,"topTime":1463127724000,"recommend":0,"userAge":26,"star":22,"title":"Lamy:我要承包微胖界的姑娘","source":0,"userName":"78595","reporter":0,"status":1,"content":""},{"userImg":"http://img1.yulin520.com/news/2OQ8I6HU8FR0OYTPWCW6.jpg#800_600","impressEditId":270,"impressType":0,"occupation":"人力资源","url":"http://www.yulin520.com/a2a/h5/impress/i1/270?a=1508909087667","createTime":1463022344000,"hxKey":"bb4400b8c5a060de84bf1737062732e0","img":"http://img1.yulin520.com/news/2OQ8I6HU8FR0OYTPWCW6.jpg#800_600","yulin":"78385","introduction":"92年双子座/可爱萌妹子/贤惠顾家","replyTimes":6,"remark":"","click":0,"topTime":1463022344000,"recommend":0,"userAge":24,"star":18,"title":"闵雪:从漫画里走出来的少女","source":0,"userName":"爱笑的酒窝","reporter":0,"status":1,"content":""},{"userImg":"http://img1.yulin520.com/news/UOQMP2A69FR0OB13NIVE.jpg#609_528","impressEditId":271,"impressType":0,"occupation":"金融","url":"http://www.yulin520.com/a2a/h5/impress/i1/271?a=1508909087667","createTime":1463037029000,"hxKey":"995b23ae0e2ef5126f910ed4fbafd26a","img":"http://img1.yulin520.com/news/UOQMP2A69FR0OB13NIVE.jpg#609_528","yulin":"77266","introduction":"84年金牛座/憨厚踏实/想开生态农场/金融客户经理","replyTimes":6,"remark":"","click":0,"topTime":1463041193000,"recommend":0,"userAge":32,"star":22,"title":"邓顺心:理想很独特的男人","source":0,"userName":"青山绿水","reporter":0,"status":1,"content":""},{"userImg":"http://img1.yulin520.com/news/VOPJFCOWDFR0OSJV62RH.jpg#800_575","impressEditId":268,"impressType":0,"occupation":"互联网","url":"http://www.yulin520.com/a2a/h5/impress/i1/268?a=1508909087667","createTime":1462938524000,"hxKey":"448da63713c6ec4c152eb8886c4ce48a","img":"http://img1.yulin520.com/news/VOPJFCOWDFR0OSJV62RH.jpg#800_575","yulin":"78466","introduction":"89年摩羯座/闷骚也是搞笑担当/泼辣性格是死敌/互联网总助","replyTimes":9,"remark":"","click":0,"topTime":1462960942000,"recommend":0,"userAge":27,"star":21,"title":"熊誉:闷骚而正直的大熊","source":0,"userName":"","reporter":0,"status":1,"content":""},{"userImg":"http://img1.yulin520.com/news/YOPAMFA1EFR0OTOL48X3.jpg#801_600","impressEditId":269,"impressType":0,"occupation":"培训","url":"http://www.yulin520.com/a2a/h5/impress/i1/269?a=1508909087667","createTime":1462952797000,"hxKey":"03c9d185be7f378107df5a60f1fbc6d0","img":"http://img1.yulin520.com/news/YOPAMFA1EFR0OTOL48X3.jpg#801_600","yulin":"78004","introduction":"89年天秤座/留短发随性爱自由/轻度颜控","replyTimes":6,"remark":"","click":0,"topTime":1462952822000,"recommend":0,"userAge":26,"star":8,"title":"珮珮:元气满格少女向前冲!","source":0,"userName":"珮珮","reporter":0,"status":1,"content":""},{"userImg":"http://img1.yulin520.com/news/KMBM2OHNLIO0OXN7P050.jpg#480_600","impressEditId":71,"impressType":0,"occupation":"计算机软件","url":"http://www.yulin520.com/a2a/h5/impress/i1/71?a=1508909087667","createTime":1456222671000,"hxKey":"47d0a3ef2759e26fc4d3b16c85072c16","img":"http://img1.yulin520.com/news/KMBM2OHNLIO0OXN7P050.jpg#480_600","yulin":"73261","introduction":"曾经的调皮小子/现在的踏实小伙/座右铭是积极努力\n","replyTimes":10,"remark":"","click":0,"topTime":1462931969000,"recommend":0,"userAge":25,"star":50,"title":"匡桂明:梦想很大,做乐观生活的程序员","source":0,"userName":"bruce","reporter":0,"status":1,"content":""}]
     * message : null
     */

    private int code;private boolean success;private int width;private int height;private Object message;private List<DataBean> data;public int getCode() {return code;}public void setCode(int code) {this.code = code;}public boolean isSuccess() {return success;}public void setSuccess(boolean success) {this.success = success;}public int getWidth() {return width;}public void setWidth(int width) {this.width = width;}public int getHeight() {return height;}public void setHeight(int height) {this.height = height;}public Object getMessage() {return message;}public void setMessage(Object message) {this.message = message;}public List<DataBean> getData() {return data;}public void setData(List<DataBean> data) {this.data = data;}public static class DataBean {/**
         * userImg : http://img1.yulin520.com/news/IO3X6ANK4AZ0O8D2DCBI.jpg#600_800
         * impressEditId : 234
         * impressType : 0
         * occupation : 互联网
         * url : http://www.yulin520.com/a2a/h5/impress/i1/234?a=1508909087667
         * createTime : 1461208285000
         * hxKey : 6d4e0008032fe0b0f4838ad4379a1469
         * img : http://img1.yulin520.com/news/IO3X6ANK4AZ0O8D2DCBI.jpg#600_800
         * yulin : 76558
         * introduction : 86年 狮子座/爱运动的技术男/梦想开健身会所/系统工程师
         * replyTimes : 13
         * remark :
         * click : 0
         * topTime : 1463394348000
         * recommend : 0
         * userAge : 30
         * star : 37
         * title : 陈泳青:健康是最有意义的追求
         * source : 0
         * userName : 阿青
         * reporter : 0
         * status : 1
         * content :
         */

        private String userImg;private int impressEditId;private int impressType;private String occupation;private String url;private long createTime;private String hxKey;private String img;private String yulin;private String introduction;private int replyTimes;private String remark;private int click;private long topTime;private int recommend;private int userAge;private int star;private String title;private int source;private String userName;private int reporter;private int status;private String content;public String getUserImg() {return userImg;}public void setUserImg(String userImg) {this.userImg = userImg;}public int getImpressEditId() {return impressEditId;}public void setImpressEditId(int impressEditId) {this.impressEditId = impressEditId;}public int getImpressType() {return impressType;}public void setImpressType(int impressType) {this.impressType = impressType;}public String getOccupation() {return occupation;}public void setOccupation(String occupation) {this.occupation = occupation;}public String getUrl() {return url;}public void setUrl(String url) {this.url = url;}public long getCreateTime() {return createTime;}public void setCreateTime(long createTime) {this.createTime = createTime;}public String getHxKey() {return hxKey;}public void setHxKey(String hxKey) {this.hxKey = hxKey;}public String getImg() {return img;}public void setImg(String img) {this.img = img;}public String getYulin() {return yulin;}public void setYulin(String yulin) {this.yulin = yulin;}public String getIntroduction() {return introduction;}public void setIntroduction(String introduction) {this.introduction = introduction;}public int getReplyTimes() {return replyTimes;}public void setReplyTimes(int replyTimes) {this.replyTimes = replyTimes;}public String getRemark() {return remark;}public void setRemark(String remark) {this.remark = remark;}public int getClick() {return click;}public void setClick(int click) {this.click = click;}public long getTopTime() {return topTime;}public void setTopTime(long topTime) {this.topTime = topTime;}public int getRecommend() {return recommend;}public void setRecommend(int recommend) {this.recommend = recommend;}public int getUserAge() {return userAge;}public void setUserAge(int userAge) {this.userAge = userAge;}public int getStar() {return star;}public void setStar(int star) {this.star = star;}public String getTitle() {return title;}public void setTitle(String title) {this.title = title;}public int getSource() {return source;}public void setSource(int source) {this.source = source;}public String getUserName() {return userName;}public void setUserName(String userName) {this.userName = userName;}public int getReporter() {return reporter;}public void setReporter(int reporter) {this.reporter = reporter;}public int getStatus() {return status;}public void setStatus(int status) {this.status = status;}public String getContent() {return content;}public void setContent(String content) {this.content = content;}}
}
微笑 微笑 微笑bean包下 Lv_data 类

public class Lv_data {private String name;private String url;public Lv_data(String name, String url) {this.name = name;this.url = url;}public String getName() {return name;}public void setName(String name) {this.name = name;}public String getUrl() {return url;}public void setUrl(String url) {this.url = url;}
}
微笑 微笑 微笑utils包下 ImageLoaderUtil 类

import android.content.Context;
import android.graphics.Bitmap;
import android.os.Environment;import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscCache;
import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer;
import com.samsung.sunfuliang10252.R;import java.io.File;public class ImageLoaderUtil {/**
     * ImageLoader的配置
     *
     * @param context
     */
    public static void initConfig(Context context) {//配置
//        File cacheFile=context.getExternalCacheDir();
        File cacheFile = new File(Environment.getExternalStorageDirectory() + "/" + "imgages");ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context).memoryCacheExtraOptions(480, 800)//缓存图片最大的长和宽
                .threadPoolSize(2)//线程池的数量
                .threadPriority(4).memoryCacheSize(2 * 1024 * 1024)//设置内存缓存区大小
                .diskCacheSize(20 * 1024 * 1024)//设置sd卡缓存区大小
                .diskCache(new UnlimitedDiscCache(cacheFile))//自定义缓存目录
                .writeDebugLogs()//打印日志内容
                .diskCacheFileNameGenerator(new Md5FileNameGenerator())//给缓存的文件名进行md5加密处理
                .build();ImageLoader.getInstance().init(config);}/**
     * 获取图片设置类
     *
     * @return
     */
    public static DisplayImageOptions getImageOptions() {DisplayImageOptions optionsoptions = new DisplayImageOptions.Builder().cacheInMemory(true)//使用内存缓存
                .cacheOnDisk(true)//使用磁盘缓存
                .bitmapConfig(Bitmap.Config.RGB_565)//设置图片格式
                .showImageOnLoading(R.mipmap.ic_launcher)//设置正在下载的图片
                .showImageForEmptyUri(R.mipmap.ic_launcher)//url为空或请求的资源不存在时
                .showImageOnFail(R.mipmap.ic_launcher)//下载失败时显示的图片
                .displayer(new RoundedBitmapDisplayer(20))//设置圆角,参数代表度数
                .build();return optionsoptions;}}
微笑 微笑 微笑utils包下 MyTask 类

import android.os.AsyncTask;import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;public class MyTask extends AsyncTask<String, Void, String> {//申请一个接口类对象
    private Icallbacks icallbacks;//将无参构造设置成私有的,使之在外部不能够调用
    private MyTask() {}//定义有参构造方法
    public MyTask(Icallbacks icallbacks) {this.icallbacks = icallbacks;}@Override
    protected String doInBackground(String... params) {String str = "";try {//使用HttpUrlConnection
            URL url = new URL(params[0]);HttpURLConnection connection = (HttpURLConnection) url.openConnection();connection.setRequestMethod("GET");connection.setReadTimeout(5000);connection.setConnectTimeout(5000);if (connection.getResponseCode() == 200) {InputStream inputStream = connection.getInputStream();//调用工具类中的静态方法
                str = StreamToString.streamToStr(inputStream, "utf-8");}} catch (Exception e) {e.printStackTrace();}return str;}@Override
    protected void onPostExecute(String s) {super.onPostExecute(s);//解析,封装到bean,更新ui组件
        icallbacks.updateUiByjson(s);}//定义一个接口
    public interface Icallbacks {/**
         * 根据回传的json字符串,解析并更新页面组件
         *
         * @param jsonstr
         */
        void updateUiByjson(String jsonstr);}
}
微笑 微笑 微笑utils包下 StreamToString 类

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;public class StreamToString {public static String streamToStr(InputStream inputStream, String chartSet) {StringBuilder builder = new StringBuilder();try {BufferedReader br = new BufferedReader(new InputStreamReader(inputStream, chartSet));String con;while ((con = br.readLine()) != null) {builder.append(con);}br.close();return builder.toString();} catch (Exception e) {e.printStackTrace();}return "";}
}
微笑 微笑 微笑fragments包下 Fr_FaXian 类

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;import com.samsung.sunfuliang10252.R;import java.util.ArrayList;
import java.util.List;import adapters.TabAdapter;public class Fr_FaXian extends Fragment {private TabLayout tab_layout;private ViewPager vp;private List<String> tab_list;private List<Fragment> list;@Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {View view = inflater.inflate(R.layout.fr_faxian, null);tab_layout = (TabLayout) view.findViewById(R.id.tab_layout);vp = (ViewPager) view.findViewById(R.id.vp);//设置导航栏
        initTab();return view;}@Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {vp.setAdapter(new TabAdapter(getChildFragmentManager(), tab_list, list));tab_layout.setupWithViewPager(vp);vp.setOffscreenPageLimit(list.size());super.onActivityCreated(savedInstanceState);}private void initTab() {tab_list = new ArrayList<>();tab_list.add("精选");tab_list.add("英伦风");tab_list.add("直播");tab_list.add("订阅");tab_list.add("视频购");tab_list.add("问答");list = new ArrayList<>();list.add(new Tab_JingXuan());list.add(new Tab_YingLunFeng());list.add(new Tab_ZhiBo());list.add(new Tab_DingYue());list.add(new Tab_ShiPinGou());list.add(new Tab_WenDa());}}
微笑 微笑 微笑fragments 包下 Fr_FenLei 类

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.ListView;
import android.widget.Toast;import com.google.gson.Gson;
import com.samsung.sunfuliang10252.R;import java.util.ArrayList;
import java.util.List;import adapters.FenLei_Gv;
import adapters.FenLei_lv;
import bean.FenLeiResult;
import bean.Lv_data;
import utils.MyTask;public class Fr_FenLei extends Fragment {private ListView lv_gl;private GridView gv_gl;private List<Lv_data> lv;@Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {View view = inflater.inflate(R.layout.fr_fenlei, null);lv_gl = (ListView) view.findViewById(R.id.lv_gl);gv_gl = (GridView) view.findViewById(R.id.gv_gl);return view;}private void setClickListener() {lv_gl.setOnItemClickListener(new AdapterView.OnItemClickListener() {@Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {Toast.makeText(getActivity(), "aaa" + lv.get(position).getName(), Toast.LENGTH_SHORT).show();MyTask myTask = new MyTask(new MyTask.Icallbacks() {@Override
                    public void updateUiByjson(String jsonstr) {Gson gson = new Gson();FenLeiResult fenLeiResult = gson.fromJson(jsonstr, FenLeiResult.class);List<FenLeiResult.DataBean> data = fenLeiResult.getData();gv_gl.setAdapter(new FenLei_Gv(data, getActivity()));}});myTask.execute(lv.get(position).getUrl());}});}private void setLvData() {lv = new ArrayList<>();lv.add(new Lv_data("箱包手袋", "http://www.yulin520.com/a2a/impressApi/news/mergeList?pageSize=10&page=1"));lv.add(new Lv_data("美妆个护", "http://www.yulin520.com/a2a/impressApi/news/mergeList?pageSize=10&page=2"));lv.add(new Lv_data("钟表珠宝", "http://www.yulin520.com/a2a/impressApi/news/mergeList?pageSize=10&page=3"));lv.add(new Lv_data("手机数码", "http://www.yulin520.com/a2a/impressApi/news/mergeList?pageSize=10&page=4"));lv.add(new Lv_data("电脑办公", "http://www.yulin520.com/a2a/impressApi/news/mergeList?pageSize=10&page=5"));lv.add(new Lv_data("家用电器", "http://www.yulin520.com/a2a/impressApi/news/mergeList?pageSize=10&page=6"));lv.add(new Lv_data("食品生鲜", "http://www.yulin520.com/a2a/impressApi/news/mergeList?pageSize=10&page=7"));lv.add(new Lv_data("酒水饮料", "http://www.yulin520.com/a2a/impressApi/news/mergeList?pageSize=10&page=8"));lv.add(new Lv_data("母婴套装", "http://www.yulin520.com/a2a/impressApi/news/mergeList?pageSize=10&page=9"));lv_gl.setAdapter(new FenLei_lv(lv, getActivity()));//条目点击监听
        setClickListener();}@Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {super.onActivityCreated(savedInstanceState);//lv
        setLvData();//默认加载数据

        MyTask myTask = new MyTask(new MyTask.Icallbacks() {@Override
            public void updateUiByjson(String jsonstr) {Gson gson = new Gson();FenLeiResult fenLeiResult = gson.fromJson(jsonstr, FenLeiResult.class);List<FenLeiResult.DataBean> data = fenLeiResult.getData();gv_gl.setAdapter(new FenLei_Gv(data, getActivity()));}});myTask.execute(lv.get(0).getUrl());}}
微笑 微笑 微笑fragments包下 Fr_GouWuChe 类

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;import com.samsung.sunfuliang10252.R;public class Fr_GouWuChe extends Fragment {@Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {View view = inflater.inflate(R.layout.fr_others, null);TextView name = (TextView) view.findViewById(R.id.name);name.setText("购物车");return view;}@Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {super.onActivityCreated(savedInstanceState);}}
微笑 微笑 微笑fragments包下 Fr_ShouYe 类

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ScrollView;import com.google.gson.Gson;
import com.handmark.pulltorefresh.library.ILoadingLayout;
import com.handmark.pulltorefresh.library.PullToRefreshBase;
import com.handmark.pulltorefresh.library.PullToRefreshScrollView;
import com.samsung.sunfuliang10252.MyGridView;
import com.samsung.sunfuliang10252.R;import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;import adapters.GvAdapter;
import bean.FaXianResult;
import utils.MyTask;public class Fr_ShouYe extends Fragment {private MyGridView gv;//    private Banner banner;
    private int index = 1;private Handler myHandler = new Handler();private PullToRefreshScrollView ptr_sv;private GvAdapter adapter;private List<FaXianResult.DataBean> list = new ArrayList<>();private ImageView image_head;private int flag = 0;private Handler handler = new Handler() {@Override
        public void handleMessage(Message msg) {if (msg.what == 0) {flag++;image_head.setImageBitmap(listBitMap.get(flag % 3));handler.sendEmptyMessageDelayed(0, 2000);}}};private List<String> listUrl;private List<Bitmap> listBitMap;@Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {View view = inflater.inflate(R.layout.fr_shouye, null);//加载控件
//        banner = (Banner) view.findViewById(R.id.banner);
        gv = (MyGridView) view.findViewById(R.id.gv);image_head = (ImageView) view.findViewById(R.id.image_head);ptr_sv = (PullToRefreshScrollView) view.findViewById(R.id.ptr_sv);return view;}@Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {super.onActivityCreated(savedInstanceState);//加载数据
        setNetData();//设置刷新加载
        setPtrSv();//头部图片轮播
        setImage();}private void setImage() {listUrl = new ArrayList<>();listUrl.add("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1508922133068&di=9f3bd42f0ff4dd9dddf61d435abd0304&imgtype=0&src=http%3A%2F%2Fe.hiphotos.baidu.com%2Fimage%2Fpic%2Fitem%2Fa8014c086e061d954ed6d05571f40ad163d9cacf.jpg");listUrl.add("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1508922131631&di=6013b7f1133419be1aa31310a0ce3bda&imgtype=0&src=http%3A%2F%2Fa.hiphotos.baidu.com%2Fimage%2Fpic%2Fitem%2F8d5494eef01f3a29956634a39325bc315c607c35.jpg");listUrl.add("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1508922131630&di=5d3dc8042346a659c7b92680ee28ad2f&imgtype=0&src=http%3A%2F%2Fc.hiphotos.baidu.com%2Fimage%2Fpic%2Fitem%2F1b4c510fd9f9d72a12a2f670de2a2834359bbb9d.jpg");new Thread() {@Override
            public void run() {listBitMap = new ArrayList<>();for (int i = 0; i < 3; i++) {Bitmap bitmap = makeImage(listUrl.get(i));listBitMap.add(bitmap);}handler.sendEmptyMessageDelayed(0, 1000);}}.start();}private Bitmap makeImage(String u) {try {URL url = new URL(u);HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();urlConnection.setRequestMethod("GET");urlConnection.setReadTimeout(3000);urlConnection.setConnectTimeout(3000);if (urlConnection.getResponseCode() == 200) {InputStream inputStream = urlConnection.getInputStream();Bitmap bitmap = BitmapFactory.decodeStream(inputStream);return bitmap;}} catch (Exception e) {e.printStackTrace();}return null;};private void setNetData() {MyTask mytask = new MyTask(new MyTask.Icallbacks() {@Override
            public void updateUiByjson(String jsonstr) {Gson gson = new Gson();FaXianResult faXianResult = gson.fromJson(jsonstr, FaXianResult.class);List<FaXianResult.DataBean> data = faXianResult.getData();list.addAll(data);setAdapter();}});mytask.execute("http://www.yulin520.com/a2a/impressApi/news/mergeList?pageSize=10&page=1");}//设置适配器
    private void setAdapter() {if (adapter == null) {adapter = new GvAdapter(list, getActivity());gv.setAdapter(adapter);} else {adapter.notifyDataSetChanged();}}//记载数据
    private void addtoBottom() {index++;MyTask mytask = new MyTask(new MyTask.Icallbacks() {@Override
            public void updateUiByjson(String jsonstr) {Gson gson = new Gson();FaXianResult faXianResult = gson.fromJson(jsonstr, FaXianResult.class);List<FaXianResult.DataBean> data = faXianResult.getData();list.addAll(data);setAdapter();}});mytask.execute("http://www.yulin520.com/a2a/impressApi/news/mergeList?pageSize=10&page=" + index);}//刷新数据
    private void addtoTop() {list.clear();setNetData();}private void setPtrSv() {//同时支持上拉加载下拉刷新
        ptr_sv.setMode(PullToRefreshBase.Mode.BOTH);//配置刷新的设置
        ILoadingLayout startLabels = ptr_sv.getLoadingLayoutProxy(true, false);startLabels.setPullLabel("下拉刷新");startLabels.setRefreshingLabel("正在拉");startLabels.setReleaseLabel("放开刷新");ILoadingLayout endLabels = ptr_sv.getLoadingLayoutProxy(false, true);endLabels.setPullLabel("上拉刷新");endLabels.setRefreshingLabel("正在载入...");endLabels.setReleaseLabel("放开刷新...");//刷新监听
        ptr_sv.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ScrollView>() {@Override
            public void onPullDownToRefresh(PullToRefreshBase<ScrollView> refreshView) {addtoTop();myHandler.postDelayed(new Runnable() {@Override
                    public void run() {//刷新完成,必须在异步下完成
                        ptr_sv.onRefreshComplete();}}, 2000);}@Override
            public void onPullUpToRefresh(PullToRefreshBase<ScrollView> refreshView) {//加载更多的数据,添加到集合列表的最后面
                addtoBottom();myHandler.postDelayed(new Runnable() {@Override
                    public void run() {//刷新完成,必须在异步下完成
                        ptr_sv.onRefreshComplete();}}, 2000);}});}}
微笑 微笑 微笑fragments包下 Fr_WoDe 类

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;import com.samsung.sunfuliang10252.R;public class Fr_WoDe extends Fragment {@Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {View view = inflater.inflate(R.layout.fr_others, null);TextView name = (TextView) view.findViewById(R.id.name);name.setText("我的");return view;}@Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {super.onActivityCreated(savedInstanceState);}}
微笑 微笑 微笑fragments包下 Tab_DingYue 类

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;import com.samsung.sunfuliang10252.R;public class Tab_DingYue extends Fragment {@Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {View view = inflater.inflate(R.layout.tab_others, null);TextView name = (TextView) view.findViewById(R.id.name);name.setText("订阅");return view;}@Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {super.onActivityCreated(savedInstanceState);}}
微笑 微笑 微笑fragments包下 Tab_JingXuan 类

import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;import com.google.gson.Gson;
import com.handmark.pulltorefresh.library.ILoadingLayout;
import com.handmark.pulltorefresh.library.PullToRefreshBase;
import com.handmark.pulltorefresh.library.PullToRefreshListView;
import com.samsung.sunfuliang10252.R;import java.util.ArrayList;
import java.util.List;import adapters.LvAdapter;
import bean.FaXianResult;
import utils.MyTask;public class Tab_JingXuan extends Fragment {private PullToRefreshListView ptr_lv;private Handler myHandler = new Handler();private LvAdapter adapter;private List<FaXianResult.DataBean> list = new ArrayList<>();private int index = 1;@Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {View view = inflater.inflate(R.layout.tab_jingxuan, null);ptr_lv = (PullToRefreshListView) view.findViewById(R.id.ptr_lv);return view;}@Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {super.onActivityCreated(savedInstanceState);//初始化数据
        setNetData();//设置刷新加载
        setPtrLv();}private void setNetData() {MyTask mytask = new MyTask(new MyTask.Icallbacks() {@Override
            public void updateUiByjson(String jsonstr) {Gson gson = new Gson();FaXianResult faXianResult = gson.fromJson(jsonstr, FaXianResult.class);List<FaXianResult.DataBean> data = faXianResult.getData();list.addAll(data);setAdapter();}});mytask.execute("http://www.yulin520.com/a2a/impressApi/news/mergeList?pageSize=10&page=1");}private void setAdapter() {if (adapter == null) {adapter = new LvAdapter(list, getActivity());ptr_lv.setAdapter(adapter);} else {adapter.notifyDataSetChanged();}}private void addtoTop() {list.clear();setNetData();}private void addtoBottom() {index++;MyTask mytask = new MyTask(new MyTask.Icallbacks() {@Override
            public void updateUiByjson(String jsonstr) {Gson gson = new Gson();FaXianResult faXianResult = gson.fromJson(jsonstr, FaXianResult.class);List<FaXianResult.DataBean> data = faXianResult.getData();list.addAll(data);setAdapter();}});mytask.execute("http://www.yulin520.com/a2a/impressApi/news/mergeList?pageSize=10&page=" + index);}private void setPtrLv() {ptr_lv.setMode(PullToRefreshBase.Mode.BOTH);//配置刷新的设置
        ILoadingLayout startLabels = ptr_lv.getLoadingLayoutProxy(true, false);startLabels.setPullLabel("下拉刷新");startLabels.setRefreshingLabel("正在拉");startLabels.setReleaseLabel("放开刷新");ILoadingLayout endLabels = ptr_lv.getLoadingLayoutProxy(false, true);endLabels.setPullLabel("上拉刷新");endLabels.setRefreshingLabel("正在载入...");endLabels.setReleaseLabel("放开刷新...");//设置刷新的监听
        ptr_lv.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ListView>() {@Override
            public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {//下拉刷新的回调
                //下拉刷新的数据,显示在listview列表的最上面
                addtoTop();myHandler.postDelayed(new Runnable() {@Override
                    public void run() {//刷新完成,必须在异步下完成
                        ptr_lv.onRefreshComplete();}}, 1000);}@Override
            public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {//上拉加载的回调
                //加载更多的数据,添加到集合列表的最后面
                addtoBottom();myHandler.postDelayed(new Runnable() {@Override
                    public void run() {//刷新完成,必须在异步下完成
                        ptr_lv.onRefreshComplete();}}, 1000);}});}}
微笑 微笑 微笑fragments包下 Tab_ShiPinGou 类

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;import com.samsung.sunfuliang10252.R;public class Tab_ShiPinGou extends Fragment {@Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {View view = inflater.inflate(R.layout.tab_others, null);TextView name = (TextView) view.findViewById(R.id.name);name.setText("视频购");return view;}@Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {super.onActivityCreated(savedInstanceState);}}
微笑 微笑 微笑fragments包下 Tab_WenDa 类

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;import com.samsung.sunfuliang10252.R;public class Tab_WenDa extends Fragment {@Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {View view = inflater.inflate(R.layout.tab_others, null);TextView name = (TextView) view.findViewById(R.id.name);name.setText("问答");return view;}@Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {super.onActivityCreated(savedInstanceState);}}
微笑 微笑 微笑fragments包下 Tab_YingLunFeng 类

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;import com.samsung.sunfuliang10252.R;public class Tab_YingLunFeng extends Fragment {@Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {View view = inflater.inflate(R.layout.tab_others, null);TextView name = (TextView) view.findViewById(R.id.name);name.setText("英伦风");return view;}@Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {super.onActivityCreated(savedInstanceState);}}
微笑 微笑 微笑fragments包下 Tab_ZhiBo 类

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;import com.samsung.sunfuliang10252.R;public class Tab_ZhiBo extends Fragment {@Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {View view = inflater.inflate(R.layout.tab_others, null);TextView name = (TextView) view.findViewById(R.id.name);name.setText("直播");return view;}@Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {super.onActivityCreated(savedInstanceState);}}


http://www.ppmy.cn/news/338459.html

相关文章

cute-cnblogs 自定义博客园样式美化二期来啦~

cute-cnblogs 自定义博客园样式美化二期来啦~ 说明 cute-cnblogs 可爱的博客园样式美化、自定义博客园样式 二期样式已经编写完毕了&#xff0c;如果说 一期样式 给人的感觉是简洁清爽的小婴儿的话&#xff0c;那么 二期样式 就是一个有自己小个性&#xff08;花样&#xff09;…

Spring框架学习笔记来啦

1、简介 Spring框架是一个开放源代码的 J2EE 应用程序框架&#xff0c;由 Rod Johnson 发起&#xff0c;是针对bean的生命周期进行管理的轻量级容器&#xff08;lightweight container&#xff09;。 1.1 Spring框架主要由七部分组成&#xff1a; Spring CoreSpring AOPSpri…

abb机器人指令手册_ABB机器人可以告别示教器啦

更多内容请点击上方 ABB机器人实战技巧 关注 也可点击公众号下方 往期经典 浏览更多内容 转载请先后台留言,大家一起支持原创,推动机器人使用和发展 本公众号对各类ABB机器人应用,仿真,毕业设计提供技术支持,详细后台留言 本公众号诚挚希望与各机器人培训机构,机器人使用…

终于把所有的 Python 库都整理出来啦

点上方“菜鸟学Python”&#xff0c;选择“星标” 482篇原创干货&#xff0c;第一时间送达来源丨法纳 常用库 Chardet字符编码探测器&#xff0c;可以自动检测文本、网页、xml的编码。 colorama主要用来给文本添加各种颜色&#xff0c;并且非常简单易用。 Prettytable主要用于在…

太爽啦!用VS Code直接浏览GitHub代码!

金磊 发自 凹非寺 量子位 报道 | 公众号 QbitAI “看GitHub代码”这件事上&#xff0c;还在网页上点点点&#xff1f; 用开发工具看代码&#xff0c;不香吗&#xff1f; 于是&#xff0c;它来了&#xff0c;它来了——可以直接用VS Code方式打开GitHub代码的工具。 而且在短短几…

turicreate 视频_iOS 推出的turiCreate功能(一) 图片识别

前序文章:让我们谈谈turiCreate.聊聊iOS的机器学习这篇文章有讲到如何布置环境,以及turiCreate的基本功能块. 概括 对于这个功能来说.我第一实现试用的时候 很惊讶!准度非常高!效果也是非常不错的.随着我深入,发现他的问题也还是挺大的.他不是多标签的.不能像苹果提供CoreML模型…

Java利用freemarker导出带有图片的word文档

1.使用Microsoft Office Word编辑word模板&#xff0c;把需要动态修改的内容替换成${xxxxxx}&#xff0c;如果有图片&#xff0c;尽量选择较小的图片几十K左右&#xff0c;并调整好位置及大小 图1 模板示例 注意&#xff1a; 1.变量需要使用${}&#xff0c;例如&#xff1a;$…

GAN生成哆啦A梦,亲测训练50000epoch

** GAN生成哆啦A梦&#xff0c;亲测训练50000epoch ** 闲着没事学了一下GAN网络&#xff0c;感觉这个东西挺有趣的&#xff0c;所以就打算跟大家分享一下这个东西&#xff0c;其中的原理就不用跟大家说了&#xff0c;因为现在其他的博客介绍原理都很全面&#xff0c;大家可以…