I've a two column layout and want it working like the "Settings" on a android 4 on a tablet.
On the left a menu (it's a ListView) and depending on the action on the list view I want to load an activity on the right column.
How can I achieve this? I'm unsure of what keywords to use to search for a solution.
Sounds like you want fragments. What you would do is create an activity that allows for two fragments which you can customize how you want.
Related
Now I’m designing the UI for my first Android Application. I just wanted to confirm if what I grasped and design choice is rightly done.
The requirement is, I need to display a list of Images+Data on the home page, it might run into hundreds. It also contains a search header. + category selection on thetop.
Clicking on the menu button must side the panel of links for Menu/Config.
I learnt, doing nested layouts are closer to evil in Android. So I did not put multiple one into the other. I’ve put a simplified one.
I have shared what I’ve designed for this requirement. Any word of concern/recommendation would be highly appreciated.
SlidingPaneLayout is the root element of MainActivity.
Bottom View contains list of menus
Top view diplays list of Images
Top view has the following elements
Title Layout : which is basically a RelativeLayout, holds Title name, burger icon and search button
Image ListView : displays list of images from local memory
Sub Category Layout : which is again a RelativeLayout. This displays the sub-category of the image displayed in the Image listview. This will change when user scrolls. Taping on this will display a sub-category listview.
Search bar Layout : which is a RelativeLayout. This has a drop down suggestion listview, which displays suggestions.
Key Questions
Should search be put in a separate activity?
Should search be put in a separate View/Fragment?
Is there any way the layouts can be reduced or replaced with better layout?
1-2/ The ListView should be put in a separate fragment and the search should have its own also. The search view fragment should be open on press of the search icon. You have listeners for opening and collapsing the search field. The idea is to change fragment only in the host activity. Each fragment should implement its own logic.
3/ For sure don't use ListView when you are going to have hundres of items. Instead use the RecyclerView that recycles and reuses the views. ListView will be okay for the left drawer menu as its going to implement static number of elements that won't need recycling.
I am creating an application on Android which is essentially an interactive menu. I will have several categories for this menu, with a list of items in each. These items and item groups are specified when the application is loaded up, and are taken from an SQLite database (although I am not worrying about that bit yet).
Below is my own design which is how I want to the application to look. The top orange bit is the actionbar, and I will use swipe/tabs attached to this. As mentioned all the item groups and items are read from a database, however there could be any number of items, or any number of item groups, so I want both the tab bar and the bottom area of the screen to be scrollable.
The image is slightly cropped to hide some of the titles/logos etc.
My idea so far is to create a ScrollView for each tab, and a TableRow fragment for the grey boxes containing the item_name, price etc. Would it be possible to create an undetermined number of views/pages at runtime, and then fill each of these with the scroll view and then in turn fill each scrollview with the rows of items. Each tab layout will be pretty much identical from the others apart from the actual items it contains. I could either generate all these tabs on creation, or dynamically read the contents of each tab and change the information when a tab is switched, would these be possible?
I'm aiming for API 19, I created a "Tab Activity" but the code auto-generated is slightly different to tutorials I have seen on creating tab screens, they also always work with a pre-determined number of tabs.
Having trouble with this as an Android newb, any help would be appreciated, thanks!
I'm not getting you well but I think you can read your database at atartup and create tabs based on the result.then on each tab fragment create a listview displaying the item_name, price etc. no need to create a ScrollView as a listview is automatically scrollable
I am working on an android app and I have to Implement the below screen. That screen has two buttons at the top just like we have in tab view, on changing the button 1 is for opening the Picture view and other is to view the videos screen. Below that buttons I have to Implement two listviews for video screen that will each contain one header like one for songs (below that will be a listview of songs) and second header is for films (below that will be a listview of films). And the data for both songs and films is coming from two different services, just like for songs http://mywebsite.com/songs and for films http://mywebsite.com/films. Now I am little bit confused about the UI that there are many alternatives to implement it, but not sure which one will be best for me.
Please give me some ideas about how to implement it. Should I use a Radio group for the above buttons and on State change it should call the respective method, for a view of video and picture. But for each view I will have to make two listviews , just like in the video screen one for songs and other for films. And making two listviews is little bit complex than a single listview. Is there any way to handle it by only one adapter and in that view the same headers should be there. Ad if someone has any good idea then please share it. Any help will be highly appreciated.
You should consider to use fragments for your tab functionslity.
An alternative for two list views could be one expendablelistview. With two groups. You can add multiple types of items to any list view. You just have to overwrite the getitemtype Methode and define the different types you want to display in your listview.
1) hey bro, firstly u hv to create a swap view with a navigation tab functionality on it. check out this link http://developer.android.com/training/implementing-navigation/lateral.html
2) the above example will provide you 2 fragment pages that you can use for picture and videos separately. You can create the layout of every page as you like via using separate fragment with their own layout as you wish.
3) Now in video layout fragment, you can use 2 list views one by one in the linear layout with orientation vertical. Check this link to get idea how to implement your custom list view. http://www.androidhive.info/2012/02/android-custom-listview-with-image-and-text/
4) You have to put the value of Android:weightSum="2" in parent layout( linear layout with orientation vertical) and put Android:layout_height="0dp" & Android:layout_weight="1" in each list view. This will provide equal space for both the list view in single screen for each type of device.
I was wondering how to implement the listview like the android market.
in the right hand panel a listview is divided into the two rows. This is very useful because it saves lot of space and user can look at almost double items in the listview at a time. how can I implement this ? any suggestions?
you can use GridView instead of ListView of two columns..
1. GridView
2. GridViewExample
Sample design :
The Android Market also uses the ViewPager to scroll between the pages. Here is an example on how you could implement it.
There is another question that is related to this one.Check the folling link, it might help you:
How to display a two column ListView in Android?
Modify you *.xml file to get what you want.
Good luck!
If you want to do this using listView, then each item (row) in the list view should consist of two views. You can do this using a relative layout (or linear layout) with two items side by side.
You can also implement this using a gridview having two columns.
I'm new in android development and I'll appreciate any help for implementing the following thing.
I have TabHost and in one of the tabs I want to place some-kind of table. Clicking on one of the rows will slide this table to the left and instead of it it will show the view that corresponding to the selected row and a back button at the top. All this should happen in the same tab. Here is picture of what I'm trying to do.
My questions are:
What element I should use for building such kind of table?
How to implement such slides and back button?
Here is a tutorial on view transitions. - http://www.inter-fuser.com/2009/07/android-transistions-slide-in-and-slide.html
I would think this would be a great place to start. :0)
It's a table no doubt. Read about ViewFlipper. You just need a ViewFlipper parent inside your first tab.