安卓图片轮播abslidingplayview自动无限轮播怎么实现

Android auto-scroll-view-pager 自动滚动 轮播循环的 - UISource
15,788 浏览
一个自动滚动,轮播循环视图组件。
(1) 引入公共库
引入 Auto Scroll ViewPager@Github作为你项目的library(如何拉取代码及添加公共库)。
仅需简单两步:
a. 布局定义
&cn.trinea.android.view.autoscrollviewpager.AutoScrollViewPager
& & android:id=&@+id/view_pager&
& & android:layout_width=&match_parent&
& & android:layout_height=&wrap_content& /&
代替一般的ViewPager定义
b. 启动ViewPager自动滚动
startAutoScroll() 启动自动滚动
stopAutoScroll() 停止自动滚动
setInterval(long) 设置自动滚动的间隔时间,单位为毫秒
setDirection(int) 设置自动滚动的方向,默认向右
setCycle(boolean) 是否自动循环轮播,默认为true
setScrollDurationFactor(double) 设置ViewPager滑动动画间隔时间的倍率,达到减慢动画或改变动画速度的效果
setStopScrollWhenTouch(boolean) 当手指碰到ViewPager时是否停止自动滚动,默认为true
setSlideBorderMode(int) 滑动到第一个或最后一个Item的处理方式,支持没有任何操作、轮播以及传递到父View三种模式
setBorderAnimation(boolean) 设置循环滚动时滑动到从边缘滚动到下一个是否需要动画,默认为true
(1) 指示器,圆形或是方形指示器请配合ViewPagerIndicator使用
(2)无限循环,如果希望在最后一张继续播放第一张而不是退回到第一张,请参考AutoScrollViewPagerSingleDemo.java,注意这个特性不能和 ViewPagerIndicator 使用。
Android auto scroll viewpager or viewpager in viewpager
我也不知道怎么回事,刚上场我说做PHP的,女嘉宾把灯全灭了。修复了AbSlidingPlayView滑动BUG - 下载频道
- CSDN.NET
&&&&修复了AbSlidingPlayView滑动BUG
修复了AbSlidingPlayView滑动BUG
修复了AbSlidingPlayView嵌套所有组件滑动失败的错误,修正了点击失效的错误,这个修复我研究了好久啊。
若举报审核通过,可奖励20下载分
被举报人:
yoyo_newbie
举报的资源分:
请选择类型
资源无法下载
资源无法使用
标题与实际内容不符
含有危害国家安全内容
含有反动色情等内容
含广告内容
版权问题,侵犯个人或公司的版权
*详细原因:
您可能还需要
移动开发下载排行org.eclipse.core.resources.prefs
org.eclipse.jdt.core.prefs
play_display.png
play_hide.png
mytaobaotest
android-support-v4.jar
cu_volley.jar
cu_push_left_in.xml
cu_push_left_out.xml
cu_push_right_in.xml
cu_push_right_out.xml
down_in.xml
pop_down_out.xml
pop_up_in.xml
up_out.xml
bt_menu_0_select.xml
bt_menu_1_select.xml
bt_menu_2_select.xml
bt_menu_3_select.xml
bt_menu_4_select.xml
holder_bg.xml
yuanjiao.xml
yuanjiao_choice.xml
yuanjiao_red.xml
zhijiao.xml
zhijiao_gray.xml
drawable-hdpi
bg_edit_ware.png
bg_menu_edit.png
buy_now.png
del_icon_normal.png
detail_show_1.png
detail_show_2.png
detail_show_3.png
detail_show_4.png
detail_show_5.png
detail_show_6.png
ic_launcher.png
menu_1.png
menu_1_0.png
menu_1_1.png
menu_1_2.png
menu_1_3.png
menu_2.png
menu_2_1.png
menu_2_2.png
menu_2_3.png
menu_2_4.png
menu_2_5.png
menu_3.png
menu_4.png
menu_5.png
menu_6.png
menu_7.png
menu_top_left.png
menu_top_right.png
put_in.png
second_1.png
second_2.png
second_2_collection.png
show_m1.png
tao_user_2.png
tb_icon_actionbar_more.png
user_1.png
user_10.png
user_2.png
user_3.png
user_4.png
user_5.png
user_6.png
user_7.png
user_8.png
user_9.png
xlistview_arrow.png
drawable-mdpi
ic_launcher.png
second_2.png
second_2_collection.png
drawable-xhdpi
abc_ic_clear_disabled.png
abc_ic_clear_search_api_holo_light.png
arrow_expend_right.png
find_1.png
find_2.png
find_3.png
find_4.png
find_5.png
find_g_1.png
find_g_2.png
find_g_3.png
find_g_4.png
find_g_5.png
find_g_6.png
find_g_7.png
find_g_8.png
guide_account_nm.png
guide_account_on.png
guide_cart_nm.png
guide_cart_on.png
guide_discover_nm.png
guide_discover_on.png
guide_home_nm.png
guide_home_on.png
guide_tfaccount_nm.png
guide_tfaccount_on.png
ic_launcher.png
menu_guide_1.png
menu_guide_2.png
menu_guide_3.png
menu_guide_4.png
menu_guide_5.png
menu_guide_6.png
menu_guide_7.png
menu_guide_8.png
menu_viewpager_1.png
menu_viewpager_2.png
menu_viewpager_3.png
menu_viewpager_4.png
menu_viewpager_5.png
second_2.png
second_2_collection.png
tb_icon_actionbar_back.png
tb_icon_actionbar_refresh_48.png
tb_icon_actionbar_setting_48.png
tb_icon_more_msg_56.png
user_life.png
drawable-xxhdpi
ic_launcher.png
adapter_grid_home.xml
adapter_grid_hot_home.xml
adapter_listview_cart.xml
adapter_listview_detail.xml
adapter_listview_tao.xml
adapter_listview_ware.xml
adapter_popwindow.xml
babydetail_a.xml
buy_now_a.xml
capture.xml
cart_all_f.xml
cart_f.xml
cart_low_f.xml
cart_stock_f.xml
dicover_f.xml
hellosener.xml
home_f.xml
main_fa.xml
pic_item.xml
scale_pic_item.xml
sc_gridview_item.xml
show_big_pictrue_a.xml
slide_view_merge.xml
top_menu.xml
top_menu_back.xml
top_menu_txt.xml
upload_a.xml
user_f.xml
user_life.xml
user_opinion.xml
ware_a.xml
xlistview_footer.xml
xlistview_header.xml
realm_properties
colors.xml
dimens.xml
strings.xml
styles.xml
.classpath
AndroidManifest.xml
ic_launcher-web.png
proguard-project.txt
project.properties
package com.javis.A
import java.util.ArrayL
import java.util.HashM
import com.jarvis.mytaobaotest.R;
import android.content.C
import android.view.LayoutI
import android.view.V
import android.view.ViewG
import android.widget.BaseA
import android.widget.ImageV
import android.widget.TextV
public class Adapter_ListView_user extends BaseAdapter {
@SuppressWarnings(&unused&)
private ArrayList&HashMap&String, Object&& arrayL
@SuppressWarnings(&unchecked&)
public Adapter_ListView_user(Context context,HashMap&String, Object& hashmap){
this.context=
this.arrayList=(ArrayList&HashMap&String, Object&&) hashmap.get(&data&);
public Adapter_ListView_user(Context context){
this.context=
public int getCount() {
return 10;
public Object getItem(int arg0) {
public long getItemId(int arg0) {
public View getView(int position, View currentView, ViewGroup arg2) {
HolderView holderView=
if (currentView==null) {
holderView=new HolderView();
currentView=LayoutInflater.from(context).inflate(R.layout.adapter_listview_detail, null);
holderView.iv_pic=(ImageView) currentView.findViewById(R.id.iv_adapter_list_pic);
holderView.tv_name=(TextView) currentView.findViewById(R.id.name);
holderView.tv_price=(TextView) currentView.findViewById(R.id.price);
holderView.tv_sale_num=(TextView) currentView.findViewById(R.id.sale_num);
currentView.setTag(holderView);
holderView=(HolderView) currentView.getTag();
ImageListener listener= ImageLoader.getImageListener(holderView.iv_pic, R.drawable.ic_launcher,
R.drawable.ic_launcher);
CU_VolleyTool.getInstance(context).getmImageLoader().get(&http://192.168.0.111:3000/taoBao/img/&+arrayList.get(position).get(&pic&), listener);
holderView.tv_name.setText(arrayList.get(position).get(&name&).toString());
holderView.tv_price.setText(&¥&+arrayList.get(position).get(&price&).toString()+&元&);
holderView.tv_sale_num.setText(&月销量:&+arrayList.get(position).get(&sale_num&).toString()+&件
&+arrayList.get(position).get(&address&).toString());
return currentV
@SuppressWarnings(&unused&)
public class HolderView {
private ImageView iv_
private TextView tv_sale_
private TextView tv_
private TextView tv_
Copyright(C)
OKBASE.NET All Rights Reserved 好库网 版权所有org.eclipse.core.resources.prefs
org.eclipse.jdt.core.prefs
play_display.png
play_hide.png
mytaobaotest
android-support-v4.jar
cu_volley.jar
cu_push_left_in.xml
cu_push_left_out.xml
cu_push_right_in.xml
cu_push_right_out.xml
down_in.xml
pop_down_out.xml
pop_up_in.xml
up_out.xml
bt_menu_0_select.xml
bt_menu_1_select.xml
bt_menu_2_select.xml
bt_menu_3_select.xml
bt_menu_4_select.xml
holder_bg.xml
yuanjiao.xml
yuanjiao_choice.xml
yuanjiao_red.xml
zhijiao.xml
zhijiao_gray.xml
drawable-hdpi
bg_edit_ware.png
bg_menu_edit.png
buy_now.png
del_icon_normal.png
detail_show_1.png
detail_show_2.png
detail_show_3.png
detail_show_4.png
detail_show_5.png
detail_show_6.png
ic_launcher.png
menu_1.png
menu_1_0.png
menu_1_1.png
menu_1_2.png
menu_1_3.png
menu_2.png
menu_2_1.png
menu_2_2.png
menu_2_3.png
menu_2_4.png
menu_2_5.png
menu_3.png
menu_4.png
menu_5.png
menu_6.png
menu_7.png
menu_top_left.png
menu_top_right.png
put_in.png
second_1.png
second_2.png
second_2_collection.png
show_m1.png
tao_user_2.png
tb_icon_actionbar_more.png
user_1.png
user_10.png
user_2.png
user_3.png
user_4.png
user_5.png
user_6.png
user_7.png
user_8.png
user_9.png
xlistview_arrow.png
drawable-mdpi
ic_launcher.png
second_2.png
second_2_collection.png
drawable-xhdpi
abc_ic_clear_disabled.png
abc_ic_clear_search_api_holo_light.png
arrow_expend_right.png
find_1.png
find_2.png
find_3.png
find_4.png
find_5.png
find_g_1.png
find_g_2.png
find_g_3.png
find_g_4.png
find_g_5.png
find_g_6.png
find_g_7.png
find_g_8.png
guide_account_nm.png
guide_account_on.png
guide_cart_nm.png
guide_cart_on.png
guide_discover_nm.png
guide_discover_on.png
guide_home_nm.png
guide_home_on.png
guide_tfaccount_nm.png
guide_tfaccount_on.png
ic_launcher.png
menu_guide_1.png
menu_guide_2.png
menu_guide_3.png
menu_guide_4.png
menu_guide_5.png
menu_guide_6.png
menu_guide_7.png
menu_guide_8.png
menu_viewpager_1.png
menu_viewpager_2.png
menu_viewpager_3.png
menu_viewpager_4.png
menu_viewpager_5.png
second_2.png
second_2_collection.png
tb_icon_actionbar_back.png
tb_icon_actionbar_refresh_48.png
tb_icon_actionbar_setting_48.png
tb_icon_more_msg_56.png
user_life.png
drawable-xxhdpi
ic_launcher.png
adapter_grid_home.xml
adapter_grid_hot_home.xml
adapter_listview_cart.xml
adapter_listview_detail.xml
adapter_listview_tao.xml
adapter_listview_ware.xml
adapter_popwindow.xml
babydetail_a.xml
buy_now_a.xml
capture.xml
cart_all_f.xml
cart_f.xml
cart_low_f.xml
cart_stock_f.xml
dicover_f.xml
hellosener.xml
home_f.xml
main_fa.xml
pic_item.xml
scale_pic_item.xml
sc_gridview_item.xml
show_big_pictrue_a.xml
slide_view_merge.xml
top_menu.xml
top_menu_back.xml
top_menu_txt.xml
upload_a.xml
user_f.xml
user_life.xml
user_opinion.xml
ware_a.xml
xlistview_footer.xml
xlistview_header.xml
realm_properties
colors.xml
dimens.xml
strings.xml
styles.xml
.classpath
AndroidManifest.xml
ic_launcher-web.png
proguard-project.txt
project.properties
* Copyright (C) 2010 ZXing authors
* Licensed under the Apache License, Version 2.0 (the &License&);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an &AS IS& BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
package com.zxing.
import android.os.IB
import android.util.L
import java.lang.reflect.InvocationTargetE
import java.lang.reflect.M
* This class is used to activate the weak light on some camera phones (not flash)
* in order to illuminate surfaces for scanning. There is no official way to do this,
* but, classes which allow access to this function still exist on some devices.
* This therefore proceeds through a great deal of reflection.
* See &a href=&//changing-the-screen-brightness-programatically/&&
* //changing-the-screen-brightness-programatically/&/a& and
* &a href=&/p/droidled/source/browse/trunk/src/com/droidled/demo/DroidLED.java&&
* /p/droidled/source/browse/trunk/src/com/droidled/demo/DroidLED.java&/a&.
* Thanks to Ryan Alford for pointing out the availability of this class.
final class FlashlightManager {
private static final String TAG = FlashlightManager.class.getSimpleName();
private static final Object iHardwareS
private static final Method setFlashEnabledM
iHardwareService = getHardwareService();
setFlashEnabledMethod = getSetFlashEnabledMethod(iHardwareService);
if (iHardwareService == null) {
Log.v(TAG, &This device does supports control of a flashlight&);
Log.v(TAG, &This device does not support control of a flashlight&);
private FlashlightManager() {
* 控制相机闪光灯开关
static void enableFlashlight() {
setFlashlight(false);
static void disableFlashlight() {
setFlashlight(false);
private static Object getHardwareService() {
Class&?& serviceManagerClass = maybeForName(&android.os.ServiceManager&);
if (serviceManagerClass == null) {
Method getServiceMethod = maybeGetMethod(serviceManagerClass, &getService&, String.class);
if (getServiceMethod == null) {
Object hardwareService = invoke(getServiceMethod, null, &hardware&);
if (hardwareService == null) {
Class&?& iHardwareServiceStubClass = maybeForName(&android.os.IHardwareService$Stub&);
if (iHardwareServiceStubClass == null) {
Method asInterfaceMethod = maybeGetMethod(iHardwareServiceStubClass, &asInterface&, IBinder.class);
if (asInterfaceMethod == null) {
return invoke(asInterfaceMethod, null, hardwareService);
private static Method getSetFlashEnabledMethod(Object iHardwareService) {
if (iHardwareService == null) {
Class&?& proxyClass = iHardwareService.getClass();
return maybeGetMethod(proxyClass, &setFlashlightEnabled&, boolean.class);
private static Class&?& maybeForName(String name) {
return Class.forName(name);
} catch (ClassNotFoundException cnfe) {
} catch (RuntimeException re) {
Log.w(TAG, &Unexpected error while finding class & + name, re);
private static Method maybeGetMethod(Class&?& clazz, String name, Class&?&... argClasses) {
return clazz.getMethod(name, argClasses);
} catch (NoSuchMethodException nsme) {
} catch (RuntimeException re) {
Log.w(TAG, &Unexpected error while finding method & + name, re);
private static Object invoke(Method method, Object instance, Object... args) {
return method.invoke(instance, args);
} catch (IllegalAccessException e) {
Log.w(TAG, &Unexpected error while invoking & + method, e);
} catch (InvocationTargetException e) {
Log.w(TAG, &Unexpected error while invoking & + method, e.getCause());
} catch (RuntimeException re) {
Log.w(TAG, &Unexpected error while invoking & + method, re);
private static void setFlashlight(boolean active) {
if (iHardwareService != null) {
invoke(setFlashEnabledMethod, iHardwareService, active);
Copyright(C)
OKBASE.NET All Rights Reserved 好库网 版权所有

我要回帖

更多关于 安卓首页广告轮播 的文章

 

随机推荐