Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 6    Views: 33

NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
01/28/15 08:46 PM (9 years ago)

Tabbar Configuration Plugin - Tab selected question

WaYsTiiD TIME... I am looking to set a global variable based upon certain tabs being selected. However since they could be in any location due to customization, not sure how to find out which one was tapped? Could I use Tab Label after selection in tabBarConfig.m, or would it take another Control Panel field? I could keep 2-3 from being moved, then it would be the the index value, but not sure where to look. Thanks
 
chadh0130
Apple Fan
Profile
Posts: 352
Reg: Nov 05, 2011
Rhode Island
4,020
like
01/28/15 09:54 PM (9 years ago)
I'm not sure I follow exactly what you're saying. Maybe provide a little more context to the situation (I'm a visual guy) so I'll need to understand a use case. maybe this might help.. ? http://stackoverflow.com/questions/6065965/how-to-define-a-global-variable-that-can-be-accessed-anywhere-in-my-application
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
01/29/15 05:37 AM (9 years ago)
No problem with the variable. It is with determining which tab was tapped. I will grab a screenshot no night to explain. Here is a try to explain When first tab is tapped set variable to a specific value. When another tab (tbd) set the same variable to a different value. Then call the same plugin screen which will now display and execute differently depending on variable. I could make different plugins, but don't want to have duplicate code to maintain. Just remembered that I had previously done this before, and had required modding code in BT. (Will need to go back into my historical archives to find it ;) Thanks
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
01/29/15 08:11 AM (9 years ago)
We know this, and it needs to be said out loud to avoid UI pitfalls. Bear with me please ... Tabs are meant to be predictable. The Tab's Icon represents the context of the multiple screens that the Tab is holding. If Tab-taps cause changes, the User will get confused. A Tab-tap is defined to be "take me to where I left-off within that context. Typically that is when one is switching from one Tab (context) to another Tab (context). Most likely you want a Button on the screen that takes them to another Screen (same plugin) within the same Tab. Be sure to use the correct UI mechanism to achieve your goal and to maintain the User's sanity and intuition. -- Niraj
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
01/29/15 09:04 AM (9 years ago)
I understand what you are saying from a UI perspective. The tabs would be predictable. This NOT what my app does but an example... Tab 1 is for Mustang owners Tab 2 is for Camero owners Both tabs load the same custom plugin. However I now would present the correct model car info (based upon the variable that had been set) without the user making another tap.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
01/29/15 09:46 AM (9 years ago)
Think of it this way ... I can use the same Menu plugin on four different tabs. Each tab automatically shows its unique content because each tab points to a different "BuzzTouch screen". The BT Engine knows to use the same plugin and to feed it the correct JSON as dictated by the Screen ID. Seems to me you are asking Chad's plugin to allow for the same plugin to be selected for multiple tabs. Then you are grappling with "how do I know which tab will show which BT Screen?" Would the Tab Title and Tab Icon help the User understand which Tab shows what content? Does Chad's plugin allow for the same plugin to be multiply used? It should, no special coding should be required. Are you overthinking it? It should just work, not sure if you had time to try. I have not tried. -- Niraj
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
01/29/15 10:37 AM (9 years ago)
I am working with a custom plug-in that I created. I was thinking whether to break it into two plug-ins and was trying to just keep it in one. The tab title and text would obvious. See last example Autos;)
 

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.