I want to add a panel in android activity.I'll try explain its behaviour.
It should show small arrow on right side of my activity, If i click on that a panel having few buttons should slide out consuming around 20%-30% of current activity.
Somewhat same like menu appears on screen.
Thanks in advance.
See the SlidingDrawer widget. However, this widget will only slide up and down on older SDK versions.
Else, you should consider using fragments (using the compatibility API if necessary). You can look for some explanations about how the GMail app is built, or the HoneyComb gallery example to get information about animating fragments.
Here is my example of Panel
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/border">
<TextView
android:text="@string/panel_title"
android:id="@+id/groupTitle"
android:paddingLeft="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/blue" />
Here you add panel content...
</LinearLayout>
You also need to add in drawable resource broder.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
android:width="3dip"
android:color="#d3d3d3" />
</shape>
And color in values/Colors.xml
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<item name="blue" type="color">#FF33B5E5</item>
</resources>
And panel Title in values/Strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="panel_title">Panel 1</string>
</resources>
As for button and animation that can be added separatly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With