Code Monkey home page Code Monkey logo

circlelayout's Introduction

CircleLayout

环形布局,可拖动,独立item设置,可设置中心view 更自然,更自由

效果图

效果图

用法

引入

    compile 'com.nelson:CircleLayout:0.1.0'

方法

1.可以直接在布局文件中进行布局,类似LinearLayout,但是这里不需要关心布局方式,会自动将布局中的所有子view均匀分布到中心点四周,这里你可以设置自己想要的半径

<com.nelson.circlelayout.CircleLayout
        android:id="@+id/circle"
        android:layout_width="wrap_content"
        android:layout_height="400dp"
        android:layout_gravity="center"
        app:radium="120dp"
        >

        <ImageView
            android:id="@+id/image1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@mipmap/ic_launcher_round" />

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@mipmap/ic_launcher_round" />

         ...

    </com.nelson.circlelayout.CircleLayout>

2.也可以直接从代码中添加子View

    CircleLayout circleLayout = (CircleLayout) findViewById(R.id.circle);
    circleLayout.addView(View v);

3.还可以设置中心的View,这个功能目前只能在代码中设置:

    circleLayout.setCenterView(View v);

4.当然,这里还有removeget方法,方便使用 5.如果想在代码中动态设置半径,可以直接调用

    circleLayout.setRadius(int radius);

6.可以控制该layout是否可滑动

    circleLayout.setCanScroll(boolean isCanScroll);

7.如果想给每一个子view添加动画啥的,可以直接对子view进行操作

8.更多用法请自行脑补

circlelayout's People

Contributors

nelson1110 avatar

Watchers

James Cloos avatar

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.