Not able to setup RadSideDrawer

7 posts, 0 answers
  1. Vasu
    Vasu avatar
    3 posts
    Member since:
    Apr 2015

    Posted 10 Apr 2015 Link to this post

    Can u help me with xml file or provide with a complete sample code 
  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 14 Apr 2015 Link to this post

    Hello Vasu,

    Please have a look our the online help regarding RadSideDrawer.
    Please write again if you have more questions.

    Regards,
    Victor
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. DevCraft banner
  4. Meghana
    Meghana avatar
    7 posts
    Member since:
    Jun 2015

    Posted 22 Jun 2015 in reply to Victor Link to this post

    Hie Victor,  As I followed the demo for Side Drawer, Its not working with me....

    Main Activity Code

     

      ViewGroup rootPanel = (ViewGroup)this.findViewById(R.id.myline);
            RadSideDrawer drawer = new RadSideDrawer(this);
            drawer.setMainContent(R.layout.main_content);
            drawer.setDrawerContent(R.layout.my_drawer_layout);
            rootPanel.addView(drawer);

     

    Here main_content contains a single textview and my_drawer_layout contains two textview in linear layout...

     Main Activity Layout

     

    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_margin="10dp"
        android:id="@+id/myline"
        android:orientation="vertical">

        <TextView
            android:text="@string/hello_world"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

        <View
            android:layout_width="2dp"
            android:layout_height="5dp"/>


        <GridView
            android:layout_height="wrap_content"
            android:id="@+id/gridView1"
            android:layout_width="wrap_content"
            android:numColumns="4"
            android:horizontalSpacing="10dp"
            android:verticalSpacing="10dp">
        </GridView>



    </LinearLayout>


    But all these displays me nothing. Please Help me

  5. Antony Jekov
    Admin
    Antony Jekov avatar
    88 posts

    Posted 25 Jun 2015 Link to this post

    Hello Meghana,

    Here is the simplest implementation of the RadSideDrawer, that you can use to extend and build on top of:
    @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
     
            RadSideDrawer sideDrawer = new RadSideDrawer(this);
            sideDrawer.setDrawerContent(R.layout.drawer_content);
            sideDrawer.setMainContent(R.layout.main_content);
     
            setContentView(sideDrawer);
        }
     And here are the two xml files used in the above example:
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical" android:layout_width="match_parent"
        android:layout_height="match_parent">
     
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Drawer Content Here"/>
     
    </LinearLayout>
     
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical" android:layout_width="match_parent"
        android:layout_height="match_parent">
     
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Main Content Here"/>
     
    </LinearLayout>

    I hope this proves to be useful.

    Regards,
    Antony Jekov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Meghana
    Meghana avatar
    7 posts
    Member since:
    Jun 2015

    Posted 06 Jul 2015 in reply to Antony Jekov Link to this post

    Yes Antony, 

     This helped me a lot. And thanks for your valuable response. 

  7. Kevin Scheidt
    Kevin Scheidt avatar
    6 posts
    Member since:
    Jun 2012

    Posted 05 Oct 2015 in reply to Antony Jekov Link to this post

    Once you set the drawer on the main activity,  if you load another activity do you have to build the drawer again? 

     

    How would you execute the settings activity from the above drawer example? 

  8. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 08 Oct 2015 Link to this post

    Hello Kevin,

    At the moment Android does not allow a view to persist between activities. You need to encapsulate your SideDrawer setup and reuse it on every activity that requires it. To navigate to an activity you can have a button inside the drawer content that will navigate to it when clicked. Another example is a list view with several items that represent activities and navigate when selected.

    RadSideDrawer does not support automatic navigation if you are wondering. It is merely a view container that animates its children.

    Regards,
    Victor
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner