Use Gesture to control – Pull down - Add – Tap - Edit – Left Swipe - Delete – Right Swipe - Mark as Done – Long Press - Re-order (Drag and Drop) • http://www.realmacsoftware.com/clear/
scroll to any position • No animation when updating (not common) • No drag and drop method (not common) • Lack of control in ListView – Update is performed by Listview (by calling notifyDataChanged()) – Only have onTouchDown(), onTouchUp(), onTouchMove() • How to detect long press?? • Special Case: Media Player Playlist, Any. Do
• When touch the icon – Convert the touch item view into a drawable – Set the drawable to the your finger position • Bitmap bitmap = Bitmap.createBitmap(item.getDrawingCache()); • Remark: Need to substract the offset • So... – What you are dragging is an image, not a view. – Just use visual effect to simulate drag-and- drop
false – Post a runnable and set it to be run after a few sec. • onTouchUp() – Stop the timer • onTouchDown() – Stop the timer Touch Event Touch Event Run runnables ... UIThread/Main Thread Remark: Do not block the UI thread!! Perform High Computation Complexity Task in background thread!!
:= false – downTs := timestamp • onTouchMove() – If(currentTs – downTs > T and displacement <D) • LongPressed := true • Why onTouchMove()? – It is hard to fix your finger on a point • Varying pressure and location – Always trigger onTouchMove()
A framework – Provides lots of functionality for gaming • Box2d – popular and used to simulate physic • Opengl – for drawing • Collision detection • EaseAction – simulate human body movement, e.g. walking • … (depends on what game engine you use) • Example – ka3d – 3D renderer of “Angry birds” – WiEngine – Game Engine of “Cut the rope”
• for simulating physical world • make objects move in believable ways and make the game world more interactive • from the game engine’s point of view, just a system for procedural animation • http://youtu.be/T99YX8Umj4Y?t=16s
each task as an object in a physical “world” – Set the gravity of this world to up • Tasks will be aligned upward automagically – Create a “elastic string” to pull back the task when swipping • Thus, let game engine calculate all movements
pause() Initialization Update ”object” location Draw on the surface Roughly speaking, game engine keeps calling render(). Developers need to handle different inputs to control the objects' state and switch screen (e.g. switch from menu to game screen, or game screen to game over screen)
using libgdx audio modle – Sound • for sound effect, e.g. a zombie's head exploding. • usually short, in the range of seconds • are loaded and decoded to RAM – Music • for longer sounds, e.g. Background music • is streamed, only partially loaded into RAM – supports MP3, Ogg and Wave files
HTML5, java/desktop, Android – Can do testing on Desktop • Cons: – Not much unicode support • especially for output (major problem, still solving) – Not easy to integrate with native system • eg. hard to add extra views