[android-developers] Re: flashing element in ArrayAdapter

2010-09-12 Thread Kumar Bibek

Sure, But, you will have to implement your own adapter if you would
like to do this.

You can change the particular items background for sometime and
restore it. Simple I guess.


-Kumar Bibek
http://techdroid.kbeanie.com

On Sep 12, 8:19 pm, Simone simone.russ...@gmail.com wrote:
 I have an ArrayAdapter in my activity, and when a certain event occur,
 I'd like to make a specific element flash, or have it highlighted in
 some way for a couple of seconds.
 Is there a way to do that?
 Thanks,
 Simone

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: flashing element in ArrayAdapter

2010-09-12 Thread Simone
My class already extends ArrayAdapter.
I was just wondering how can I retrieve a list of all the Views
contained in the adapter, or if I had to keep track of them myself.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: flashing element in ArrayAdapter

2010-09-12 Thread Simone
Allright, I solved it.
I made it so that the array adapter contains the list of the Views,
and the getView() method simply returns list.get(position).
I make the View flash by switching its visibility between VISIBLE and
INVISIBLE for a second every 100ms, and it looks pretty decent.
Thanks
Simone

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: flashing element in ArrayAdapter

2010-09-12 Thread Mark Murphy
On Sun, Sep 12, 2010 at 12:34 PM, Simone simone.russ...@gmail.com wrote:
 Allright, I solved it.
 I made it so that the array adapter contains the list of the Views,
 and the getView() method simply returns list.get(position).
 I make the View flash by switching its visibility between VISIBLE and
 INVISIBLE for a second every 100ms, and it looks pretty decent.

This will be a significant memory hog unless it is a very short list
(i.e., all Views are visible in the ListView).

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: flashing element in ArrayAdapter

2010-09-12 Thread Simone
Well, the view isn't long (average 5 elements, maximum 20).
What do you suggest?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: flashing element in ArrayAdapter

2010-09-12 Thread Simone
I meat the list of course, not view :D

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: flashing element in ArrayAdapter

2010-09-12 Thread Mark Murphy
On Sun, Sep 12, 2010 at 12:52 PM, Simone simone.russ...@gmail.com wrote:
 Well, the view isn't long (average 5 elements, maximum 20).
 What do you suggest?

Other than rethink your approach, I don't have a suggestion off the
top of my head. I'm just telling you that if your maximum goes from 20
to 2000, and the user scrolls to the bottom, you're going to have
memory problems.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: flashing element in ArrayAdapter

2010-09-12 Thread TreKing
On Sun, Sep 12, 2010 at 11:52 AM, Simone simone.russ...@gmail.com wrote:

 What do you suggest?


Try 
thishttp://developer.android.com/reference/android/widget/AdapterView.html#getFirstVisiblePosition%28%29and
thishttp://developer.android.com/reference/android/widget/AdapterView.html#getLastVisiblePosition%28%29to
determine what's actually visible on the screen and flash those as
necessary.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: flashing element in ArrayAdapter

2010-09-12 Thread Simone
Ok, thanks. But I can say for sure that the list is not gonna be 2000
items long ;)
Simone

On 12 Set, 19:00, Mark Murphy mmur...@commonsware.com wrote:
 On Sun, Sep 12, 2010 at 12:52 PM, Simone simone.russ...@gmail.com wrote:
  Well, the view isn't long (average 5 elements, maximum 20).
  What do you suggest?

 Other than rethink your approach, I don't have a suggestion off the
 top of my head. I'm just telling you that if your maximum goes from 20
 to 2000, and the user scrolls to the bottom, you're going to have
 memory problems.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 Android Training...At Your Office:http://commonsware.com/training

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: flashing element in ArrayAdapter

2010-09-12 Thread Kostya Vasilyev

 Simone,

ListView has methods for getting indices of first / last visible item. 
Since only a few can fit on the screen, doing a linear search to find 
the right list item is still pretty efficient.


-- Kostya

13.09.2010 0:23, Simone пишет:

Ok, thanks. But I can say for sure that the list is not gonna be 2000
items long ;)
Simone

On 12 Set, 19:00, Mark Murphymmur...@commonsware.com  wrote:

On Sun, Sep 12, 2010 at 12:52 PM, Simonesimone.russ...@gmail.com  wrote:

Well, the view isn't long (average 5 elements, maximum 20).
What do you suggest?

Other than rethink your approach, I don't have a suggestion off the
top of my head. I'm just telling you that if your maximum goes from 20
to 2000, and the user scrolls to the bottom, you're going to have
memory problems.

--
Mark Murphy (a Commons 
Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

Android Training...At Your Office:http://commonsware.com/training



--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en