thedillonb / MonoTouch.SlideoutNavigation

A MonoTouch slide-out UI component
40 stars 24 forks source link

Issue with Slideout panel and pushed controllers #9

Open jonathanlundstrom opened 10 years ago

jonathanlundstrom commented 10 years ago

Hello!

I am using this component on an Xamarin.iOS project running iOS7 and it's working quite good. There are just two bugs that I wonder if anyone here knows how to fix.

  1. iOS7 introduced the swipe from side gesture to pop the current view and return back. This mains that if I am at second screen, one step away from my home screen and slide, the slideout panel appears. I only wish this to be enabled with top level controllers and let the system take over for the other ones.
  2. Sometimes when you swipe fast, the slideout panel gets stuck, and you have to press the button in order to get rid of it completely.

I would really appreciate if you could help me with these issues.

Thanks, Jonathan

twanwv commented 10 years ago

Hey Jonathan,

It's nice to hear you use this component! Since iOS7 I kinda stopped working on this since, as you mentioned, they added gestures which conflicted with the idea of this library. For issue one I know you can disable the navigation back gesture by disabling the back button however I don't know or thats the desired functionality you are trying to get.

For issue two I will take a look into it over the weekend, currently I'm actually quite busy, will try look up some code I used to disable the back button to fix issue one. In the meantime if you find any issues or fixes feel free to report them here.

Twan

jonathanlundstrom commented 10 years ago

Hey @twanwv!

I'm sorry to hear that you stopped working on this. I've been scouting the net trying to find a proper component and this one is by far the best of them all.

Let me explain issue number one a little better, I realize that I was a little quick on the keys.

My main screen is a Map screen, and in the navigation bar I have one button on each side. The left button opens your component, the slideout panel whereas the right button pushes another ViewController to the stack, opening a view which displays an UITableView.

In that view I've got a back button to the left which pops the ViewController of the stack and returns me to the map. Clicking the button works great, but if I slide in the navigation bar from the left to the right the slide out panel opens, which is not a desired behavior as I am now a level deeper in to the application.

Would it be possible to add a property to the extended NavigationController which disabled the slideout panel, something like this.NavigationController.SlideOutNavigationEnabled = false. That way users could enable or disable the functionality in ViewWillAppear and ViewDidDisappear for instance.

The second bug, where the slideout panel freezes is not as urgent, but I suspect it's just a minor calculation bug as I don't get any code errors or performance drops. Here you can see a screenshot from within my application where the panel has frozen. http://d.pr/i/E3Jf.

Also, this is just a question and I don't even know if it's possible. But do you know if it's possible to actually reposition the status bar when dragging as well?

Thanks, Jonathan

twanwv commented 10 years ago

Lol, I just noticed that @thedillonb started working on this again, very nice!

For the disabling part I once added some booleans which allowed you to disable each of the menus separately, with LeftMenuEnabled and RightMenuEnabled you can either enable or disable them.

In the sample there should be a switch on the right menu disabling the left menu, if I remember correctly.

About the repositioning of the status bar, I don't think that is possible, it is possible to change the colour though. In this concept menu (which i truly love) http://tinyurl.com/oqhd35s you can see that they change the icon colour.

Twan

thedillonb commented 10 years ago

@twanwv @jonathanlundstrom Yeah, I've noticed the library has some weird quirks with iOS7. In addition, I've started working on a new version which re-works a lot of base code and allows for maximum customization. For example, like the image you posted above where the menu zooms out and to the right, you'll be able to easily customize the animation. In addition, the navigation bar locations, and the navigation bars themselves, will be completely accessable so you can do what ever manipulations you'd like.

Getting back to your original question @jonathanlundstrom, as @twanwv said, you might find luck disabling the slideout menu when you have more than 1 View Controller pushed to the NavigationController. That way the iOS7 gesture for 'slide-to-pop-viewcontroller' will take priority. However, once you're at the root view controller you can enable the menu slideout and it will allow you to slide the menu out. I havent tried this before but it might work. Regardless, I plan to make it work in the next version.

As for your second bug, there's probably a simple math miscalculation that's going on. I can see if I can find it when I get some time. Is this on iPad or iPhone?

jonathanlundstrom commented 10 years ago

Hey @twanwv!

Great to hear that @thedillonb started working on this again, that's awesome!

@thedillonb I'm really looking forward to the new version you mentioned, if it's anything like this one I'm sure it'll be awesome, and it's like the gif @twanwv posted it'll be even better! :+1:

I added the LeftMenuEnabled code from the samples and behold, it disables like it should, although it also removes the slide gesture that iOS7 implemented, but I can live with that. Another thing I noticed is that the left menu item gets restored and I have to re-apply the image I use as a button and remove the title, but that's also not a biggie.

@thedillonb I'm developing on an iPhone, no iPad-support in this application as of now.

Thanks for the great support and swift response guys. Let me know if you want me to test your code from time to time :)

Best regards from Sweden, Jonathan

twanwv commented 10 years ago

Hey @jonathanlundstrom

In the SlideoutNavigationController on line 72 and 96 are the left and right menu disable functions, they indeed remove the buttons as well although you can easily comment that out if you desire other functionality.

I am looking forward to the changes @thedillonb announced and will try to free up some time to follow the changes closely :)

Best regards from The Netherlands over here, Twan

jonathanlundstrom commented 10 years ago

Hello again, Hope you had a great weekend!

@thedillonb, I was just wondering if you found out what is causing the top view to freeze, and not go back all the way. Also, I tried commenting some code on line 72+ and 96+ in order to avoid destroying the menu object on disabling the left menu, but I still haven't got it right. Could you possibly point me in the right direction? :)

Thanks in advance, Jonathan

thedillonb commented 10 years ago

Hey @jonathanlundstrom, I will take a look at it tonight. I'm pretty sure I know where the issue is so it won't take but a few moments. As for your second inquiry, I don't believe the enable methods on line 72 and 96 destroy the menu object. As long as the menu object is set via the "MenuViewLeft" "MenuViewRight" properties they should not be destoryed. Are you seeing your ViewController destroyed when you disable the left/right menu?

thedillonb commented 10 years ago

Hey @jonathanlundstrom, two questions. The first is, what version of iOS are you using? The second is, are you using the latest version of MonoTouch.Slideout? I tried to debug the issue you're seeing (and I've seen it too before) on my iOS 7 device but couldn't reproduce it using the latest code. I'm sure I've seen this issue too and I can't remember how to get it into the state. I thought it had to do with sliding the menu closed too quickly, or something like that, but I can't seem to get it to stick.

jonathanlundstrom commented 10 years ago

Hey @thedillonb! I'm running iOS 7.0.4 on my iPhone 5, and I'm fairly sure I'm running 7.0 in the simulator. I just cloned the latest repository, compiled and moved the .dll into my project, unfortunately I still experience the same issue. You can see it here: http://d.pr/i/SAzq.

I was not able to replicate this bug in your demo with both the left and the right open, although I found another issue with that, instance the right menu opens if you flick really fast on the left side but to the right. With the right menu disabled in your demo I did manage to replicate my issue though, see screenshot: http://d.pr/i/F5x1.

You'll also be glad to know that I solved my second issue, the problem was that MainScreen was my TopView, and in the MenuViewLeft table I had a list that went into a custom settings screen. From there, by pressing a button, I was pushing the MainScreen to the stack, and when I did, the left menu did not reinitialize, therefore the left menu object did not exist. I simply changed the procedure so that when you select a setting, it saves and tell the Menu in AppDelegate to open, revealing the menu again. Will let you know if I ever experience any issues with this.

Thanks for taking time to look at this, the first error is somewhat annoying, and I haven't been able to find out what is causing it either.

jonathanlundstrom commented 10 years ago

Hey @thedillonb, sorry to bother you again. Was my last update helpful, and did you find something that might explain the strange bug that occurs when the panel is moved too fast?

jonathanlundstrom commented 10 years ago

Hello @thedillonb and @twanwv!

I'm sorry for writing again, I was just wondering if you had a chance to look at the miscalculation bug which makes the drawer get stuck yet. I'm releasing an app shortly where I'm using your component and I would really like to get it working before I do. Do you have a donation link or something, maybe I can be off assistance? It's a really great component, certainly the very best for MonoTouch and it would be a shame if people couldn't use it because of such a minor bug.

Best regards, Jonathan

HarshadPansuriya8460 commented 7 years ago

I also get the same bug Any Update is available or not..???