[android-developers] Re: GridView and BaseAdapter position bug

2009-05-01 Thread Illidane
I have frame animation on each cell. On 30 апр, 18:24, Romain Guy wrote: > Why don't you just use a LayoutAnimation? That's what it's for. > > 2009/4/30 Illidane : > > > > > > > I did that ( write somewhere in getView ) : > > if(position == mGameModel.getCount() - 1) > >(

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-30 Thread Romain Guy
Why don't you just use a LayoutAnimation? That's what it's for. 2009/4/30 Illidane : > > I did that ( write somewhere in getView ) : > if(position == mGameModel.getCount() - 1) >                        (new Timer(false)).schedule(new AnimationTimer(), 10); > > AnimationTimer() just run my animati

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-30 Thread Illidane
mGameModel.getCount() - it's number of Grid elements) On 30 апр, 13:07, Illidane wrote: > I did that ( write somewhere in getView ) : > if(position == mGameModel.getCount() - 1) > (new Timer(false)).schedule(new AnimationTimer(), 10); > > AnimationTimer() just run my anim

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-30 Thread Illidane
I did that ( write somewhere in getView ) : if(position == mGameModel.getCount() - 1) (new Timer(false)).schedule(new AnimationTimer(), 10); AnimationTimer() just run my animation. Without this timer when I was trying to write if(position == mGameModel.getCount() - 1) my a

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-29 Thread Siva Rajaraman
Hello Guys, Even I am facing such a problem, where I need to detect when all the calls to getView() are done. After this I want to perform my animation on only one children in the view. Looks like thr is no straight forward way to detect the completion of getView(). Is there a way by which I can

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-29 Thread Streets Of Boston
Good to hear! I'm curious: what did you do to get around this problem? (yarik may want to know as well :-)) On Apr 29, 11:13 am, Illidane wrote: > No matter.. it's all working now with the GridView, I have fixed that > bug by the hand. > Thank you for your help) > > On 29 апр, 17:07, Streets Of

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-29 Thread Illidane
No matter.. it's all working now with the GridView, I have fixed that bug by the hand. Thank you for your help) On 29 апр, 17:07, Streets Of Boston wrote: > If you have all 100 cells visible at once at all time, the GridView > does not add much functionality (no scrolling necessary), except for

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-29 Thread Streets Of Boston
If you have all 100 cells visible at once at all time, the GridView does not add much functionality (no scrolling necessary), except for selecting cells. I'm not familiar with your app, but i think it would be 'easier' than wrestling with GridView to subclass 'View' (or 'ViewGroup' if you need ad

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-29 Thread Illidane
Extend the GridView or write my own class which will manipulating 100 cells as drawables? On 29 апр, 00:27, Streets Of Boston wrote: > I have to defend Romain here. > The gridview and/or listview is just not designed to do this. You're > trying to put a round peg in a square hole. > > Maybe the

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-28 Thread Streets Of Boston
I have to defend Romain here. The gridview and/or listview is just not designed to do this. You're trying to put a round peg in a square hole. Maybe the decision to use a GridView for your purposes is not a good idea, because of its design that does not fit what you need. If all 100 cells are vi

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-28 Thread Illidane
Thank you for your replying) How I'll know what delay I need to put into the postDelayed? It can be different on real device, or user can run too many apps and my will be running slowly, so getView will be calling too long. On 28 апр, 18:57, Streets Of Boston wrote: > Yikes > > Another opti

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-28 Thread Illidane
Ok-ok, I gotcha what you mean. But with such position to developers you will never make android lead platform. Sory, if I speak the truth boldly. On 28 апр, 19:44, Romain Guy wrote: > No, you are just making assumptions about how it should work. Nowhere > does it say that it should work the way

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-28 Thread yarik...@gmail.com
We have three times same value of pure the magical-generated position and the official answer "it is NOT a bug". Ok, than I am Al Pacino. Why not to post algorithm of position generating? That looks fishy... On Apr 28, 7:44 pm, Romain Guy wrote: > No, you are just making assumptions about how i

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-28 Thread Romain Guy
No, you are just making assumptions about how it should work. Nowhere does it say that it should work the way you want it to work, that's not how it works and that's not how it will work. 2009/4/28 Illidane : > > To Romain Guy: > Ok, I understood that you think that it's NOT a bug and that you >

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-28 Thread Illidane
To Romain Guy: Ok, I understood that you think that it's NOT a bug and that you implement it how you want it be. But I need to say you, that in such situation is very hard, or sometimes is impossible to write good, stable, beauty, useful and competitive apps for Android, not only for me, but for a

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-28 Thread Streets Of Boston
Yikes Another option would be to start a timer at each getView call (using postDelayed and removeCallbacks methods; postDelayd to start timer, removeCallbacks to remove previous timer until the last call to getView). When the last timer times-out (the last non-remove postDelayed), the task (

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-28 Thread Romain Guy
I am from the Google team (and I did implement a lot of GridView and ListView) and it is NOT a bug. GridView and ListView can call getView() out of order and more times than the number of views that will fit on screen, depending how the Grid/ListView is measured/laid out. 2009/4/28 yarik...@gmail

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-28 Thread Illidane
I have tried to do that - doesn't working for me :( Animation is running always without last cell. I think so: In first case there is a '0' at the end of position values. Without your algorithm all 100 animations is running, than without last ( and there is no '0' at the end ). With you alhorithm

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-28 Thread Streets Of Boston
Don't rely on the order in which getView is called. It is not a bug. It is a decision of the design of the grid/list view not to be dependent on the order in which getView is called. Why getView with position '0' is called three times... i don't know. *If* this is a bug, it is only a peformance is

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-28 Thread yarik...@gmail.com
I have exactly same problem. Why do we have 102 values of position when there is only 100 cells displayed on screen? "position is changed like: 0, 0, 1, 2, 3... 99, 0" - what is the cause of that? Can someone from google team answer? That seems to be a bug, very annoying bug. Answer "It's not a bu

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-27 Thread Illidane
There is a way to make GridView without Adapter ( e.g. something like .addView() method ) ? On 27 апр, 21:38, Illidane wrote: > My GridView shows all 100 cells on the screen ( all visible at one > moment ) > and all the animation works fine, and pretty fast ( on all 100 > elements ), > but than

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-27 Thread Illidane
My GridView shows all 100 cells on the screen ( all visible at one moment ) and all the animation works fine, and pretty fast ( on all 100 elements ), but than begin problems with last cell. Animation not child-view's. Each cell is a imageView with animation on it. On 27 апр, 20:43, Streets Of B

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-27 Thread Streets Of Boston
It's not buggy. I use the adapters and grid/list-views in my apps and they work fine. I think they are not designed for your purpose. e.g. If your adapter has 100 elements and the grid/list-view only shows about 15 at a time on the screen, the getView is called about 15 times. Sometimes more time

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-27 Thread Illidane
And you think it's not a bug? where is guarantee that it will work in general? Where adapter takes it's magic number N? On 27 апр, 19:56, Romain Guy wrote: > There is no guarantee it's going to be called N times either. > > 2009/4/27 Illidane : > > > > > > > > > Even with convertView problem is

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-27 Thread Romain Guy
There is no guarantee it's going to be called N times either. 2009/4/27 Illidane : > > Even with convertView problem is still same - last cell is not > animating. > And... you said WHEN getView()... I think it's no matter, matter HOW > MANY times getView() called. > It calls more than 100 times,

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-27 Thread Illidane
Even with convertView problem is still same - last cell is not animating. And... you said WHEN getView()... I think it's no matter, matter HOW MANY times getView() called. It calls more than 100 times, whats very strange. For the first time it's called 102 times and all animations was working. For

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-27 Thread Romain Guy
You should ALWAYS reuse the convertView, oherwise you're gonna eat up memory and just slow down your app. And like I said, there is no guarantee on how and when getView() is called so you cannot rely on it with your anim counter. 2009/4/27 Illidane : > > I dont use convertView parametr and return

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-27 Thread Illidane
I dont use convertView parametr and return new child-view. Each cell has an animation. In the getView I generate an array of animations, wich I start when the adapter stops his work ( e.g. when my mAnimCounter == 102 ( but need be max 100, lol ) When I run app, all 100 cells are animated. But whe

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-27 Thread Streets Of Boston
The child/item-views in list-views and grid-views are re-used (convertView input parameter). I suspect that depending on the layout/ measurements/visibility of the child-views and the way you implement getView (re-using convertView or ignoring it and returning a brand-new child-view every time), t

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-27 Thread Illidane
Why number of getView calls is different?? One time it's 102 ( but need to be 100 ) and the second and greater is 101. On 27 апр, 18:15, Romain Guy wrote: > It's not a bug. There's no guarantee in the order of the calls wrt to > the position value. It also depends on how the GridView is > measur

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-27 Thread Romain Guy
It's not a bug. There's no guarantee in the order of the calls wrt to the position value. It also depends on how the GridView is measured/laid out. On Mon, Apr 27, 2009 at 6:38 AM, Illidane wrote: > > Hi, > I'm using GridView in my app, and myAdapter ( extends BaseAdapter) for > it. I have overr