Git Product home page Git Product logo

circlemenuview's Introduction

CircleMenuView

CircleMenuView that have many custom functions

之前公司项目需求的一个自定义圆形菜单,现封装并开源出来,供大家学习,一个可以定制的原型菜单,直接上图:

如何使用

导入

gradle

compile 'com.allenliu:CircleMenuView:1.0.0'

使用

xml使用

    <com.allenliu.circlemenuview.CircleMenuView
    android:id="@+id/view"
    android:layout_centerHorizontal="true"
    android:layout_width="400dp"
    android:padding="20dp"
    app:center_text="@string/app_name"  //中心显示文字
    app:center_icon="@mipmap/ic_launcher" //中心的图标
    app:menu_text="@array/text"   //周围盘块的数据源 数组
    app:menu_icon="@array/icon"   //周围的图标数据源 数组 注意文字和图标数组大小应该一致,并且数组大小最好为偶数
    app:menu_text_size="12sp"     
    app:menu_text_color="#f2f"
    app:stroke_color="@color/colorAccent"  //扫边的颜色 有默认值
    app:gap_color="@color/colorPrimary"    //缝隙颜色  有默认值
    app:stroke_width="2dp"                 //扫边宽度 有默认值
    app:menu_item_background="#f7f7"       //盘块背景色 有默认值
    app:gap_size="10dp"                   //缝隙大小  有默认值
    app:inside_cirle_radius="75dp"       //内圆半径 不填默认是外圆的三分之一
    android:layout_height="500dp" />    //宽高如果不一致 取小的

代码直接实例化

     new CircleMenuView(this)
            .setWidthAndHeight(300, 300)
            .setCenterText()
            .setCenterIcon()
            .setGapColor()
            .setGapSize()
            .setMenuIcons()
            .setMenuTexts()
            .setMenuTextColor()
            .setMenuTextSize()
            .setMenuItemBackground()
            .setInsideCircleRadius()
            .setStrokeColor()
            .setStrokeWidth()
            .setOnClickListener();//设置每个盘块点击事件

License

    Copyright 2016 AllenLiu.

    Licensed to the Apache Software Foundation (ASF) under one or more contributor
    license agreements. See the NOTICE file distributed with this work for
    additional information regarding copyright ownership. The ASF licenses this
    file to you 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.

circlemenuview's People

Contributors

alexliusheng avatar

Watchers

James Cloos avatar  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.