Giter Site home page Giter Site logo

27988301 / springactionmenu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lilei644/springactionmenu

0.0 2.0 0.0 601 KB

This is a spring ActionMenu - 一个弹性的功能菜单

Home Page: https://lilei644.github.io/2016/12/06/AndroidSpringAction/

License: Apache License 2.0

Java 100.00%

springactionmenu's Introduction

SpringActionMenu

This is a spring ActionMenu - 一个弹性的功能菜单

Preview 预览

SpringActionMenu

Gif there is distortion, the actual effect is more flexible

gif存在失真,实际效果更加丝滑有弹性

Installation  安装

  • gradle
Step 1. Add the JitPack repository to your build file

allprojects {
    repositories {
        jcenter()

        maven { url "https://jitpack.io" }
    }
}
Step 2. Add the dependency

dependencies {
            compile 'com.github.lilei644:SpringActionMenu:1.0.0'
    }

Usage  用法

  • xml init   xml初始化
<com.lilei.springactionmenu.ActionMenu
        android:id="@+id/actionMenu"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_marginBottom="20dp"
        app:circleRadius="25dp"
        app:dimens="10dp"
        app:animationDuration="2500"
        app:expandDirect="expandDirectTop"
        app:buttonNormalColor="#ff5bc0de"
        app:buttonPressColor="#ff39b3d7"
        app:actionMenuIcon="@drawable/add"
        app:actionMenuOnIcon="@drawable/close"
        />
  • add menu items   添加菜单组件添加菜单组件添加
ActionMenu actionMenu = (ActionMenu) findViewById(R.id.actionMenu);

// add menu items
actionMenu.addView(R.drawable.search, getItemColor(R.color.menuNormalInfo), getItemColor(R.color.menuPressInfo));
actionMenu.addView(R.drawable.like, getItemColor(R.color.menuNormalRed), getItemColor(R.color.menuPressRed));
actionMenu.addView(R.drawable.write);
  • delegate  代理监听
actionMenu.setItemClickListener(new OnActionItemClickListener() {
    @Override
    public void onItemClick(int index) {

    }

    @Override
    public void onAnimationEnd(boolean isOpen) {

    }
});
  • attr property   属性
name format description default
circleRadius dimension Round menu radius 30
dimens dimension The spacing of the menu items 30
animationDuration integer Animation duration 500
buttonNormalColor color Button The color in normal condition Color.RED
buttonPressColor color The color of the button click status Color.RED
actionMenuIcon reference Menu icon --
actionMenuOnIcon reference The icon when the menu is open --
expandDirect enum The direction of the menu extension expandDirectTop

Requirements  版本要求

Android 14+

License

   Copyright 2016 lilei644

   Licensed 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.

springactionmenu's People

Contributors

lilei644 avatar

Watchers

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