Activity with viewpager at the south part and support api-10? - android

I'm looking into the possibility of adding a viewpager at the south/ bottom part of the screen of my activity that is supposed to hold a part of a limited list since I've run into a problem with performance.
The list of items are clickable. I make some fields visible and the list gets pushed down when an item is clicked for the information to be visible of that item.
I need to support api-10.
I've looked at actionbarsherlock and to me it does not seem possible to add that to the south part of an activity.
Any suggestions?

Related

Access Adapter items of Recyclerview

I'm using Recyclerview to show a list. I want to delete some items like IOS. In my listview template I have added a button to delete item which is invisible by default. In my activity I have another button attached at bottom (Not part of listview) and on tap of this button I want to make all delete buttons of listview visible.
My Question is how can I get reference to all delete buttons of listview in activity and is it the right way to do this?
Thanks
Assuming you have ViewHolders set up, you already have references to all the buttons in your list. All you have to do is to make them visible for every item in the list with a simple loop.
In case you haven't implemented ViewHolders I suggest you check out the documentation and take a look at some simple tutorials on how to use them.
On a side note. If I understood correctly you're making a bottom tab for your app and since you referenced iOS I gotta say this; Remember that Android and iOS are two unique operating systems with their own ways of handling things. Check out Googles pure Android documentation.
In your question title you say RecyclerView, but in your text you say ListView. The solution is similar either way, but it's best to be perfectly clear what you're doing.
In either case, there are at least two different solutions.
First, you could use a boolean flag to determine if all the the item buttons should be showing or not. You check this flag at the time the item view is inflated or created and toggle the button accordingly. If the boolean flag is ever changed, the easiest thing to do is tell the RecyclerView/ListView that the underlying data has changed and to redraw all the views. Call notifyDatasetChanged on the adapter.
The other thing you can do at the time the item buttons should change is iterate all the visible item views, find the button, and change its visibility. With RecyclerView, you can do this, and with ListView you can do 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.

Android runtime generated tabs and content

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

how to show image grid in a Drawer which has a listview inside it

In continuation with my last question
How can I make a multi-level(more than 3 level) navigation drawer in android?
What's happening: Basically I am showing filters in my navigation drawer which has children up to many levels. Whenever I click on any, it puts the selected filter at the top and shows its children below as a simple list.
What do I want: When I select a filter, I want to see the images of its children in a grid view inside the drawer(which is vertically scroll-able) just below the name of the filter. If an image is selected here, the name of this children gets added in the hierarchy list and I could see image grid of the new children. This could got upto many levels(safe to assume 4-5).
I was thinking I could make a fragment with same colors as that of the drawer and show my grid view inside it. But I lack much knowledge in it, how could I keep the fragment just below my list and inside the drawer.
Kindly provide a detailed solution. Android noob here.

Android: How to use fragments to completely change a view

My app has a custom segmented control(got it from internet - its really a radio group) and under it a listview. When a user clicks on a row in the list view, a fragment is attached to the activity that displays a different listview. This new listview seems to replace the old one. The problem is that the segmented control is still there, whereas I would like the whole view to be the new list view. Knowing that fragments are embedded in the view group, I thought progammatically removing the segmented control would work, but it didn't, the control just becomes empty space.
It's important that the app works the way I described. I could explain in detail why this is so, if needed.
Any tips? Much appreciated.

Categories

Resources