2

So, what I want to do is that when I click an item of a ListView the item will get on top of the screen and the items below will 'slide' down, showing the activity I want to show. I want it to look something like this:

Excuse the ugly cutting and stuff

Because my skills with GIMP aren't so good, I will try to explain better. I want something like the image but with the user clicked row it the top of the screen and the activity filling the (now) black space. When the user goes back (by the key or some button on said activity) I want the reverse animation to happen.

I've tried with this SO Thread but it isn't quite what I'm looking for, and it seems kind of resource intensive (for my requirements).

So, if anyone wants to point me in the right direction, or show me a way to do it, I'll be very thankful.

Community
  • 1
  • 1
Alvin Baena
  • 903
  • 1
  • 10
  • 24

1 Answers1

0

Why cant you use the android-accordion-view

Sample Code

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:accordion="http://schemas.android.com/apk/res-auto/com.sentaca.android.accordion"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@android:color/white"
    android:orientation="vertical" >

    <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <com.sentaca.android.accordion.widget.AccordionView
            android:id="@+id/accordion_view"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            accordion:header_layout_fold_button_id="@id/foldButton"
            accordion:header_layout_id="@layout/accordion_header"
            accordion:header_layout_label_id="@id/foldText"
            accordion:section_bottom="@layout/accordion_footer"
            accordion:section_container="@layout/accordion_section"
            accordion:section_container_parent="@id/section_content"
            accordion:section_headers="@array/accordion_sections"
            android:background="#fff5f5f5"
            android:orientation="vertical" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Item 1" />

            <LinearLayout
                android:id="@+id/example_get_by_id"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical" >

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Item 2" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Item 3" />
            </LinearLayout>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Item 4" />

            <LinearLayout
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical" >

                <RatingBar
                    android:id="@+id/ratingBar1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content" />

                <EditText
                    android:id="@+id/editText1"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />

                <SeekBar
                    android:id="@+id/seekBar1"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />
            </LinearLayout>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Item 4" />
        </com.sentaca.android.accordion.widget.AccordionView>
    </ScrollView>

</LinearLayout>

This is the sample looks like

san
  • 1,845
  • 13
  • 23