How to show 3 parts in one single view in android tablet? - android

My application for android tablet contains 3 parts in one single view.
Listview items
On Click of list that contained in first part the second list items is shown in second part.
On Click of list that contained in second part the detils of each list should be shown in third part.
How to achieve this?Can Any anyone help me with some examples.

add one ListView and two fragments into Activity . Both Fragments will have their own Life Cycle .

Related

How to use one recycelerview for some different categories?

for making an android application like the picture below(in the main page we have some categories and when we click on each of them there is a list of 40 items that each item can be clicked and read more about it) i have 2 questions :
1) Is it better to use a recycelerview for the main page that has 6 or 8 icons or Is it better to use image buttons?
2)as we see we have different categories in this app so we have to make new recycelerview,adapter and ... for each of them or just use one for all of them?
main page of the app
For question number 2:
If you have a several list with same item, yes you can use one adapter and one item.xml
and although you can use Intent.putExtra(); to handle this.

Android App UI layout review

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.

dynamically create a new activity by pressing of different buttons in different activities

my problem goes like this-
this is a commercial application in which users can purchase different products they see within app..
there is one view cart button available on the main screen
there are 10 different products available in an activity and there are 3 such activities( each of them containing various different products)
these products are arranged in a linear fashion (linear layout).
every product is having an add to cart image button.
what i want is, when the user presses that button, 3 things should happen..
a new activity will be created containing that product information (when the user presses another "add to cart" button, this new product will come below the previous product and so on).
there is one cart button in the menu bar, that cart should show a number equal to the nos of product in the cart.
its simple, a small flash notification that the product has been added to the cart.
any help will be deeply appreciated.
You would see some benefit by using Fragments instead. Use a main Activity as a "switchboard" and multiple Fragment instances to show the per item details.
You don't need to dynamically create a new Activity. Taking into consideration that you call yourself a newbie in android development, I can only tell you what to study to accomplish your plan.
First, learn to make an Activity that will contain a ListView. Make an XML layout for your ListView items, containing TextViews, Buttons, whatever you want. Then, make an adapter that will fill items with corresponding values (texts, button names, images, etc).
And second, make them all clickable (onItemClickListener or an onClickListener for every button) and make your Activity get inflated with a Fragment containing TextViews, ImageViews, etc... whatever you need to represent information about the item selected.
The best practical way is to make an empty Activity with an empty Fragment. The last one will be either inflated (populated) or even replaced with whatever things you need.
Sorry, but teaching you how to make all these things technically is beyond the scope of any sensible answer that someone can post here. It's all the matter of study and practice. But I hope the vector of study I gave you is transparent and affordable.

how can i add and remove elements of a listView?

Hi guys im making my first android app, it has 4 fragments, inside one of those fragmentes a listView is gonna be displayed, and i need to give the option of adding and removing every element of the listView to the user (every element of the list view is supposed to link to a unique fragment that has some information regarding to it) , so where should i save the elements of the listView?
thanks very much.
im using java (android studio)

Android: User Interface

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.

Categories

Resources