GithubHelp home page GithubHelp logo

blueflychief / looprotaryswitch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yixiaolunhui/looprotaryswitch

0.0 2.0 0.0 2.83 MB

3d旋转切换view,类似旋转木马效果。可以自动切换!

Java 100.00%

looprotaryswitch's Introduction

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

效果图

image

##优势 *1.3d旋转RelativeLayout *2.支持自动旋转 *3.可直接在xml添加元素即可添加列数据。也可以动态代码添加view *4.优良的兼容性,和可以自己尺寸控制 *5.添加了点击切换和点击中间监听,适合目前app的需求 *6.优化控件点击切换效果,使用更加的方法实用

如何使用

在你的项目Gradle 添加

 compile 'com.dalong:loopview:1.0.2'

或者直接引入库文件

1.0.2版本

 1、增加方向设置.

1.0.1版本

 1、优化代码。
 2、增加自动旋转方向设置

1.0.0版本

 1、支持3d旋转。
 2、支持自定义旋转。
 3、点击3d切换,触摸滑动3d切换

配置view

布局xml里:

    <com.dalong.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.dalong.library.view.LoopRotarySwitchView>

代码设置:

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.