I have a Custom ListView containing events. The Adapters SectionIndexer indexes the day of the week and time of the events upon fastscrolling (e.g. Monday 10:00) but with the default styling of the fastscrolling text, the text is to big and gets cut at the edges.
Is there any way to change the layout of the SextionIndexer dialog? I specifically want to remove the box in the background (or enlarge it to match the day and time displayed) and change the textSize.
There must be a way :) I can't be the only one wanting to index something else than the first letters!
Maybe you already got your answer but anyway for you and others I found a post about this problem
Take a look at this post Fast Scroll display problem with ListAdapter and SectionIndexer
Hope it helps!
Related
good evening , I need help about filling a list view from a MySQL Database,
i don't know how to do it becaus i'm beginner in android
i wanna icon and 3 text views the first is title bold and the second is the RIB and the last one is in the bottom and right of the list view
Your question is a bit too generic and not clearly defined. That's probably why it got down voted. I'd say your best bet is to start with the documentation. Start by reading about ListView and possibly Adapter and try it yourself. If you still have problems, ask a specific question about something you don't understand or can't get working. The best specific answer I can give is that you will need to define a custom adapter to create the item view you want. You will most likely want a layout xml for that item view.
So I did some research and testing of using a listview in a scrollview, and as a lot of people may know this is supposedly bad to do, since they both scroll. It also means I can't show the complete listview as it will wrap to be smaller.
I have seen places which re change the height of the listview to fix this problem but again most people say that it isn't preferred.
What I would like to know though is what is the preferred way of making a nonscrollable listview like view? Basically I want the exact same as the listview but obviously non scrolled and the height based on its contents. I would prefer to work with the layout in as much XML as possible, and I would like to be able to send my array list to it to view on screen. Unfortunately either my search skills are quite dull, as I haven't been able to find anywhere that really explains the preferred method so I thought I would ask here.
Thanks for your help.
<>Clarification Information
I thought I would put this here in case it will help, first off I basically want to show an image, with a list of comments (each one has an author and a text) below it, the comments themselves are obtained from an array and can change. I want the whole page to be scrollable though so I can either view more comments or go back up to the image.
Using a RecyclerView and an adapter supporting multiple item types you could make a list which shows an image on top and several comments below it. Generally you'd have to check what item corresponds to each position - in your case on position 0 you have an image and in every other position you'd have a comment. Then in your adapter's onCreateViewHolder and onBindViewHolder you would check the item type and handle them differently.
You could take a look at this answer for a short example.
Let me know if you'd need any other details and/ or sample codes to get the idea. :)
tell me how best to implement the following representation of information
20.10.2014
7:00 some text
7:30 some text
18:00 some text
21.10.2014
7:20 some text
7:21 some text
7:22 some text
22.10.2014
7:20 some text
I know the following solution - ExpandableListView but then the children can curl up. but I do not need or TableLayout with TableRow but I need to fill in the data from the array and implement the click event for each element except the parent.if you ask a stupid question and give direction where to look, I'll delete it
even without the events. usual display of text from a file in a form
Option 1: Use Multiple Views in ListView
See this tutorial and this answer (it is harder one you will need a simple adapter).
It will help you in creating a adapter with two different layouts.
Option 2: if you don't want it to be so much complicated use simple base adapter and create a view with both date layout and event layout and change it's visibility.
Option 3: In More Simple way create a mutliline text view in scrollView then make your text more formatted using spannable string.
I have a HorizontalScrollView that shows three dates at once and snaps to the date in the middle when you lift your finger. Currently the dates are saved in an LinkedList.
The list has to be dynamic, means that when I scroll to the right, it has to reload the next dates on the right and delete some of the dates on the left. The problem is, I don't know how to create a link between my LinkedList and the ScrollView.
Here is a link to how it looks
Its my first post, so please excuse me if I'm not specific enough.
EDIT: Okay, I found the answer: Gallery offers exactly what I want.
As I said in the OP: Gallery in combination with a custom Adapter solved my Problem.
Is it possible for child views of a list item to receive focus? I have a custom list
view. Each row has a linear layout with two views, a button and a textview. I want to
get the click event on the button and also have the background change color with focus.
Wow, that was hard to read. You should edit the question and try to explain yourself better.
To enable a click listener on those buttons you must add the listener inside the getView() method of the adapter. If you are using the View Holder Pattern
holder.button.setOnClickListener(...)
and then access the parent or whatever to change the background.
If you don't know what I'm talking about with that holder thing, watch this video, it's at the beginning.
Good luck!
From what I could decipher from your question this might be what you need.
Don't quote your own sentences. Also reading what you have typed, before clicking Post would save a lot of effort spent in understanding the question.