0

I'm trying to implement a button that opens a popup like window in my gridview. I have something like this in my mind.

enter image description here

it should generate something like this

enter image description here

Is there a library to add in order to use this?

This is the gridview that i'm trying to implement this on

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="5dp"
    tools:context=".MainActivity" >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <ImageView
            android:id="@+id/image_song"
            android:layout_width="match_parent"
            android:layout_height="80dp"
            android:background="@drawable/etuneslogo"
            android:scaleType="fitXY"
            android:paddingLeft="3dp"
            android:paddingRight="3dp"
            android:adjustViewBounds="true"/>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:layout_below="@+id/image_song">

            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                />

        <TextView
        android:id="@+id/song_name"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="3dp"
        android:layout_marginRight="3dp"
        android:paddingLeft="2dp"
        android:paddingRight="2dp"
        android:textSize="14dp"
        android:background="@color/fmYellow"
        android:textColor="@color/gridViewText"
        android:fontFamily="sans-serif-medium"
        android:textStyle="bold" />

        <TextView
            android:id="@+id/artist_name"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/song_name"
            android:layout_marginLeft="3dp"
            android:layout_marginRight="3dp"
            android:paddingLeft="2dp"
            android:paddingRight="2dp"
            android:paddingBottom="4dp"
            android:background="@color/fmYellow"
            android:textSize="12dp"
            android:textColor="@color/gridViewText"
            android:fontFamily="sans-serif-light"
            android:textStyle="bold" />

        </RelativeLayout>

    </RelativeLayout>

</RelativeLayout>
CraZyDroiD
  • 6,622
  • 30
  • 95
  • 182

1 Answers1

1

I think what you're going to want to do is use an AlertDialog for each item in your gridview.

I've only used this for a single button but I think it will work once you add an intent to each gridview item.

Here is a good explanation of how to use an AlertDialog

Android: create a popup that has multiple selection options

Community
  • 1
  • 1