santoshgrs / android-section-list

Automatically exported from code.google.com/p/android-section-list
Other
0 stars 0 forks source link

SectionedList crash when attempting to fastscroll #5

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Enabled fastscroll by adding "android:fastScrollEnabled="true" in the 
pl.polidea.sectionedlist.SectionListView section of the main.xml layout file. 

2.  Added a few more items to the list to exceed the 35 count
3.  Launched app.  Started manual scrolling. After fastscroll tab appeared, 
attempting to fast scroll by dragging the fastscroll tab resulted in a crash. 

What is the expected output? What do you see instead?
I expected to see the list scrolling quickly.  Instead a crash message 
appeared:  "The application SectionList (process pl.polidea.sectionedlist) has 
stopped unexpectedly.  Please try again."

What version of the product are you using? On what operating system?
This was reproduced on the emulator (2.2 and 2.3) as well as the HTC Sensation.

Please provide any additional information below.
Would appreciate guidance on how to make fastscroll work and also how to have 
the section headers appear in a box as in the alphabetindexer.

Thank you

Original issue reported on code.google.com by hoond...@gmail.com on 5 Sep 2011 at 4:58

GoogleCodeExporter commented 8 years ago
Hello. I do not know what kind of error you have, but there are certain things 
you have to do to make index appear - for example described here: 
http://twistbyte.com/tutorial/android-listview-with-fast-scroll-and-section-inde
x . Probably you have not implemented Index interface. 

Original comment by ja...@potiuk.com on 6 Sep 2011 at 12:20

GoogleCodeExporter commented 8 years ago
Hi.  Thanks for your reply.  I have read and successfully ran the sample code 
from the twistbyte.com tutorial link you provided.  I also went ahead and 
implemented the SectionIndexer as you suggested.  However,  I am getting a 
java.lang.ClassCastException: pl.polidea.sectionList.SectionList Adapter error. 
 The error points to the FastScroller.java file, line 286.      

My issue seems to be similar to the one filed here:
http://code.google.com/p/android/issues/detail?id=3522

Or perhaps, I did something silly.

Original comment by hoond...@gmail.com on 7 Sep 2011 at 9:46

GoogleCodeExporter commented 8 years ago
I had similiar problem and fixed in other library by simply extending the 
adapter from BaseAdapter. It's fixed now, please update the code.

Original comment by ja...@potiuk.com on 7 Sep 2011 at 9:54

GoogleCodeExporter commented 8 years ago
Thank you very much. I updated the code and now have it working. I appreciate 
your prompt response.  

Original comment by hoond...@gmail.com on 7 Sep 2011 at 10:08

GoogleCodeExporter commented 8 years ago
Hi, I have an additional questions.  I have successfully implemented the 
sectionindexer but I have run into a similar issue as described in the link 
below when turning on fastscroll:

http://stackoverflow.com/questions/3225092/fast-scroll-display-problem-with-list
adapter-and-sectionindexer

After applying what the above link suggests, the first Sectionheader never 
changes its text.  Or more accurately, it does not become invisible when 
needed.  After further debugging, I have confirmed that the 
makeSectionInvisibleIfFirstInList() function does not get called.  As an FYI in 
addition to making the SectionListAdapter implement 
CustomFastScrollView.SectionIndexer, i also had to modify the layout xml file 
to look like this:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/listView"
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent">
    <pl.polidea.sectionedlist.CustomFastScrollView 
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" 
            android:id="@+id/fast_scroll_view">
       <pl.polidea.sectionedlist.SectionListView 
        android:id="@+id/section_list_view" 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"

        android:clickable="true"
        >
        </pl.polidea.sectionedlist.SectionListView>
        <TextView android:id="@android:id/empty"
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content"
            android:text="" />
    </pl.polidea.sectionedlist.CustomFastScrollView>   

</FrameLayout>

Any thoughts as to why makeSectionInvisibleIfFirstInList() is not getting 
called?
Please pardon me if my question is rather elementary.  Have not been doing 
Android for long.  

Many thanks.

Original comment by hoond...@gmail.com on 14 Sep 2011 at 11:00