Monday, January 21, 2013

[android-developers] Re: sliding in a new layout

I tried but wasn't able to follow and apply to what i'm trying to do.

I.e. slide in a view - eventually a listview or something similar.

if you can put together a quick app that uses the widge -
i for one would more than appreciate it.

thanks.


On Monday, January 21, 2013 9:55:53 AM UTC-5, G. Blake Meike wrote:
I really need to add that, don't I.  I don't have it, just now.

Something like this:


View menuRoot = activity.getLayoutInflater().inflate(R.layout.menu, null); 

menuView = (SlidingMenu) menuRoot.findViewById(R.id.menu_list); 

menuView.setContainerView(menuRoot, (ViewGroup) activity.findViewById(R.id.view_slider));


Then menu looks like this:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"



    android:id="@+id/menu_root"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    android:orientation="vertical"

    android:paddingBottom="46px"

    android:paddingLeft="46px"

    android:paddingTop="46px"

    tools:ignore="PxUsage" >



    <net.callmeike.android.widget.SlidingMenu

        android:id="@+id/menu_list"

        android:layout_width="match_parent"

        android:layout_height="match_parent"

        android:background="@drawable/menu_bg"

        android:cacheColorHint="#00000000"

        android:divider="@color/amber_grey"

        android:dividerHeight="2px"

        android:paddingBottom="3px"

        android:paddingLeft="2px"

        menu:sliding_menu_animation_millis="700"

        menu:sliding_menu_x_displacement="0.7"

        menu:sliding_menu_y_displacement="0.0" />

</FrameLayout>


It will slide the view with the id view_slider out of the way, and replace it with the menu.

-blake


On Monday, January 21, 2013 4:11:43 AM UTC-8, dashman wrote:
i see that it's a library.

do you have a sample code as to how to use it.

thanks.


On Sunday, January 20, 2013 3:25:04 PM UTC-5, G. Blake Meike wrote:
I've been poking around at this for a while.  You might be interested it this:

https://github.com/bmeike/SlidingMenu

G. Blake Meike
Marakana

Programming Android 2ed is now in stores:

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment