仿地图弹窗

本文介绍了如何实现仿地图弹窗效果,包括简单的使用方法和具体实现细节。在使用方法中,只需传入view、布局ID及Adapter。具体实现部分,讲解了activity布局,主要包含ImageView和searchView,并展示了RecycleView部分的布局动画,使用LayoutAnimation实现从下往上的弹出效果。
摘要由CSDN通过智能技术生成

首先看效果图

当然了这个高度和宽度是可控的。想详细修改的话去代码里面修改吧.

使用方法

    BouncingMenu.makeMenu(findViewById(R.id.rl), R.layout.layout_rv_sweet, adapter).show();

是的,你没看错,就是这么简单。
只需要传入view,布局id,以及adapter(这里使用的是recycleview.Adapter)。想修改其他的话直接去修改代码吧。

具体实现

首先是activity的布局,很简单,就是放了各种ImageView,然后上面放了个searchView。
这里就不写详细布局了
弹出视图

这里把视图分成2部分了。

  1. RecycleView部分。使用的是LayoutAnimation。从下往上

    布局:

    <?xml version="1.0" encoding="utf-8"?>
    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@android:color/transparent"
        android:orientation="vertical">
    
        <RelativeLayout
            android:id="@+id/freeGrowUpParent"
            android:layout_width="match_parent"
            android:layout_height="@dimen/sheet_height"
            android:layout_gravity="bottom"
            android:background="@android:color/transparent">
            <!--自定义控件,就是那个波动view-->
            <com.xie.designpatterns.widget.BouncingView
                android:id="@+id/sv"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp" />
    
            <android.support.v7.widget.RecyclerView
                android:id="@+id/rv"
                android:layout_width="match_parent"
                an
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值