一个可定制的圆盘菜单

2,624 阅读1分钟
原文链接: github.com

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

[1]

[3]
[4]
[5]

gradle

compile 'com.allenliu:CircleMenuView:1.0.0'

xml使用

        //宽高如果不一致 取小的

代码直接实例化

     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.