Android :: Incorrect Clip Rect In OnDraw()?
Apr 8, 2009We came across a strange behavior. The clip rect of our custom view is getting reset to its entire visible region, if we change the value of another view.
View 4 RepliesWe came across a strange behavior. The clip rect of our custom view is getting reset to its entire visible region, if we change the value of another view.
View 4 RepliesIn Android OpenGL ES, I want to be able to switch textures for a given Rectangle. I have one rect and I put two textures, depending on different conditions. I just want to switch between textures.
I followed this code to create the textures: http://blog.poweredbytoast.com/loading-opengl-textures-in-android but it seems that this is only for one texture.
If I use only one texture, it renders fine, but then I don't know how to tell the rect to use another texture (same rect, different texture). Do I do something like "setTexture" with the ID that is generated in loadTextures()? Do I have to have an array with texture names (numbers) that I then change .. I just don't get it..
I want to judge whether the touch point(x, y) is in a region or not, the region is from a stardard rect by rotating specified degrees, from example, rotate 30 degrees. There is a class named Region in Android, but as I researched, it just supports standard rect, is there any other way to judge whether a point is in an acclivitous rect? How to do it?
View 10 Replies View RelatedIn Android OpenGL ES, I want to be able to switch textures for a given Rectangle. I have one rect and I put two textures, depending on different conditions. I just want to switch between textures.
I followed this code to create the textures: link text
and they render fine, but then I don't know how to tell the given rect to use another texture. Do I do something like "setTexture" with the ID that is generated in loadTextures() ? Do I have to have an array with texture names (numbers) that I then change .. I just don't get it..
How can I draw margin for Image by using Rect object (I need also to change the margin color for every image), so in the end I will have a new Image that surrounded by margins.
View 2 Replies View RelatedI have got a problem. How can i create the following rectangle by using Rect class? I mean Diagonal Rectangle. Is it possible through Rect class?? if not then any other way?
View 4 Replies View RelatedI am new to Android development, just reading docs and trying the APIs. I am quit confused how ImageView managed to draw just a part of its content after an invalidate(Rect) invocation.
I've checked ImageView.java, found no other drawing method except onDraw(Canvas), but onDraw(Canvas) only cut the drawable only if it is beyound the view's visible boundary. I also read the implementation of View.invalidate(Rect), I think the key of this function is calling to mParent.invalidateChild(this, r);
However, I think the parent view doesn't know how to draw the child in the given Rect, it finally has to call some method of it child to paint out. Has anybody investigated this part of codes? Would you please give me some guide?
I'm using a class extends with view. I'm using timer in that class. I'm using onTouchEvent() also. I onTouchEvent() I'm using invalidate(). So it is calling onDraw(). When i use invalidate() in Timer. It is not calling onDraw().
View 8 Replies View RelatedI hope this question belongs in the Android Developers and not Android Beginners group but I have a question about ScrollViews. I am currently working with a customized GraphView class and am trying to put it into a ScrollView but it doesn't seem to work. Whenever I run the code, it comes up with a blank screen. I've written the code in XML and also tried to create the ScrollView encapsulating the GraphView programmatically but whenever the code runs, it comes up with just a blank screen and GraphView's onDraw() is never called.Code...
View 2 Replies View RelatedI am trying to draw an animation. To do so I have extended View and overridden the onDraw() method. What I would expect is that each time onDraw() is called the canvas would be in the state that I left it in and I could choose to clear it or just draw over parts of it (This is how it worked when I used a SurfaceView) but each time the canvas comes back already cleared. Is there a way that I can not have it cleared? Or maybe save the previous state into a Bitmap so I can just draw that Bitmap and then draw over top of it?
View 4 Replies View RelatedI can add children just fine, but I'm never getting my custom onDraw() being called. dispatchDraw() gets called, but that seems to have a different canvas (the one that's within the padding. I need to draw on the whole layout area). Is there some flag that needs to get set to get onDraw() called for the layout?
View 1 Replies View RelatedI have a ListView with an adapter attached. In the individual list items are placed views with widgets that continually update themselves within the list. Everything works well except for this case: Touch the list and start scrolling it just before the longTouch event would be thrown. Then lift your finger from the ListView. At this point the widget views in the ListView no longer receive onDraw events in response to the invalidate calls that continue to be made on the ListView. It is like the ListView starting blocking the invalidate calls during the scroll and forgot to re-allow them when the scrolling stopped. If I touch and scroll with out holding or scroll with a fling this does not happen. The ListView will start allowing the onDraw events back through if you touch anywhere in the list. Any ideas on how to help the ListView not block those onDraw calls?
View 3 Replies View RelatedI'm trying to modify the SurfaceView I use for doing a camera preview in order to display an overlaying square. However, the onDraw method of the extended SurfaceView is never called.
View 3 Replies View RelatedThe green plane is shown on the golden-brown surface but when I press a key nothing happens. I want eventually be able to move the plane pressing 4 different keys + another one for shooting but that's easy if I can just get the thing moving in the first place. When I press a key in the emulator, nothing happens at all.
CODE:............................
I have create a subclass of View and overwritten onDraw() - see some test code below. It draws a line consisting of some points. Before the line is drawn the canvas is rotated and restore after the drawing. The angle by which the canvas is rotated increases by 5 degrees every time onDraw() is called. The view is invalidated about once a second causing the view to be redrawn. Due to the rotated canvas the line drawn looks like a clock hand rotating counter-clockwise. This works - but not always. Sometimes the line is not drawn for one or more seconds, although I know from the log statement that onDraw() was called. Sometimes means: The line may be not shown after 8 seconds, then again after 35 seconds and so on. If the canvas is not rotated the problem does not occur. This also happens when I use a SurfaceView instead of a View. It does not only occur in the simulator but also on my G1 - both using Android 1.6.
CODE:.............
YouTube - Google Vs. iPhone clip.mpg
View 2 Replies View RelatedI'm looking for a App, for the Htc Droid Incredible,that is simular to My Media or Download Lite for Iphone.I want to download and save video clips to my phone off the internet.
View 1 Replies View RelatedHow do I set up an audiofile to play when a user touches an image.Where should I store the audio file and what code should I use to actually play the file?I don't want to bring up the MediaPlayer interface or anything like that.
View 1 Replies View RelatedI'm using Android's android.graphics.Canvas class to draw a ring. My onDraw method clips the canvas to make a hole for the inner circle, and then draws the full outer circle over the hole:
clip = new Path();
clip.addRect(outerCircle, Path.Direction.CW);
clip.addOval(innerCircle, Path.Direction.CCW);
canvas.save();
canvas.clipPath(clip);
canvas.drawOval(outerCircle, lightGrey);
canvas.restore();
The result is a ring with a pretty, anti-aliased outer edge and a jagged, ugly inner edge:What can I do to antialias the inner edge?I don't want to cheat by drawing a grey circle in the middle because the dialog is slightly transparent. (This transparency isn't as subtle on on other backgrounds.)
Can anyone shed any light on why I'm unable to click and play a youtube clip on an Android handset when placed inside a webview?I've put a very simple app together (it's being extended, but no right away) and it has a web view assigned using the Android SDK.The rest of the webview works as expected (text, images, css etc), however, the YouTube clips will not show, they just show as black or white rectangles (where the video embed should be).We use the same view to display content on the iPhone app equivalent, without any issues.This is using a basic flash embed, the Safari browser on iPhone converts these to H.264 and plays them nicely in QuickTime.Can Android do the same?
View 4 Replies View Relatedim making an android game and i want to insert a movie clip (.flv) of exlosion into the game, how do i do that?
View 2 Replies View RelatedIs it possible to modify an active call by overlaying a sound track during the call? I looked up the SDK, but couldn't find any api to do this in the documentation. I am trying to investigate the feasibility of playing a previously recorded call/audio clip onto an ongoing call.
View 1 Replies View RelatedI've used the voice recognition feature on Android and I love it. It's one of my customers' most praised features. However, the format is somewhat restrictive. You have to call the recognizer intent, have it send the recording for transcription to google, and wait for the text back. Some of my ideas would require recording the audio within my app and then sending the clip to google for transcription. Is there any way I can send an audio clip to be processed with speech to text?
View 1 Replies View RelatedI have a simple draw application on Canvas. User should be able to draw with a chosen color. On MotionEvent.ACTION_UP, invalidate() is called. Now it redraws previously drawn lines with the current color ( Redrawing the entire drawing with the current color). I do not want to change the color of previously drawn lines. I am not sure what is missing. Can I make it redraw only newly drawn lines?
View 4 Replies View RelatedI'm using the SoundPool to play a series of small audio clips and am having issues with the audio when it starts. I have the audio attached to a button press. When I press the button mulitple times the tick persists. I was wondering if this was the audio file itself or is there something I need to do differently with the SoundPool other than play simply play the clip. These are .ogg files I created using Audacity. When I play them in my dekstop media player, they sound fine.
View 2 Replies View Related've noticed suddenly that I have no sound on any clip playing from a youtube embed. Am I the only one? Thought everything was fine yesterday... Sound settings look ok and Vimeo embeds are working properly. I was checking out this page: [URL] ......
I've restarted the tab, browser, phone etc. What should I do!
I went to play a short vid clip that I had shot with the Dinc (and had fortunately saved to my computer); got the message "the video cannot be played." Rebooted and now the clip has vanished!
View 4 Replies View Relatedi had to replace the LCD and digitizer on my incredible and now it is unresponsive to touch and trackball. the black clip on the left with foam bar tape wont snap down like the other three, so i'm guessing that is the problem.
View 2 Replies View RelatedI just purchased a Droid yesterday and will have it tommorow (upgrading from a Blackberry 8330) and I carry my phone on my hip. I'd prefer a holster over a clip and was wondering what everyone else uses and how do you like your current one? Thanks in advance and add another one to the android converts!
View 14 Replies View RelatedWhen I create an APP for Media test, I'd like to get the duration of tested clip. Nut as the debug result, the duration is different between the 2 methods for many clips.
Method 1:
CODE:.....
Method 2:
CODE:.........
What is the reason? And I checked the result of Method 2 is right when compared with PC result. Is there a bug for MediaMetadataRetriever.extractMetadata (MediaMetadataRetriever.METADATA_KEY_DURATION)?