CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
08/19/14 08:20 PM (10 years ago)

Android slide out menu & radio

If you didnt know, you can use scringo side menu to open your screens now you know. https://www.dropbox.com/s/u8uk4ovxxi285eu/Screenshot_2014-08-19-00-34-17.png First add your screens as shown under Custom commands on this page. http://www.scringo.com/docs/android-guides/popular/setup-scringos-menu/ Then right under your scringo.addSidebar(); statement add this: scringo.setEventHandler(new ScringoEventHandler() { @Override public void onPostItemClicked(String actionId) { } @Override public void onMenuItemClicked(String menuId) { if (menuId != null && menuId.equals("beat")) { //Toast.makeText(MainActivity.this, "The App Optional Custom button " + menuId + " Clicked", Toast.LENGTH_LONG).show(); // The rest of your code loadScreenWithNickname("93.1 the Beat"); } if (menuId != null && menuId.equals("kiss")) { //Toast.makeText(MainActivity.this, "The App Optional Custom button " + menuId + " Clicked", Toast.LENGTH_LONG).show(); // The rest of your code loadScreenWithNickname("96.9 Kiss Fm"); } if (menuId != null && menuId.equals("kar")) { //Toast.makeText(MainActivity.this, "The App Optional Custom button " + menuId + " Clicked", Toast.LENGTH_LONG).show(); // The rest of your code loadScreenWithNickname("KARX-FM 95.7 (THE KAR)"); } if (menuId != null && menuId.equals("kgnc")) { //Toast.makeText(MainActivity.this, "The App Optional Custom button " + menuId + " Clicked", Toast.LENGTH_LONG).show(); // The rest of your code loadScreenWithNickname("57F9B84295A4F23FF240383"); } if (menuId != null && menuId.equals("eagle")) { //Toast.makeText(MainActivity.this, "The App Optional Custom button " + menuId + " Clicked", Toast.LENGTH_LONG).show(); // The rest of your code loadScreenWithItemId("1199F0D72DB1DF0287E92A1"); } if (menuId != null && menuId.equals("plains")) { //Toast.makeText(MainActivity.this, "The App Optional Custom button " + menuId + " Clicked", Toast.LENGTH_LONG).show(); // The rest of your code loadScreenWithItemId("ACECB4B8FC68E2700F774B8"); } if (menuId != null && menuId.equals("arma")) { //Toast.makeText(MainActivity.this, "The App Optional Custom button " + menuId + " Clicked", Toast.LENGTH_LONG).show(); // The rest of your code loadScreenWithItemId("A58121C48A731C14C467E29"); } if (menuId != null && menuId.equals("popo")) { //Toast.makeText(MainActivity.this, "The App Optional Custom button " + menuId + " Clicked", Toast.LENGTH_LONG).show(); // The rest of your code loadScreenWithItemId("8A10514D3A16FB93E832179"); } } }); You dont have to do this many, but this is the most amount of extra screens you can add unless you disable some of the other tabs. anyways.. so basically the code is saying "if the menu id you made in scringo equals "that" menu item load this screen by nickname or item id. Theres an example of both above. Put this in every plugin you want to have this functionality. Also on the CP stream plugin when you leave the app and then click on the notification to go back to that station, it crashes. The logcat said something like "it has to cast to an activity". I looked in the the cp_streamservice.java and at the very end is the code for the notification. on this line: Intent notificationIntent = new Intent(mPlayerService, Cp_stream.class); I changed it to this: Intent notificationIntent = new Intent(mPlayerService, BT_activity_host.class); It goes back to the apps main menu, but not to the station thats playing. At least it doesnt crash ha. I havent took the time to look through the code and really understand it but if I ever do hopefully I can make it go back to the radio screen
 
KennedyE
Android Fan
Profile
Posts: 373
Reg: Dec 07, 2013
PH, Nigeria
3,730
like
08/20/14 01:04 AM (10 years ago)
Oh I thought you just released a new Android menu plugin, Lol. Thanks for the info!
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
08/20/14 10:33 PM (10 years ago)
I agree with Kennedy, to parallel Susan's side menu tip, the Android house needs a side menu capability. Perhaps after the Custom URL for Android, we can ask you one more thing before school starts? :-) Thanks for sharing the Scringo tip! -- Niraj
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
08/20/14 10:55 PM (10 years ago)
ha yes the custom url is a little tricky.have to approach it differently without touching the core. ha yea Ive been studying the menu plugins to get an idea of how they parse the bt_config.txt. Getting the hang of it now. I dont know about before school because it starts next monday. Havent been really studying the code to create a menu but Im considering creating some type of menu.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
08/20/14 11:09 PM (10 years ago)
Consider just using and abusing the built-in Context Menu ... Just like Kittsy and Susan had done on the iOS side. :-) -- Niraj
 

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.