February 23rd, 2013, 11:13 PM
Thread Author (OP)
Join Date: Feb 2013
Carrier: Not Provided
Thanked 0 Times in 0 Posts
Optimisation of application (same layout for different activities)
I’m currently working on a new application and would like to ask you a question about the optimization of my design. At the bottom of the screen, I would like to always get access to a “bottom button bar”, with three buttons (for example “help” “settings” and "home"). So this part would stay on the bottom of the screen during the navigation on the app.
For my homepage, I have defined it in my layout. So I indeed have a bottom bar which fits with what I want. I plan to copy/paste this part of my XML code in the layout of every activity, so this bottom bar would appear on every activity as required. Though, I have the feeling that it’s not a really clean way to do it and I am afraid that I would have to redefine my button for every activity, though there will always be the 3 same buttons.
Do you think it’s ok to rewrite the same thing every time in the xml file? Can I define once and for all the method associated to these buttons (with the listener) so on every activity it will be the same action when I click on this button? Thank you so much in advance, I’m a beginner and it’s quite hard to find answers to this kind of questions while working alone!
Thanks in advance!