ElDorado
Aspiring developer
Profile
Posts: 41
Reg: Mar 25, 2013
Dallas
410
10/23/13 03:39 PM (10 years ago)

Opening Scringo with a button - android

I have an existing buzztouch project on Android. It has a couple of buttons. I want only on of those buttons to launch/open the scringo side bar. The button will exist on the home page of my app. I know the scringo API has the scringo.openSidebar() function but where and how do I call it for that specific button?
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
10/23/13 08:12 PM (10 years ago)
In your project on which screen do you want the scringo to open? or do you want it to open on all screens of your app? Which BT core are you using for your project? It all depends on this. While i have not tried scringo with the new BT core, i can surely tell you on how to put it in v2.0. Suppose you want the scringo sidebar on any particular screen, you have to put following codes in the class file- 1. The following code goes at the top with other private or public integers private Scringo scringo = new Scringo(this); 2. The following code goes in the onCreate method just below the - super.onCreate(savedInstanceState); line scringo.init(); 3. This code goes just below the baseview -//add the view to the base view... baseView.addView(thisScreensView); scringo.setLogLevel(ScringoLogLevel.SCRINGO_LOG_LEVEL_DEBUG); //scringo.setDebugMode(true); scringo.setIcon(ScringoIcon.PERSON); scringo.init(); ((ScringoLeftRibbonButton) findViewById(R.id.activationRibbonLeft)).setScringo(scringo); 4. In your onStart method put following code- scringo.onStart(); 5. Put this code in your onStop method- scringo.onStop(); All these codes given above go in the class file in which you want the scringo working. Other than the above code you have to make some changes in the layout file as well of that particular class file. Put following code in the layout file in the relative layout- <com.scringo.ScringoLeftRibbonButton android:id="@+id/activationRibbonLeft" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="350dp" /> Hope this helps you.
 
ElDorado
Aspiring developer
Profile
Posts: 41
Reg: Mar 25, 2013
Dallas
410
like
10/24/13 01:52 PM (10 years ago)
Thanks Sandeep. I am trying to add it one screen BT_screen_menuButtons. I have a self hosted BT v 2.1 I think. I successfully added the above code and built it but I don't see any new button. Am I supposed to see a button on the main menu buttons screen? I just modified two files - BT_screen_menuButtons.java and the screen_menubuttons.xml. Should I be adding or changing anything else? https://drive.google.com/folderview?id=0BzRLVx04bQ-NZ2VQRGRJTVJPTTQ&usp=sharing
 
ElDorado
Aspiring developer
Profile
Posts: 41
Reg: Mar 25, 2013
Dallas
410
like
10/24/13 02:39 PM (10 years ago)
OK i got it to work. But, how do I align the button to the right. Currently, it appears on the title bar on top left and it is sitting on top of the title. I need to make it appear to the right.
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
10/24/13 06:41 PM (10 years ago)
I have not used the scringo codes in menubutton screens earlier. Try changing the location of the code in the xml file.
 
ElDorado
Aspiring developer
Profile
Posts: 41
Reg: Mar 25, 2013
Dallas
410
like
10/26/13 12:43 PM (10 years ago)
Sandeep - The menu button shows successfully in the menu buttons screen as the scringo code is there. But, it also shows in all the other screens as an empty button. I don't want it to show in the other screens. Do you have any idea on how the button should go away when I leave that particular screen? I put the button in the act_title.xml layout file. I know the nav bar is used in all screens and that is what causes it to show up. I tried to put the button code in the bt_screenMenubuttons.xml but it doesn't show up when I put it there. So I had to put it in the top nav bar.
 

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.