mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
04/25/13 08:22 AM (11 years ago)

Scringo Button for right nav bar

Hi guys, Don't remember where I saw it, but someone was able to make the right nav bar button on a screen into a "scringo" button, tapping it activated the swipe gesture automatically. This is what I would like to do. Any help would be greatly appreciated! David https://buzztouchmods.com
 
Pancho
Code is Art
Profile
Posts: 221
Reg: Mar 06, 2012
Lima
11,610
like
04/25/13 08:38 AM (11 years ago)
Hi MrDavid, The following was posted by Kittsy a few days ago for his carousel plugin. I have followed his instructions and they work great. So, here it goes as originally posted: ------------------------------------- #import <Scringo/ScringoAgent.h> add this line in the view will appear method self.navigationItem.rightBarButtonItem = [ScringoAgent scringoActivationBarItem]; add these lines outside of any other curly braces, this stops the swipe -(void)viewDidAppear:(BOOL)animated{ [ScringoAgent pauseSwipe]; } then add this outside any other curly braces, This makes sure the swipe will re eanable the swipe when past the acrousel menu -(void)viewDidDisappear:(BOOL)animated{ [ScringoAgent resumeSwipe]; } ---------------------------------- Also, Scringo can wreak havoc with other plugins due to its swipe feature. I have chosen to get rid of the manual swipe and just use the navbar right button by using the above code in all the plugins I use in my app. It works OK. Best Regards, Pancho.
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
04/25/13 08:53 AM (11 years ago)
Pancho, that worked perfectly! Big thanks to both of you. Now to figure out how to remove the refresh and replace with a button. LOL. David https://buzztouchmods.com
 
Pancho
Code is Art
Profile
Posts: 221
Reg: Mar 06, 2012
Lima
11,610
like
04/25/13 08:56 AM (11 years ago)
Good! I´m glad my previous experience helped somebody else!
 
BuzzingSteve
Aspiring developer
Profile
Posts: 526
Reg: Jun 24, 2011
Vancouver, Cana...
11,660
like
05/30/13 01:40 PM (10 years ago)
@David and @Pancho. I'm trying to get this to work...could you send a "Dummy's Guide to Adding the Scringo Button" LOL. Where exactly do you put which code? What exactly does "add these lines outside of any other curly braces, this stops the swipe" and "then add this outside any other curly braces, This makes sure the swipe will re eanable the swipe when past the acrousel menu " mean? I need to know which methods to put this code in and exactly where. Thanks in advance...getting closer to submitting this app to Apple...got 3 things to check off my list, and this is one of them. Thanks!
 
Pancho
Code is Art
Profile
Posts: 221
Reg: Mar 06, 2012
Lima
11,610
like
05/30/13 02:05 PM (10 years ago)
Hello BuzzingSteve, When using Scringo with Kittsy´s carousel plugin, both "swipes" (Carousel and Scringo) conflict. Therefore, one has to eliminate Scringo´s swipe, while using the carousel. Two things are necessary: 1) Put a button in the navbar to call Scringo by not swipping, but clicking the button on the nav bar, and 2) Stop Scringo listening of the swipe event while using the carousel. I mean, the carousel is wonderful but in order to make it such, you have to swipe it, right? Otherwise, why use it? In the Buzz_carousel.m file, do the following: a) Include the following line after all imports in line 50: #import <Scringo/ScringoAgent.h> b) In the same file, Buzz_carousel.m, include the following lines: -(void)viewDidAppear:(BOOL)animated{ [ScringoAgent pauseSwipe]; } -(void)viewDidDisappear:(BOOL)animated{ [ScringoAgent resumeSwipe]; } as said in the previous answer. These are methods that will make sure that the scringo agent doesn´t listen to the swipe event while the carousel plugin. That means no conflicts. Also, it makes sure that when you leave the carousel plugin, scringo will resume working with swipes happily. If you haven´t modify the code of the carousel plugin you can put them before line //viewWillAppear... (in Line 113) but after line 110 which contains a close curly bracket "}". Hope it works for you! Pancho.
 
BuzzingSteve
Aspiring developer
Profile
Posts: 526
Reg: Jun 24, 2011
Vancouver, Cana...
11,660
like
05/30/13 02:22 PM (10 years ago)
@Pancho. I should have mentioned that I'm not using the Carousel. I just wanted to get the Scringo Nav Bar Button which shows Scringo...I assume swiping it back will hide it :-) I just wanted to make it more obvious that there is an option there to activate Scringo. Swipe works fine otherwise. Cheers
 
Pancho
Code is Art
Profile
Posts: 221
Reg: Mar 06, 2012
Lima
11,610
like
05/30/13 02:32 PM (10 years ago)
I assumed you were using the carousel plugin, I misunderstood. That was MrDavid´s question. The code mentioned in my answer is only to stop and resume the swipe. It is not needed otherwise. You only need the import line and the activation code: self.navigationItem.rightBarButtonItem = [ScringoAgent scringoActivationBarItem]; in the //viewWillAppear... method. In the next to last position, just before the end of the method. Before the close bracket ("}").
 
BuzzingSteve
Aspiring developer
Profile
Posts: 526
Reg: Jun 24, 2011
Vancouver, Cana...
11,660
like
05/30/13 04:02 PM (10 years ago)
Weird. I tried that already and got errors. I posted a separate forum post about it :-) I was hoping that it's because I'm missing some step. Do you still need to first show the Right Nav Bar Button before adding this code? Cheers
 
Antonios
Apple Fan
Profile
Posts: 381
Reg: Feb 12, 2013
Korinthos, Gree...
4,610
like
05/31/13 01:50 PM (10 years ago)
what is the post forum?
 
Imagenparaweb
Aspiring developer
Profile
Posts: 121
Reg: Dec 13, 2011
Cordoba
1,210
like
06/14/13 09:37 AM (10 years ago)
How can I add the ribbon button in Android? Where do I have to put this: <com.scringo.ScringoLeftRibbonButton android:id="@+id/activationButton2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="100dp"/> And where this (in source code)?: ((ScringoActivationButton) findViewById(R.id.activationButton2)).setScringo(scringo); Thanks!
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
07/15/13 06:23 PM (10 years ago)
@MrDavid. Did you ever find out how to replace the refresh button with the scringoActivationBar button? I would really like to put the refresh on the right side and the scringoActivationBar button on the left. Thanks.
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
07/15/13 06:38 PM (10 years ago)
...... And, of course, I just answered my own question, right after posting the question. That was so easy!
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
03/21/14 11:33 PM (10 years ago)
Also would like to swap the buttons. I see how to position the Scringo to either side. RedDog- How did you move the refresh button to the right? Thanks
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
03/22/14 11:39 AM (10 years ago)
@NCbuzz. That's a good question. I ended up leaving the refresh on the left and the Scringo on the right. I will check my notes late tonight about how I switched them and why I put them back.
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
03/29/14 09:31 AM (10 years ago)
@NCbuzz In the BT_viewUtilities.m line 311 code I changed setLeftBarButtonItem to setRightBarButtonItem like this; if([theScreenData isHomeScreen]){ UIBarButtonItem *theRefreshButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:appDelegate action:@selector(downloadAppData)]; [theViewController.navigationItem setLeftBarButtonItem:theRefreshButtonItem]; [theRefreshButtonItem release]; } to; if([theScreenData isHomeScreen]){ UIBarButtonItem *theRefreshButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:appDelegate action:@selector(downloadAppData)]; [theViewController.navigationItem setRightBarButtonItem:theRefreshButtonItem]; [theRefreshButtonItem release]; } Then, in BT_screen_menulistSimpleAdvanced.m line 128 I changed rightBarButtonItem to leftBarButtonItem like this: self.navigationItem.rightBarButtonItem = [ScringoAgent scringoActivationBarItem]; } to; self.navigationItem.leftBarButtonItem = [ScringoAgent scringoActivationBarItem]; } Keep in mind that this was BT core 2.0 and these files and line might have changed or moved.
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
03/29/14 11:42 AM (10 years ago)
Thanks. I will try it out.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.