How to display default group icons in ExpandableListView? - android

I'm finding lots of discussion about how to replace the default group icons in an ExpandableListView, but I'm not coming up with anything on how to get the defaults to display in the first place.
The defaults (as shown here, if that's what they look like [new to Android, this is my first ExpandableListView]) will be fine with me, if I can get them to show.
I'm using the sample code from the article; I have no need for the embedded CheckBoxes at this time.
Any assistance is appreciated.
--EDIT--
Also, does anyone have any theories as to why the default icons show in the article (again, if that's what they look like--if someone could confirm that'd be great) but don't show for me?

If you are using custom layouts for your group rows the default icons are overridden by your layout. You'll need to add them to your layout in order for them to display.

you can changed default icon with your own icon as below.
android:groupIndicator="#drawable/image"

Related

Horizontal Seletor

I need to create horizontal selector like in Uber android app (Please check screen shot). But that selector list must be dynamic means (Array[1,2,3,4...]). Please check screen shot:
I trid a lot but nothing worked with grate UI like this, I have trid also this link: check link. Its worked but bad UI because its uses paint to create things. Please help me to achieve same thing. I am trying it for payment selection option based on region. So its must be dynamic.
You can use android ui widget seekbar for this purpose and then customize it.
Also you can refer the following example
Seekbar

How to design a iPhone like menu/button in android at the bottom?

I have googled this, most of the solutions are using:
1.TabHost with customized style which would cover the separate line between each tab to archive the requirement.
2.On the android developers website, there is a article is using Merge layout to put 2 buttons on top of the background image kind of archive what I want.(http://developer.android.com/resources/articles/layout-tricks-merge.html)
3.What about using button but style the looking like the example below? I don't need the selection, cause each item in the menu will be a button, which takes the user to another page.
I am wondering is there any other solutions apart from these two?
This is something want:
I don't need the menu likes a tab which has selected and unselected, they are better like a button always displaying in certain screen(activity).
Thank you.
You can use simple buttons, and provide any custom background for it. For such simple form as on your screenshot look for this link.
But #Janne write right thing - you should be very careful with transplanting controls from another platforms.

How to make a preference more fancy?

I have been tired apply a style or a layout to a preference, but it didn't work well.
Could anyone help me with this?
I also find someone say it could be done in listview,But I wanna how to make those blank spaces between two block?
Please, help me with this , it has been puzzled me a long time.Thanks!
You can have a transparent divider between ListItems
android:dividerHeight="10 dip"
You can group your preferences by using PreferenceCategories and PreferenceScreens. If you want a preference to have an icon associated with it, you can use the android:icon attribute on the preference. Are there any specific characteristics of the iPhone settings that you're trying to replicate. You're not going to get your preferences to look exactly like the iPhones setting page, but you can certainly mimic certain characteristics.

Listview theming issues

This is probably a simple question, but I really have tried searching here and google with no joy.
I can make listview lists by following the many tutorials on the net. The problem is, they always seem to churn out lists that don't seem similar in appearance to the bulk of the lists I see in apps.
For example, I've attached a screenshot of a menu in the Chainfire3D app. It uses the 'standard' blue dividers, white titles and smaller blue 'description' text for the second line. This style of menu/list is used in many of the market apps I have. Feedly is another example.
Every time I create a listview I get either all white text (or text which is themed by whatever I have used in the layout).
Are there 2 line menus, with white and blue text that are easy to create, because I'm having to specify the colours in XML etc if I want them to look this way.
Also, to get two line listviews I have been using a custom adapter and 2 textviews on top of each other in a layout. I tried a 'simple_list_item_2' and that worked but again it didn't take this 'standard' theme. I'm sure I'm missing something.
Anyone know what?
Ideally, can someone share some code with me that will create a 2 item listviews, ideally (if poss) with a suitable adapter that will allow the running of different activities based on menu items presses. Here's hoping you can help.
The easiest way is to customize your layout.
You can find good examples here or here.

set two titles?

I can setTitle("My Title"), but what I'm looking to do is set two titles... one on the left side and one on the right. How might I do that?
I currently have 2 textviews, aligned parent left and right... the textappearance is changed. But I'm hoping to get that into the titlebar using code so I don't have to use some background to simulate the titlebar.
You can define a custom view layout and tell the system to use it with:
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.text_title);
You can make your title view a RelativeLayout with two children positioned as you like. This should be done in onCreate() before calling setContentView(). See this thread for more discussion of using a custom view.
I don't think you can...I think Android only allows one title...but what you could do is
setTitle("My Title left My title right");
It's more than a little bit of a hack but it might work.
Full disclosure: haven't tried it.
Look at this tutorial for skinning / theming your titlebar
If you look at the Bluetooth Chat example on the Android Resources page, here, you'll see that it has exactly that sort of format. Details on how to access it are included there. It contains an XML edit and a few other simple modifications in your initialization code.
I'm playing around with some files right now to try and create this dual title bar.
It looks like this post would be helpful: my_own_titlebar_backbutton_like_on_the_iphone.
The comment written on this post at Thu Jan 29, 2009 5:55 pm contains the sample files, title1.zip, a second source file, title2.zip is a few comments below that one as well.

Categories

Resources