Context-Menu.Android 开源项目教程

Context-Menu.Android 开源项目教程

Context-Menu.AndroidYou can easily add awesome animated context menu to your app.项目地址:https://gitcode.com/gh_mirrors/co/Context-Menu.Android

项目介绍

Context-Menu.Android 是一个由 Yalantis 开发的开源项目,旨在为 Android 应用提供一个美观且易于定制的上下文菜单。这个项目基于 Android 的 Material Design 规范,提供了丰富的动画效果和灵活的布局选项,使得开发者可以轻松地在应用中集成高质量的上下文菜单功能。

项目快速启动

添加依赖

首先,在你的 build.gradle 文件中添加以下依赖:

dependencies {
    implementation 'com.github.yalantis:context-menu:1.0.8'
}

布局文件

在你的布局文件中添加 ContextMenuView

<com.yalantis.contextmenu.lib.ContextMenuView
    android:id="@+id/context_menu"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:background="@android:color/white"
    app:menu_items="@array/menu_items"
    app:menu_icons="@array/menu_icons"
    app:menu_background="@drawable/menu_background"
    app:menu_item_layout="@layout/menu_item_layout"
    app:menu_animation_duration="300"
    app:menu_item_elevation="4dp"
    app:menu_item_corner_radius="8dp"
    app:menu_item_padding="16dp"
    app:menu_item_margin="8dp"
    app:menu_item_text_color="@android:color/black"
    app:menu_item_text_size="16sp"
    app:menu_item_text_style="normal"
    app:menu_item_icon_size="24dp"
    app:menu_item_icon_color="@android:color/black"
    app:menu_item_divider_color="@android:color/darker_gray"
    app:menu_item_divider_height="1dp"
    app:menu_item_ripple_color="@android:color/holo_blue_light"
    app:menu_item_ripple_alpha="0.5"
    app:menu_item_ripple_duration="200"
    app:menu_item_ripple_radius="24dp"
    app:menu_item_ripple_clip_to_outline="true"
    app:menu_item_ripple_clip_to_padding="true"
    app:menu_item_ripple_clip_to_margin="true"
    app:menu_item_ripple_clip_to_background="true"
    app:menu_item_ripple_clip_to_foreground="true"
    app:menu_item_ripple_clip_to_content="true"
    app:menu_item_ripple_clip_to_bounds="true"
    app:menu_item_ripple_clip_to_padding_and_margin="true"
    app:menu_item_ripple_clip_to_padding_and_background="true"
    app:menu_item_ripple_clip_to_padding_and_foreground="true"
    app:menu_item_ripple_clip_to_padding_and_content="true"
    app:menu_item_ripple_clip_to_padding_and_bounds="true"
    app:menu_item_ripple_clip_to_margin_and_background="true"
    app:menu_item_ripple_clip_to_margin_and_foreground="true"
    app:menu_item_ripple_clip_to_margin_and_content="true"
    app:menu_item_ripple_clip_to_margin_and_bounds="true"
    app:menu_item_ripple_clip_to_background_and_foreground="true"
    app:menu_item_ripple_clip_to_background_and_content="true"
    app:menu_item_ripple_clip_to_background_and_bounds="true"
    app:menu_item_ripple_clip_to_foreground_and_content="true"
    app:menu_item_ripple_clip_to_foreground_and_bounds="true"
    app:menu_item_ripple_clip_to_content_and_bounds="true"
   

Context-Menu.AndroidYou can easily add awesome animated context menu to your app.项目地址:https://gitcode.com/gh_mirrors/co/Context-Menu.Android

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

温宝沫Morgan

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值