[android-developers] drawBitmapMesh: How to draw a bitmap transformed to fit a shape?

2010-07-02 Thread droidful
Hi, I want to draw a bitmap into a shape (in this case an isosceles trapezoid); not clipped, but with the bitmap transformed to fit the shape. For example, if the height of the left side is greater than that of the right side then I want the bitmap evenly transformed in height from left to right

[android-developers] Re: Example gallery style view with fling, bounce, animation, etc

2010-07-02 Thread droidful
Hi Neilz, I dont quite follow the problem; if you can elaborate I would be very keen to investigate. Does your gallery represent a single view showing five different sets of data; or are five different views being included in the gallery? I would expect that only three views are ever created;

[android-developers] Re: drawBitmapMesh: How to draw a bitmap transformed to fit a shape?

2010-07-02 Thread droidful
It seems one again I have answered my own question. I still dont understand how drawBitmapMesh works but I can achieve what I want to by using the Camera object. The Camera object allows you to rotate 2D objects in 3D space. The following code snippet (very much test code) demonstrates what is

[android-developers] Re: Example gallery style view with fling, bounce, animation, etc

2010-06-20 Thread droidful
Hi, my apologies, but there is a serious bug in the FlingGallery code which results in views not being recycled. The offending function is shown below. As can be seen the line mExternalView = mInvalidLayout occurs before the call to adapter.getView, which means that in adapter.getView the value of

[android-developers] Re: Example gallery style view with fling, bounce, animation, etc

2010-06-20 Thread droidful
package com.droidful.flinggallery; import android.content.Context; import android.view.GestureDetector; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import

[android-developers] Re: Example gallery style view with fling, bounce, animation, etc

2010-06-15 Thread droidful
The new code posted below works in the 1.5 emulator. Bear in mind this is an example born of my own investigations and therefore does not contain exception handling, robustness, etc. Such as it is I hope you find it helpful. -- You received this message because you are subscribed to the Google

[android-developers] Re: Example gallery style view with fling, bounce, animation, etc

2010-06-15 Thread droidful
package com.droidful.flinggallery; import android.content.Context; import android.view.GestureDetector; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import

[android-developers] Re: Example gallery style view with fling, bounce, animation, etc

2010-06-15 Thread droidful
package com.droidful.flinggallery; import android.app.Activity; import android.os.Bundle; import android.content.Context; import android.graphics.Color; import android.view.Gravity; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import

[android-developers] Re: Example gallery style view with fling, bounce, animation, etc

2010-06-15 Thread droidful
Hi Nik, no known issues, but I pretty much posted it as soon as the initial prototype was complete, so I guess we shall see. If I had to guess at where issues might arise I would be looking at failure to release resources (maybe thats my windows background speaking, I dont yet fully understand

[android-developers] Re: Example gallery style view with fling, bounce, animation, etc

2010-06-15 Thread droidful
Hi Neilz, this is the only thing I have posted to date. I have PM'd you a variation on the original fling gallery activity which includes embedding a standard view inside a custom drawn view (onDispatchDraw) which is kinda useful. Its no big deal, just adds a pretty border to the views being shown

[android-developers] Re: Gallery elasticity at the ends

2010-06-14 Thread droidful
Hi Nik, thanks for posting the sample code. I used a lot of that when working on my own project. If your interested I have posted up some sample code that does a similar thing in a different way (gets round some problems I had with Gallery) at

[android-developers] Re: Example gallery style view with fling, bounce, animation, etc

2010-06-14 Thread droidful
package com.droidful.flinggallery; import android.content.Context; import android.view.GestureDetector; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.WindowManager; import android.view.animation.Animation; import

[android-developers] Re: Example gallery style view with fling, bounce, animation, etc

2010-06-14 Thread droidful
package com.droidful.flinggallery; import android.app.Activity; import android.os.Bundle; import android.content.Context; import android.graphics.Color; import android.view.Gravity; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import

[android-developers] Example gallery style view with fling, bounce, animation, etc

2010-06-14 Thread droidful
In my other topics about animation methods and problems with gallery views I made mention of writing my own gallery view. I'm pretty new to Android but I found some helpful posts and helpful people on this group so I am posting up my code for the benefit of anyone who is curious. Feel free to

[android-developers] Re: Example gallery style view with fling, bounce, animation, etc

2010-06-14 Thread droidful
//(edit: removed complexities around fling velocity and transitions; now just decelerates like the standard gallery) package com.droidful.flinggallery; import android.content.Context; import android.view.GestureDetector; import android.view.KeyEvent; import android.view.MotionEvent; import

[android-developers] Re: Example gallery style view with fling, bounce, animation, etc

2010-06-14 Thread droidful
By the way, I am just updating the FlingGallery class so that you cant scroll faster than the fling animation velocity. This will make for a smoother UI on fling (at the moment the scroll happens really fast then the animated fling is slower so it looks a bit jerky). -- You received this message

[android-developers] Re: Example gallery style view with fling, bounce, animation, etc

2010-06-14 Thread droidful
I have updated the class to improve the UI. There is still one glitch I am working on. When you do a fling gesture there is a slight pause before the fling animates, this is caused when the outgoing view attempts to recycle from the adapter, it only takes a fraction of a second but it is

[android-developers] Re: Example gallery style view with fling, bounce, animation, etc

2010-06-14 Thread droidful
package com.droidful.flinggallery; import android.content.Context; import android.util.Log; import android.view.GestureDetector; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.animation.Animation; import

[android-developers] Re: Gallery elasticity at the ends

2010-06-14 Thread droidful
Sorry about that, correct link is http://groups.google.com/group/android-developers/browse_thread/thread/27d5f678be44c370/3f5ec157b3717e3f#3f5ec157b3717e3f. -- 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] Re: Example gallery style view with fling, bounce, animation, etc

2010-06-14 Thread droidful
Hmm. Im developing on 2.2 on a google nexus one. To be honest with you I dont have the experience to know what is or isnt going to work on different versions. If I get some time I can try compiling against an older SDK. I also didnt set a version requirement in the manifest so it might be crashing

[android-developers] Re: What is best method for an animation worker thread?

2010-06-13 Thread droidful
Hi pskink. I initially used Animations by setting dynamically configured animations on the views I wanted to move around and then starting the animations. The problem I found was that in the case where part of the view is outside the display area as it animates back into the display area the part

[android-developers] Re: What is best method for an animation worker thread?

2010-06-13 Thread droidful
Ok, looks like I might be being a noob. I might be able to do something with getTransformation. Ill look into it. -- 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

[android-developers] Re: What is best method for an animation worker thread?

2010-06-13 Thread droidful
Thanks skink, works a treat. I extended Animation and applied my animations in the applyTransformation method (without calling the super). Basically the code I already had just slotted straight in. Cheers! -- You received this message because you are subscribed to the Google Groups Android

[android-developers] Example gallery style view with fling, bounce, animation, etc.

2010-06-13 Thread droidful
In my other topics about animation methods and problems with gallery views I made mention of writing my own gallery view. I'm pretty new to Android but I found some helpful posts and helpful people on this group so I am posting up my code for the benefit of anyone who is curious. Feel free to

[android-developers] Re: Soft keyboard “del” key fails in EditText on Gallery widget

2010-06-12 Thread droidful
Why I am calling this thing a gallery 'widget'? Thats kinda wrong. Anyway, so I ended up writing my own gallery style view class based on frame layout. Its pretty much exactly like gallery view but whoa and behold the edittext's work just fine. Interestingly I noticed that the default long click

[android-developers] What is best method for an animation worker thread?

2010-06-12 Thread droidful
In solving another problem I had I have written a gallery style view based on framelayout which supports fling, animated transitions, adapters, etc. Ill post it up as an example soon. But for now im not really sure I have used the best approach for running the animation threads. I decided to use

[android-developers] Re: What is best method for an animation worker thread?

2010-06-12 Thread droidful
I changed the logic of the asyncTask to be based on time rather than point position, at least now I dont have a sleep but it would probably hammer the UI thread. But I guess thats what I want to get smooth animation. Should this be in the beginners thread? Anyway here is the new pseudo-code:

[android-developers] Re: Soft keyboard “del” key fails in EditText on Gallery widget

2010-06-11 Thread droidful
Is anyone able to run the little applications I included above? I would love to know if it is just me with this problem or if it is a wider issue with the OS or my code. I am considering a re-write to ditch the gallery widget, but I kinda like the UI effect I am getting with the gallery widget; I

[android-developers] Soft keyboard “del” key fai ls in EditText on Gallery widget

2010-06-07 Thread droidful
Hi, I am developing an application in Eclipse build ID 20090920-1017 using android SDK 2.2 and testing on a Google Nexus One. For the purposes of the tests below I am using the IME Android keyboard on a non-rooted phone. I have an EditText widget which exhibits some very strange behavior. I can