0

I want create a ListView on a fragment.

That ListView must be "hide" and only appear when I clik a button.

Attached pictures of what I need know.

menu1

menu2

menu3

  1. If I click on center button (the arrow button) a ListView appear from bottom.

  2. If I click again the arrow button a ListView hide again.

I dont need open new Activity, I need that ListView on the same Activity but I dont know how I can show ListView and Hide .

Can you help me for that?

4
  • 1
    Post some code whatever you tried... Commented Jun 2, 2014 at 10:30
  • do you need animated listview like sliding? Commented Jun 2, 2014 at 10:35
  • @RamkiAnba no, I dont need animated ListView Commented Jun 2, 2014 at 10:36
  • github.com/gunasiet/SlidingMenuExample in that menu button is on left hand side you just need to put in bottom Commented Jun 2, 2014 at 10:53

2 Answers 2

1

You need to use MotionEvent

Create a class by entending SimpleOnGestureListener. You can find tutorial here

Sign up to request clarification or add additional context in comments.

Comments

0

Reference from this Drawer Demo Project on GitHub
You can use the class MultiDirectionSlidingDrawer.java and include the ListView in a separate layout which will act as the container of what is going to slide up.

In your Activity, suppose the content view is: main_layout
i.e. setContentView(R.layout.main_layout);

Then include the drawer in your main_layout like:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <Button
        arrow to open />

    <package.MultiDirectionSlidingDrawer
        xmlns:my="http://schemas.android.com/apk/res/yourpackageforslider"
        android:id="@+id/drawer"
                //here you specify the direction  
        my:direction="bottomToTop"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        my:handle="@+id/handle" //this is the button -arrow
        my:content="@+id/content" -content (which would identify your listview layout)>
        <include
            android:id="@id/content"
            layout="@layout/layoutContainingYourListview" />
        <ImageView
            android:id="@id/handle"
            button for it to push it up/down />
    </package.MultiDirectionSlidingDrawer>
</RelativeLayout>  

Your listView would remain completely independent of the code above and in a different layout -- layoutContainingYourListview. This is good as the drawer sliding up becomes irrespective of its content - which you can change and work with dynamically too.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.