Bug Fix: Fixed broken FilterBar in ListView

@halatmit @jisqyv @afmckinney Fixed broken FilterBar in Listview - related to issue 182:
https://github.com/mit-cml/appinventor-sources/issues/182
I'm not sure what you are saying.  Are you saying that the selection index
should be the index in the filtered list rather than the index in the
original list?   I'm confused.  Try phoning me at 617-332-3793.  Thanks.



== Hal Abelson
hal@mit.edu
Prof. of Comp. Sci. and Eng.
MIT Dept. of Elec. Eng. and Comp. Sci.
MIT Media Lab, Second Class Faculty


On Mon, Dec 29, 2014 at 6:02 PM, kkashi01 <notifications@github.com> wrote:

> In
> appinventor/components/src/com/google/appinventor/components/runtime/ListView.java
> <https://github.com/mit-cml/appinventor-sources/pull/199#discussion-diff-22332949>
> :
>
> > @@ -317,7 +317,9 @@ public void Selection(String value) {
> >     */
> >    @Override
> >    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
> > -    SelectionIndex(position + 1); // AI lists are 1-based
> > +      this.selection = ((SpannableString) parent.getAdapter().getItem(position)).toString();
> > +      this.selectionIndex = position + 1; // AI lists are 1-based
>
> Try the same .aia with app inventor and see the result
> … <#14a9849488cc611b_>
> On Dec 29, 2014 5:58 PM, "hal" <notifications@github.com> wrote: In
> appinventor/components/src/com/google/appinventor/components/runtime/ListView.java
> <
> https://github.com/mit-cml/appinventor-sources/pull/199#discussion-diff-22332834>
> : > @@ -317,7 +317,9 @@ public void Selection(String value) { > */ >
> @Override <https://github.com/Override> > public void
> onItemClick(AdapterView<?> parent, View view, int position, long id) { > -
> SelectionIndex(position + 1); // AI lists are 1-based > + this.selection =
> ((SpannableString) parent.getAdapter().getItem(position)).toString(); > +
> this.selectionIndex = position + 1; // AI lists are 1-based I don't think
> this is correct. When I try Taifun's example, I get b2 as the selection
> (which is correct) but I get 2 as the selection index (rather than 4). Can
> you take a look? @kkashi01 <https://github.com/kkashi01> <
> https://github.com/kkashi01> — Reply to this email directly or view it on
> GitHub <
> https://github.com/mit-cml/appinventor-sources/pull/199/files#r22332834>.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mit-cml/appinventor-sources/pull/199/files#r22332949>.
>