Listview Cursor adapter with section header - android-listview

I'm working on an IM application. In that I'm using listview to show the buddies list with the help of custom cursor adapter. I'd like to add section header as like contacts application display.Which is the best way of doing it without adding any new library for that?

Related

How to add text and picture in expandable list

I am trying to learn Android by developing an app based on web site (eflore.fr), using the same database and photos embedded in the app. For this, I am using the android expandable listview example at the http://examples.javacodegeeks.com/android/core/ui/expandablelistview/android-expandablelistview-example/ site modified to be compatible with the database and it works well. I have 2 questions :
How to add a textview at the top of the main activity ? A textview in activity_main.xml or group.xml or row.xml is either a mistake or is not visible.
Is it possible to put text an image in the child list ?
Thanks for help

Dynamically add tabs in Tablayoutpanle using UIBinder

To be clear i'm a newbie to GWT.I was looking around for samples to implement dynamic tabs, and found this link, http://www.java2s.com/Code/Java/GWT/AddingnewtabdynamicallyExtGWT.htm , in which they make use of GXT.But my question is,how can i implement dynamic views using UIBinder?.I want to implement something similar to browser tabs.Each newly created tab has a split panel view, whose content will be populated making a rpc request.My question is , how is the history mechanism handled when user switches between tabs?.Can anyone provide with samples?Thanks
You declare your TabLayoutPanel together with the initial/default tabs in UiBinder. Then you can add or remove tabs from this panel in your Java code.

Android - Drawer navigation adapter

I am implementing a navigation Drawer as per: http://developer.android.com/training/implementing-navigation/nav-drawer.html
The tutorial only shows a single TextView with ID android:id="#android:id/text1" and this is populated for the ListView using:
mDrawerList.setAdapter(new ArrayAdapter<String>(
this,
R.layout.drawer_list_item,
mDrawerItems));
Now, I want to include an ImageView inside each ListView item. This will represent the Icon for each item.
Question: Inside my xml for the list items (where the TextView text1 is located), I have included an ImageView.
What do I need to name the ID for the ImageView?
And then, do I simply add the drawable-array reference to the setAdapter like this?
mDrawerList.setAdapter(new ArrayAdapter<String>(
this,
R.layout.drawer_list_item,
mDrawerItems,
mDrawerIcons));
Thank you
I found out that creating an ArrayAdapter in the format above does not allow you to input more than one set of data to the Adapter. For instance, I can only use my list of Drawer Navigation names contained in the Array<String>: mDrawerItems. To pass Icons and other data to the adapter, I have two option:
Simple Adapter used with a Map, or
Custom Adapter.
Examples of both can be found here: http://www.vogella.com/articles/AndroidListView/article.html, and here:
http://www.shenhengbin.wordpress.com/2012/03/17/listview-simpleadapter/

Appcelerator: Pagination for Views in IPhone

I want to show remotely fetched records and want to display in same format as Apple shows Icons on Home Screen. I also want pagination ( the dots on bottom) for indication of currently selected page. How could it be achieved?
I believe you're looking for the ScrollableView component. Use the HTTPClient to retrieve your data from the server, create views/imageviews/etc from the data as appropriate, then add the views as children to the ScrollableView.

How to create a custom listview like iPhone in Android

I was designing a custom listview in Android following the online tutorial Android Series: Custom ListView items and adapters and I created a custom list view like this:
This is simple and fine. Now I was surfing the web and found this fantastic listview for iPhone:
How can I create something like this? How has he given a box like interface for each row separating them from background and each other?
You could try removing the list dividers (android:divider="#null" or android:dividerHeight="0px") and using a custom drawable as the background for each row (either a 9patch or ShapeDrawable, possibly arranged in a StateList so they can have pressed/selected states). Then just also put a margin on the row layout, and your spacing should be taken care of (alternatively, you could use a transparent image as the list's divider with an appropriate height). But be careful about simply aping an iOS style because it looks nice; think about the typical Android user and what they take as interface cues. If you made your Android list look exactly like that screenshot below, I think many Android users wouldn't even realize they could click on those rows, or that they're part of a scrollable list.
The listview and each item in the listview can have separate backgrounds. So all you need to do is make some PNG files that look like the background of the items and the list itself.
You can set the backgrounds in XML using the android:src.
Or at runtime using:
setImageDrawable(getResources().getDrawable(R.drawable."picture name"))