资源简介
从服务器拿到URL然后显示到app上自动轮播
代码片段和文件信息
package com.zls.goldbao.views;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Handler;
import android.os.Message;
import android.os.Parcelable;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.frameLayout;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.LinearLayout;
import android.widget.Toast;
import com.lidroid.xutils.HttpUtils;
import com.lidroid.xutils.exception.HttpException;
import com.lidroid.xutils.http.RequestParams;
import com.lidroid.xutils.http.ResponseInfo;
import com.lidroid.xutils.http.callback.RequestCallBack;
import com.lidroid.xutils.http.client.HttpRequest;
import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.core.assist.QueueProcessingType;
import com.zls.goldbao.R;
import com.zls.goldbao.utils.Content;
import com.zls.goldbao.utils.L;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONobject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
public class SlideShowView extends frameLayout {
private static final String TAG = SlideShowView.class.getSimpleName();
private ImageLoader imageLoader = ImageLoader.getInstance();
private final static int TIME_INTERVAL = 5;
private final static boolean isAutoPlay = true;
private List imageUrls;
private List imageContentUrls;
private List imageViewsList;
private List dotViewsList;
private Context context;
private ViewPager viewPager;
private int currentItem = 0;
private ScheduledExecutorService scheduledExecutorService;
private Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
// TODO Auto-generated method stub
super.handleMessage(msg);
viewPager.setCurrentItem(currentItem);
}
};
public SlideShowView(Context context) {
this(context null);
// TODO Auto-generated constructor stub
}
public SlideShowView(Context context AttributeSet attrs) {
this(context attrs 0);
// TODO Auto-generated constructor stub
}
public SlideShowView(Context context AttributeSet attrs int defstyle) {
super(context attrs defstyle);
this.con
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 11279 2015-11-03 16:23 SlideShowView.java
文件 8952 2015-10-08 10:08 SlideShowView注释.java
----------- --------- ---------- ----- ----
20231 2
评论
共有 条评论