Hi,

I've ported the code at http://androidbite.blogspot.in/2012/10/android-slidingdrawer-example.html (it was simple enough) and have come up with this

using System;

using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

namespace Slider
{
  [Activity (Label = "SlidingDraw", MainLauncher = true)]
public class Activity1 : Activity, SlidingDrawer.IOnDrawerCloseListener, SlidingDrawer.IOnDrawerOpenListener
  {
    private Button sliderButton;
    private SlidingDrawer drawer;
    private Context context;
    protected override void OnCreate(Bundle bundle)
    {
      base.OnCreate(bundle);
      SetContentView(Resource.Layout.Main);

      drawer = FindViewById<SlidingDrawer>(Resource.Id.SlidingDrawer);
      sliderButton = FindViewById<Button>(Resource.Id.slideButton);
      Button btn1 = FindViewById<Button>(Resource.Id.Button01);
      Button btn2 = FindViewById<Button>(Resource.Id.Button02);
      Button btn3 = FindViewById<Button>(Resource.Id.Button03);
      context = btn1.Context;

      btn1.Click += BtnPressed;
      btn2.Click += BtnPressed;
      btn3.Click += BtnPressed;

      drawer.SetOnDrawerOpenListener(this);
      drawer.SetOnDrawerCloseListener(this);
    }

    public void OnDrawerOpened()
    {
      drawer.AnimateOpen();
      sliderButton.Text = "V";
    }

    public void OnDrawerClosed()
    {
      drawer.AnimateClose();
      sliderButton.Text = "^";
    }


    private void BtnPressed(object s, EventArgs e)
    {
      Button t = (Button)s;
Toast.MakeText(context, t.Text + " was clicked", ToastLength.Short).Show();
    }
  }
}

The AXML file is the same. When I run this on a device and click the button to open the drawer, it goes haywire! The drawer opens and closes like crazy for a while.

If I remove the two SetOnDrawer listener lines in OnCreate, the drawers open, but the the two Listeners aren't hit.

Is this issue mine or a problem in monodroid that needs to go into BZ?

Paul

--
"Space," it says, "is big. Really big. You just won't believe how vastly, hugely, mindbogglingly big it is. I mean, you may think it's a long way down the road to the chemist's, but that's just peanuts to space, listen..."
Hitch Hikers Guide to the Galaxy, a truly remarkable book!

_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to