Loop3DRotation-master

Introduction: Android 3d 动画旋转
More: Author   ReportBugs   OfficialWebsite   
Tags:
3D-

image

介绍

*1. 3d 旋转 可以无限循环,自动旋转,停靠的 3D 旋转布局控件,无需编写代码,直接在布局中加入自己的布局即可。 控件继承相对布局 RelativeLayout 直接可以当做布局使用。

*2.支持自动旋转

*3.可直接在 xml 添加元素即可添加列数据。也可以动态代码添加 view

*4.优良的兼容性,和可以自己尺寸控制

*5.添加了点击切换和点击中间监听,适合目前 app 的需求

*6.优化控件点击切换效果,使用更加的方法实用

如何使用

在你的项目 Gradle 直接引入库文件

  implementation project(':loopplay')

配置 view

布局 xml 里:

    <com.slidemove.library.view.LoopRotarySwitchView
            android:id="@+id/mLoopRotarySwitchView"
            android:layout_width="fill_parent"
            android:gravity="center"
            android:layout_weight="1"
            app:direction="right"
            android:layout_height="0dp">
            <ImageView
                android:src="@mipmap/image1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />
            <ImageView
                android:src="@mipmap/image2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />
            <ImageView
                android:src="@mipmap/image3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />
            <ImageView
                android:src="@mipmap/image4"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />
        </com.slidemove.library.view.LoopRotarySwitchView>

代码设置:

mLoopRotarySwitchView
               .setR(300)//设置 R 的大小
               .setAutoRotation(true)//是否自动切换
               .setAutoScrollDirection(LoopRotarySwitchView.AutoScrollDirection.left)//切换方向
               .setAutoRotationTime(2000);//自动切换的时间  单位毫秒 
Apps
About Me
GitHub: Trinea
Facebook: Dev Tools