marcel Active Member Licensed User Longtime User Dec 1, 2014 #1 Hi, I am struggling with the correct program structure as I am comming from DotNet developer and IOS. Could someone take a look to this if this is a clear setup before I run into trouble later one I am using the sliding menu (jfeinstein10 SlidingMenu library) which you can find here: https://www.b4x.com/android/forum/threads/jfeinstein10-slidingmenu-library.36482/. I want to be sure that this is a good setup of the program (see attached project). The menu calls and activity and above every view you need to have a panel with a menu button (three stripes) that activates the sliding menu. When using the back key the activity must be closed? Or hidden? What is normal and at what activity is the program closing and what is the logic to do this best. Do you need to check the back key in every activity and close the app?? What would be the logic here. And is the way I setup loading the menu and the header ok? Thanks for helping me out.. Attachments TestSideMenuTryOut.zip TestSideMenuTryOut.zip 284.2 KB · Views: 343 Last edited: Dec 2, 2014
Hi, I am struggling with the correct program structure as I am comming from DotNet developer and IOS. Could someone take a look to this if this is a clear setup before I run into trouble later one I am using the sliding menu (jfeinstein10 SlidingMenu library) which you can find here: https://www.b4x.com/android/forum/threads/jfeinstein10-slidingmenu-library.36482/. I want to be sure that this is a good setup of the program (see attached project). The menu calls and activity and above every view you need to have a panel with a menu button (three stripes) that activates the sliding menu. When using the back key the activity must be closed? Or hidden? What is normal and at what activity is the program closing and what is the logic to do this best. Do you need to check the back key in every activity and close the app?? What would be the logic here. And is the way I setup loading the menu and the header ok? Thanks for helping me out..
Douglas Farias Expert Licensed User Longtime User Dec 2, 2014 #3 i sugest to you to use panels and not activitys. u can put your panel invisible and when you want to open only give a panel.visible = true and add all your views, buttons etc on the panels, call this for example panel main panel register etc.... Upvote 0
i sugest to you to use panels and not activitys. u can put your panel invisible and when you want to open only give a panel.visible = true and add all your views, buttons etc on the panels, call this for example panel main panel register etc....
marcel Active Member Licensed User Longtime User Dec 3, 2014 #4 Ok, thanks for the feedback. Upvote 0
SteveTerrell Active Member Licensed User Longtime User Dec 4, 2014 #5 Douglas Farias said: i sugest to you to use panels and not activitys. u can put your panel invisible and when you want to open only give a panel.visible = true and add all your views, buttons etc on the panels, call this for example panel main panel register etc.... Click to expand... Panels also work well for me. I have a service handling bluetooth serial data for my app. I originally had several activities, one for each of the different things that the user could do (setting up, diagnostics, data transfer), that seemed to be the way Android software was supposed to be organised. It was becoming quite complicated to keep track of which activity the service should communicate with, especially when something unexpected happened (disconnect, pause, resume etc.). Panels have the great advantage, in my case, of all being in one activity. I have found it much simpler to use a state machine working with the panels in one activity. The state machine remembers which panel is active and knows what options are available from that panel and which panel to show next when something unexpected happens. Upvote 0
Douglas Farias said: i sugest to you to use panels and not activitys. u can put your panel invisible and when you want to open only give a panel.visible = true and add all your views, buttons etc on the panels, call this for example panel main panel register etc.... Click to expand... Panels also work well for me. I have a service handling bluetooth serial data for my app. I originally had several activities, one for each of the different things that the user could do (setting up, diagnostics, data transfer), that seemed to be the way Android software was supposed to be organised. It was becoming quite complicated to keep track of which activity the service should communicate with, especially when something unexpected happened (disconnect, pause, resume etc.). Panels have the great advantage, in my case, of all being in one activity. I have found it much simpler to use a state machine working with the panels in one activity. The state machine remembers which panel is active and knows what options are available from that panel and which panel to show next when something unexpected happens.
LucaMs Expert Licensed User Longtime User Dec 4, 2014 #6 Fill a activity of panels is not a good choice. SteveTerrell said: The state machine remembers which panel is active Click to expand... (Global) Public CurrentActivity As Activity CurrentActivity = Main in a Code Module Upvote 0
Fill a activity of panels is not a good choice. SteveTerrell said: The state machine remembers which panel is active Click to expand... (Global) Public CurrentActivity As Activity CurrentActivity = Main in a Code Module
Douglas Farias Expert Licensed User Longtime User Dec 4, 2014 #7 the only problem of panels is the organization xD for example my last project Upvote 0
SteveTerrell Active Member Licensed User Longtime User Dec 4, 2014 #8 Cleary Douglas Farias said: the only problem of panels is the organization xD for example my last project View attachment 29871 Click to expand... cool! Upvote 0
Cleary Douglas Farias said: the only problem of panels is the organization xD for example my last project View attachment 29871 Click to expand... cool!
SteveTerrell Active Member Licensed User Longtime User Dec 4, 2014 #10 LucaMs said: Fill a activity of panels is not a good choice. (Global) Public CurrentActivity As Activity CurrentActivity = Main in a Code Module Click to expand... The problems I had were at a different level. The service not only had to check which activity to send data to (that was simply a matter of putting the requesting activity name in the original data request sent to the service) but it also had to avoid running the requesting activity via a callSubDelayed if the app was actually paused by something beyond the control of the user. That does lead to the problem of when does the service actually pass on the data (or tell something that the data was received and not used) and what does it tell. One activity at least answers the question of what to send to and what to tell but of course the application needs different screens for different functions hence multiple panels. Upvote 0
LucaMs said: Fill a activity of panels is not a good choice. (Global) Public CurrentActivity As Activity CurrentActivity = Main in a Code Module Click to expand... The problems I had were at a different level. The service not only had to check which activity to send data to (that was simply a matter of putting the requesting activity name in the original data request sent to the service) but it also had to avoid running the requesting activity via a callSubDelayed if the app was actually paused by something beyond the control of the user. That does lead to the problem of when does the service actually pass on the data (or tell something that the data was received and not used) and what does it tell. One activity at least answers the question of what to send to and what to tell but of course the application needs different screens for different functions hence multiple panels.
LucaMs Expert Licensed User Longtime User Dec 4, 2014 #11 well, it depends on the app. sure to have thirty panels like that crazy Douglas does not seem the best solution. Upvote 0
well, it depends on the app. sure to have thirty panels like that crazy Douglas does not seem the best solution.
marcel Active Member Licensed User Longtime User Dec 4, 2014 #13 Luckly i do not have that many panels Upvote 0
marcel Active Member Licensed User Longtime User Dec 6, 2014 #14 LucaMs said: very comfortable! and manageable Click to expand... Do you have all panels in one layout file? How do you test the layout for different sizes etc? Upvote 0
LucaMs said: very comfortable! and manageable Click to expand... Do you have all panels in one layout file? How do you test the layout for different sizes etc?
LucaMs Expert Licensed User Longtime User Dec 6, 2014 #15 I use some panels (few) for each activity (I would use a larger number of panels for a grid or a board, for example and perhaps). To test them I use emulators, of course, I could not have 100 devices (also, I own only one, hoping that it does not die ). Upvote 0
I use some panels (few) for each activity (I would use a larger number of panels for a grid or a board, for example and perhaps). To test them I use emulators, of course, I could not have 100 devices (also, I own only one, hoping that it does not die ).
SteveTerrell Active Member Licensed User Longtime User Dec 7, 2014 #16 I use the StdActionBar library where each panel associated with a tab has its own layout as in Erel's example. Some panels have overlaid sub-panels covering part of the tab panel, the sub-panels are all in the tab panel layout file and are created with the designer The user controls what is happening by selecting a tab on the action bar which brings the selected panel to the front and sets up some labels, spinners etc. In some cases the code also re-sets the tabs on the action bar to offer context sensitive tabs. The sub-panels are brought to the front by touching buttons on the tab panel or currently visible sub-panel. The StdActionBar example includes some code to handle different size screens. The "BetterSlidingPanels" tutorial is also worth looking at. Upvote 0
I use the StdActionBar library where each panel associated with a tab has its own layout as in Erel's example. Some panels have overlaid sub-panels covering part of the tab panel, the sub-panels are all in the tab panel layout file and are created with the designer The user controls what is happening by selecting a tab on the action bar which brings the selected panel to the front and sets up some labels, spinners etc. In some cases the code also re-sets the tabs on the action bar to offer context sensitive tabs. The sub-panels are brought to the front by touching buttons on the tab panel or currently visible sub-panel. The StdActionBar example includes some code to handle different size screens. The "BetterSlidingPanels" tutorial is also worth looking at.
C ciarli Member Licensed User Longtime User Jan 5, 2015 #18 Douglas Farias said: the only problem of panels is the organization xD for example my last project Click to expand... Hi Douglas, can you post a simple example with a jslidingmenu on the left with two menu items and theirs management (panel,slidingpanel, etc...) like your application? Best regards. Upvote 0
Douglas Farias said: the only problem of panels is the organization xD for example my last project Click to expand... Hi Douglas, can you post a simple example with a jslidingmenu on the left with two menu items and theirs management (panel,slidingpanel, etc...) like your application? Best regards.