Canvas INSIDE of a Layout???

by Ryan Detwiler » Tue, 09 Nov 2010 02:23:42 GMT

Sponsored Links
 Hellooo.. I need to have a dynamically updateable canvas inside of a
layout. I would prefer having some sort of method to draw to an
imageview, which is displayed in red on the screenshot. It's intended
to be a graph that updates every 5 times/second or so. Any ideas??
I've been searching for hours and can't seem to find some sort of
concrete example. they all make the entire screen a canvas, which
doesn't allow for layouts. Please help, and thanks in advance! :) 


Canvas INSIDE of a Layout???

by Stephen Jungels » Tue, 09 Nov 2010 03:01:38 GMT

 This would be an example of creating a custom component.  It's covered
very well in the docs: 

The requirement for timed updates can be filled by your activity
calling invalidate() on the custom view when needed.



Sponsored Links

Other Threads

1. Finally

To anyone who still cares, I finally published my little flying game.
Rather silly but it was fun to write and taught me a lot.

2. Android. Issue with smooth Animation transition during animation switch


I will describe briefly what I am currently trying to implement:

I have a number of cards (for example 8);
I am trying to do shuffle using Translate Animation.
But in the shuffle process I am experiencing UI issue. I will describe
what kind of issue I have:

card B is moved to new position (position A) using Translate Animation
during this card A is moved to position B using Translate Animation
This like (A B) -> (B A). So we have position swap.

But after this I will probably have (for instance) to swap card B with
another card C. This requires that in onAnimationEnd method of
AnimationListener I will have to set a real card image to do the next

And this action creates effect of flashing.

I have tried to set in animation XML a "fillAfter" flag, this looks
like helps, but I have wrong images during shuffle.
If you remove "fillAfter", after animation ends the image disappears
and only after triggers onAnimationEnd method, so anyway I have a
short time interval when the UI is incorrect.
Could you please advice an idea of possible approach to solve this


3. How to look up position in spinner from string array?

4. android Hello mapview

5. MMS intent

6. Connect Google via WiFi

7. Installing the Android SDK