智慧屏安装APP的最佳实践与跨平台小程序开发的结合
659
2022-10-26
一个Android库很容易在Android应用程序创建树菜单
TreeMenu
Tree menu is commonly designed in APPs. This Android library makes it very easy to create tree menus in an Android APP . You need not write xml files any more to create tree menus By using TreeMenu. You can easily create a three-layer tree menu at most with this library. Each menu item created has a left image, a title, a right image and can be expanded or collpased when there are sub menus belong to it.
Goal
When I use DrawerLayout in App, if there is a menu list in Navigation part , I always should write xml file like this:
or like this:
some one would think it's convient to use NavigationView (in Android Design Support Library), but it is not convient to create a tree menu which is two-layer or three-layer. Thus I want to write this library that can help you to create a two-layer or three-layer tree menu with minimal efforts and time, and provides many powerful API.
Installing
###Maven Maven dependency:
###Gradle Gradle dependency:
compile 'me.hyman:treemenu:1.0.2'
###Cloning by Git Fork it, than clone the repository to local by typing command in terminal,exchanging xxx for your github username:
git clone https://github.com/xxx/TreeMenu.git
How to use?
Use in XML
In order to let user handle menu click event, there is an interface DrawerMenuLayout.OnMenuClickListener which activity or fragment should implement.
drawerMenuLayout.setOnMenuClickListener(this);// or use an anonymous class
Contributing
This Library is new created, which may have a lot of bugs and deficiencies. and my programming competence is limited. So all kinds of contribution are welcomed.
License
Copyright 2016 Hyman Lee 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://apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed 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 andlimitations under the License. If you've used this library in your app, please let me know it and tell me how it works, Thanks!
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~