美文网首页我爱编程
空祖家的对话框 2.1 菜单底栏也来啦

空祖家的对话框 2.1 菜单底栏也来啦

作者: kongzue | 来源:发表于2018-05-05 21:40 被阅读65次

菜单底栏已加入空祖家的对话框

完整的《空祖家的对话框 2.1》请参阅:https://github.com/kongzue/Dialog 欢迎Star&Fork

底栏菜单.png

相关说明

注意,此处使用的是来自com.kongzue.dialog.v2 的 BottomMenu 类。

List<String> list = new ArrayList<>();
list.add("菜单1");
list.add("菜单2");
list.add("菜单3");
BottomMenu.show(me, list, new OnMenuItemClickListener() {
    @Override
    public void onClick(String text, int index) {
        Toast.makeText(me,"菜单 " + text + " 被点击了",SHOW_TIME_SHORT).show();
    }
},true);

包含的参数如下:

字段 含义 是否必须
activity 必须继承自 AppCompatActivity 必须
list 泛型为 String 的列表 必须
OnMenuItemClickListener 点击回调 可选
isShowCancelButton 是否显示“取消”按钮,注意,TYPE_MATERIAL 风格对此无效 可选

另外,本菜单暂时对夜间模式(THEME_DARK)不受影响,只提供Light Theme,但不排除接下来的版本对此更新。

使用 iOS 主题时,DialogSettings.ios_normal_button_color 会对菜单内容文字的颜色产生影响,其他主题不受此属性影响。

或可以使用快速调用:

List<String> list = new ArrayList<>();
list.add("菜单1");
list.add("菜单2");
list.add("菜单3");
BottomMenu.show(me, list);

使用

Maven仓库:

<dependency>
  <groupId>com.kongzue.dialog</groupId>
  <artifactId>dialog</artifactId>
  <version>2.1.0</version>
  <type>pom</type>
</dependency>

Gradle:
在dependencies{}中添加引用:

implementation 'com.kongzue.dialog:dialog:2.1.0'

开源协议

   Copyright Kongzue Dialog

   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.

相关文章

网友评论

    本文标题:空祖家的对话框 2.1 菜单底栏也来啦

    本文链接:https://www.haomeiwen.com/subject/hvnerftx.html