android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_marginTop=“10dip”
android:layout_gravity=“bottom|center_horizontal”
android:layout_marginBottom=“10dp”
android:gravity=“center” >
<View
android:id=“@+id/v_dot0”
style=“@style/dot_style”
android:background=“@drawable/dot_focused”
android:visibility=“invisible” />
<View
android:id=“@+id/v_dot1”
style=“@style/dot_style”
android:visibility=“invisible”/>
<View
android:id=“@+id/v_dot2”
style=“@style/dot_style”
android:visibility=“invisible”/>
<View
android:id=“@+id/v_dot3”
style=“@style/dot_style”
android:visibility=“invisible”/>
<View
android:id=“@+id/v_dot4”
style=“@style/dot_style”
android:visibility=“invisible” />
一个ViewPager,下面五个指示点,注意每个点都有同样的样式,我们在style.xml中定义样式:
/BannerAutoScrollDemo/res/values/styles.xml
定义圆点图形资源
/BannerAutoScrollDemo/res/drawable/dot_normal.xml
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android=“http://schemas.android.com/apk/res/android”
android:shape=“oval” >
/BannerAutoScrollDemo/res/drawable/dot_focused.xml
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android=“http://schemas.android.com/apk/res/android”
android:shape=“oval” >
定义广告实体
/BannerAutoScrollDemo/src/com/xiaowu/banner/demo/AdDomain.java
package com.xiaowu.banner.demo;
/**
-
广告实体
-
@author wwj_748
*/
public class AdDomain {
private String id; // 广告id
private String date; // 日期
private String title; // 标题
private String topicFrom; //选题来自
private String topic; // 选题
private String imgUrl; // 图片url
private boolean isAd; // 是否为广告
private String startTime; // 广告开始时间
private String endTime; // 广告结束时间
private String targetUrl; // 目标url
private int width; // 宽
private int height; // 高
private boolean available; // 是否可用
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getImgUrl() {
return imgUrl;
}
public void setImgUrl(String