[android-developers] Reusing bitmaps for BitmapFactory.decodeFile and BitmapFactory.Options.inBitmap
My app decodes a lot of bitmaps from sd card, so I want to reuse existing bitmaps to decrease GC work. I see examples from Android Traininghttp://developer.android.com/training/displaying-bitmaps/manage-memory.html#inBitmapand this video http://www.youtube.com/watch?v=rsQet4nBVi8 http://savefrom.net/?url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DrsQet4nBVi8utm_source=chromeliteutm_medium=extensionsutm_campaign=link_modifierand it works perfect for BitmapFactory.decodeResourcehttp://developer.android.com/reference/android/graphics/BitmapFactory.html#decodeResource%28android.content.res.Resources,%20int,%20android.graphics.BitmapFactory.Options%29, but not for BitmapFactory.decodeFilehttp://developer.android.com/reference/android/graphics/BitmapFactory.html#decodeFile%28java.lang.String,%20android.graphics.BitmapFactory.Options%29. I use next code: private void testBitmapReusing() { BitmapFactory.Options options = newOptions(); Bitmap bitmap = decode(options); options.inBitmap = bitmap; bitmap = decode(options); } private BitmapFactory.Options newOptions() { BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = 1; options.inMutable = true; return options; } private Bitmap decode(BitmapFactory.Options options) { return BitmapFactory.decodeFile(/mnt/sdcard/sun.jpg, options); // return BitmapFactory.decodeResource(getResources(), R.drawable.sun, options); } Commented code (BitmapFactory.decodeResource) works as expected, it decodes new bitmap using existing bitmap. But uncommented code (BitmapFactory.decodeFile) doesn't decode new bitmap. It just writes to log message E/BitmapFactory: Unable to decode stream: java.lang.IllegalArgumentException: Problem decoding into existing bitmap So where is my mistake? -- 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 unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Error when I take screenshot from IDE: void __egl_platform_dequeue_buffer .
I use a simple pygame script from here: http://pygame-catalin.blogspot.ro/2013/08/pygame-first-interface-part-4.html . When I want to make a screenshot using android-studio of this game. This is the error show by Android-Studio in log: 08-15 15:16:24.5302628-2647/? E/: void __egl_platform_dequeue_buffer(egl_surface*):1080 [EGL-ERROR] failed to dequeue buffer from native window (0x19cf18); err = -19, buf = 0x008-15 15:16:24.540 116-116/? E/SurfaceTexture: [SurfaceView] dequeueBuffer: SurfaceTexture has been abandoned!08-15 15:16:24.5402628-2647/? E/: void __egl_platform_dequeue_buffer(egl_surface*):1080 [EGL-ERROR] failed to dequeue buffer from native window (0x19cf18); err = -19, buf = 0x008-15 15:16:24.540 116-130/? E/SurfaceTexture: [SurfaceView] dequeueBuffer: SurfaceTexture has been abandoned!08-15 15:16:24.5402628-2647/? E/: void __egl_platform_dequeue_buffer(egl_surface*):1080 [EGL-ERROR] failed to dequeue buffer from native window (0x19cf18); err = -19, buf = 0x008-15 15:16:24.540 116-136/? E/SurfaceTexture: [SurfaceView] dequeueBuffer: SurfaceTexture has been abandoned!08-15 15:16:24.5402628-2647/? E/: void __egl_platform_dequeue_buffer(egl_surface*):1080 [EGL-ERROR] failed to dequeue buffer from native window (0x19cf18); err = -19, buf = 0x008-15 15:16:24.550 116-2307/? E/SurfaceTexture: [SurfaceView] dequeueBuffer: SurfaceTexture has been abandoned! Any idea about this error? -- 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 unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [android-developers] Reusing bitmaps for BitmapFactory.decodeFile and BitmapFactory.Options.inBitmap
Here is what the documentation says: The current implementation necessitates that the reused bitmap be mutable and of the same size as the source content. Make sure the bitmap you are reusing is mutable. On Sat, Aug 24, 2013 at 12:07 AM, danik danik...@gmail.com wrote: My app decodes a lot of bitmaps from sd card, so I want to reuse existing bitmaps to decrease GC work. I see examples from Android Traininghttp://developer.android.com/training/displaying-bitmaps/manage-memory.html#inBitmapand this video http://www.youtube.com/watch?v=rsQet4nBVi8 http://savefrom.net/?url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DrsQet4nBVi8utm_source=chromeliteutm_medium=extensionsutm_campaign=link_modifierand it works perfect for BitmapFactory.decodeResourcehttp://developer.android.com/reference/android/graphics/BitmapFactory.html#decodeResource%28android.content.res.Resources,%20int,%20android.graphics.BitmapFactory.Options%29, but not for BitmapFactory.decodeFilehttp://developer.android.com/reference/android/graphics/BitmapFactory.html#decodeFile%28java.lang.String,%20android.graphics.BitmapFactory.Options%29. I use next code: private void testBitmapReusing() { BitmapFactory.Options options = newOptions(); Bitmap bitmap = decode(options); options.inBitmap = bitmap; bitmap = decode(options); } private BitmapFactory.Options newOptions() { BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = 1; options.inMutable = true; return options; } private Bitmap decode(BitmapFactory.Options options) { return BitmapFactory.decodeFile(/mnt/sdcard/sun.jpg, options); // return BitmapFactory.decodeResource(getResources(), R.drawable.sun, options); } Commented code (BitmapFactory.decodeResource) works as expected, it decodes new bitmap using existing bitmap. But uncommented code (BitmapFactory.decodeFile) doesn't decode new bitmap. It just writes to log message E/BitmapFactory: Unable to decode stream: java.lang.IllegalArgumentException: Problem decoding into existing bitmap So where is my mistake? -- 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 unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Romain Guy Android framework engineer romain...@android.com -- 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 unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: No sound card access on Jelly bean?
I have some music visualizer apps. They have internal players, where the music visualization still works. The apps also use the sound for external players, like Spotify and Winamp. The apps could visualize the sound from these before, but it does not work on Jelly bean. I have played music with external players, while debugging the apps. The bytes in the updateVisualizerFFT method of OnDataCaptureListener are always 0 for external players, when a visualizer is created with 0 as an argument: new Visualizer(0); Creating a Visualizer with 0 as an argument means that the visualizer will be attached to the MediaPlayer or AudioTrack in the same audio session: http://developer.android.com/reference/android/media/audiofx/Visualizer.html#Visualizer(int) The bytes in the updateVisualizerFFT method are 0 and this results in no visualization, since there is no signal to use for visualization. No error message or any other information that I can use is generated from logCat. On Friday, August 23, 2013 5:55:03 PM UTC+2, MobileVisuals wrote: My apps can not get access to sounds from other apps on Jelly bean. The sound value that I get is always 0. I have added every possible permission. What can I do to fix this? -- 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 unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: Detect a gesture startet from the outside of a view
Little search showed that ACTION_CANCEL is the right value to get from the system, but the (X,Y) values on this event are not proportional to the gesture I made :S Y values are way bigger than expected I did expand the HitRect size, but it's still too big On Friday, August 23, 2013 10:24:03 PM UTC+3, OronS wrote: Hi :) Thanks for your post I'm trying to implement specific gesture between images...no drag drop The images are inside *GestureOverlayView (because of prediction = gestureLibrary.recognize()...I don't know how to recognize a gestures which have curls or shapes)*, and I thought the parent intercepts touch event automatically (by automatically I mean set the OnTouch listener to the parent). Don't you think inheritance is wrongly used in this case?? Anyway..I used *gestureOverlayView.setOnTouchListener* to intercept touch events on children, and *gestureOverlayView.addOnGesturePerformedListener*to check whether the gesture was recognized, and user's finger passed through both images. The problem now is that in *gestureOverlayView.setOnTouchListener,*instead of ACTION_UP, I get ACTION_CANCEL :S I don't know if it should be like that On Friday, August 23, 2013 6:17:23 PM UTC+3, Nobu Games wrote: Is it just gestures or are you trying to implement drag and drophttp://developer.android.com/guide/topics/ui/drag-drop.html(because it sounds like that). Either way you could just intercept motion events in the parent view group that contains your images and let it handle your gesture recognition. So let's say you create a derivative class L of your layout that contains the image views. You could override dispatchTouchEvent(MotionEvent)http://developer.android.com/reference/android/view/ViewGroup.html#dispatchTouchEvent%28android.view.MotionEvent%29of L and check for the following motion event states: *1. Gesture started (ACTION_DOWN)* Iterate your list of ImageView children of L and see if the touch event point is in one of them. If yes, your gesture starts. The View class has the method getGlobalVisibleRect(Rect, Point)http://developer.android.com/reference/android/view/View.html#getGlobalVisibleRect(android.graphics.Rect,%20android.graphics.Point)which can be used for checking if your touch event coordinate hits one of your image views. It would roughly look like the following (not tested since I'm not sure if these methods return locations in screen or window coordinate system, you may need to debug it): *Rect* r = new *Rect*();* *// should be class member you can reuse float x = motionEvent.getRawX(); float y = motionEvent.getRawY(); *for*(*ImageView* iv : imageViews) { iv.getGlobalVisibleRect(r); *if*(r.contains(x, y)) { // Touch event is inside image view } } *2. Gesture ongoing (ACTION_MOVE)* If you visualize your gesture by drawing some trail or moving around the first touched image view then this is the right point to do so. Here you can update your view(s). *3. Gesture finished (ACTION_UP)* Here you need to iterate your ImageView children again in order to see if the finger has been lifted over another image view. In that case your gesture was successful. *4. Gesture canceled (ACTION_CANCEL)* Whatever your gesture is doing should be canceled here. On Friday, August 23, 2013 1:21:59 AM UTC-5, OronS wrote: Hi there [image: :)] I have two ImageViews in my app. I've added a gesture detector (GestureOverlayView), and added gestures to the app by using android's sample, which record gestures and save them to a file, and I then load this file. My Goal is to limit the gestures area.. I want them to start from one ImageView, and end on the other. I didn't find anything on google!! : / I've added OnTouch listener to both images, but I don't know how to detect a gesture coming from the outside of a View. I can detect a gesture starts from one Image (Down event), but when my finger goes over the second and then go up, the event triggered is Cancel on the first image Please Help Thanks, Oron -- 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 unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [android-developers] Reusing bitmaps for BitmapFactory.decodeFile and BitmapFactory.Options.inBitmap
Bitmap is mutable, because I decode it with option inMutable=true. Bitmaps have same size, because I decode the same file. But your answer forces me to read docs more carefully and I realize my fail! The docs says: The source content must be in* jpeg or png* format (whether as a resource or as a stream) OMG! My images have GIF format. By the way thanks! суббота, 24 августа 2013 г., 11:28:33 UTC+3 пользователь Romain Guy (Google) написал: Here is what the documentation says: The current implementation necessitates that the reused bitmap be mutable and of the same size as the source content. Make sure the bitmap you are reusing is mutable. On Sat, Aug 24, 2013 at 12:07 AM, danik dani...@gmail.com javascript:wrote: My app decodes a lot of bitmaps from sd card, so I want to reuse existing bitmaps to decrease GC work. I see examples from Android Traininghttp://developer.android.com/training/displaying-bitmaps/manage-memory.html#inBitmapand this video http://www.youtube.com/watch?v=rsQet4nBVi8 http://savefrom.net/?url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DrsQet4nBVi8utm_source=chromeliteutm_medium=extensionsutm_campaign=link_modifierand it works perfect for BitmapFactory.decodeResourcehttp://developer.android.com/reference/android/graphics/BitmapFactory.html#decodeResource%28android.content.res.Resources,%20int,%20android.graphics.BitmapFactory.Options%29, but not for BitmapFactory.decodeFilehttp://developer.android.com/reference/android/graphics/BitmapFactory.html#decodeFile%28java.lang.String,%20android.graphics.BitmapFactory.Options%29. I use next code: private void testBitmapReusing() { BitmapFactory.Options options = newOptions(); Bitmap bitmap = decode(options); options.inBitmap = bitmap; bitmap = decode(options); } private BitmapFactory.Options newOptions() { BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = 1; options.inMutable = true; return options; } private Bitmap decode(BitmapFactory.Options options) { return BitmapFactory.decodeFile(/mnt/sdcard/sun.jpg, options); // return BitmapFactory.decodeResource(getResources(), R.drawable.sun, options); } Commented code (BitmapFactory.decodeResource) works as expected, it decodes new bitmap using existing bitmap. But uncommented code (BitmapFactory.decodeFile) doesn't decode new bitmap. It just writes to log message E/BitmapFactory: Unable to decode stream: java.lang.IllegalArgumentException: Problem decoding into existing bitmap So where is my mistake? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-d...@googlegroups.comjavascript: To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- Romain Guy Android framework engineer roma...@android.com javascript: -- 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 unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: Your apps portfolio
I use about.me but not for showing a portfolio. But you can of course, why not. Right now I show my work on LinkedIn, in my case with a link to my app on Play and with a Google Drive presentation with screeshots of an app I made for a client (in PDF form). El viernes, 23 de agosto de 2013 09:10:48 UTC-3, Lucas Diego escribió: Hi everybody, I'd like to know how you usually shows your app you have worked on to your future clients? Does someone use, have used or recommends https://about.me as a professional portfolio? Would you share your opinion about this subject? Thaks -- 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 unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: Designing Help into Your App
What I've done in one of my apps is to take advantage of a Google Drive presentation I did for my client showing all the app's features, and put them in the form of PNG files inside an ImageSwitcher. This ImageSwitcher lives inside a DialogFragment shown upon selecting Help from the ActionBar. Hope this helps. José https://play.google.com/store/apps/details?id=com.josegd.monthcalwidget El miércoles, 21 de agosto de 2013 20:09:14 UTC-3, Nathan escribió: I've been thinking about ways to integrate help into an app. I wanted to see what other people have done. http://developer.android.com/design/patterns/help.html Context sensitive, at a minimum, per screen, and possibly point to certain buttons using a PopupWindow to point out something like This button will . . . . What have you done and how well has it worked? I could imagine there are some frameworks or open source project already. I've thought about using the following technologies. - A bunch of formatted strings with basic tags in string tags. - A webview in a non full screen activity, displaying one or many simply html files from the res folder (this can't be in assets - in needs to be localized). - A popupwindow, using showasDropDown, to anchor it to another view or button that I want the help to be related to. Nathan -- 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 unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: Detect a gesture startet from the outside of a view
You could still try the approach I described by getting rawX and rawY from the motion event and match it with the global rect position of the target view. Motion event coordinates are usually in a local coordinate system. I guess the local coordinate system is the one of the ImageView you start your gesture with, hence the too big numbers when you get your ACTION_CANCEL on the other view. On Saturday, August 24, 2013 5:19:04 AM UTC-5, OronS wrote: Little search showed that ACTION_CANCEL is the right value to get from the system, but the (X,Y) values on this event are not proportional to the gesture I made :S Y values are way bigger than expected I did expand the HitRect size, but it's still too big On Friday, August 23, 2013 10:24:03 PM UTC+3, OronS wrote: Hi :) Thanks for your post I'm trying to implement specific gesture between images...no drag drop The images are inside *GestureOverlayView (because of prediction = gestureLibrary.recognize()...I don't know how to recognize a gestures which have curls or shapes)*, and I thought the parent intercepts touch event automatically (by automatically I mean set the OnTouch listener to the parent). Don't you think inheritance is wrongly used in this case?? Anyway..I used *gestureOverlayView.setOnTouchListener* to intercept touch events on children, and * gestureOverlayView.addOnGesturePerformedListener* to check whether the gesture was recognized, and user's finger passed through both images. The problem now is that in *gestureOverlayView.setOnTouchListener,*instead of ACTION_UP, I get ACTION_CANCEL :S I don't know if it should be like that On Friday, August 23, 2013 6:17:23 PM UTC+3, Nobu Games wrote: Is it just gestures or are you trying to implement drag and drophttp://developer.android.com/guide/topics/ui/drag-drop.html(because it sounds like that). Either way you could just intercept motion events in the parent view group that contains your images and let it handle your gesture recognition. So let's say you create a derivative class L of your layout that contains the image views. You could override dispatchTouchEvent(MotionEvent)http://developer.android.com/reference/android/view/ViewGroup.html#dispatchTouchEvent%28android.view.MotionEvent%29of L and check for the following motion event states: *1. Gesture started (ACTION_DOWN)* Iterate your list of ImageView children of L and see if the touch event point is in one of them. If yes, your gesture starts. The View class has the method getGlobalVisibleRect(Rect, Point)http://developer.android.com/reference/android/view/View.html#getGlobalVisibleRect(android.graphics.Rect,%20android.graphics.Point)which can be used for checking if your touch event coordinate hits one of your image views. It would roughly look like the following (not tested since I'm not sure if these methods return locations in screen or window coordinate system, you may need to debug it): *Rect* r = new *Rect*();* *// should be class member you can reuse float x = motionEvent.getRawX(); float y = motionEvent.getRawY(); *for*(*ImageView* iv : imageViews) { iv.getGlobalVisibleRect(r); *if*(r.contains(x, y)) { // Touch event is inside image view } } *2. Gesture ongoing (ACTION_MOVE)* If you visualize your gesture by drawing some trail or moving around the first touched image view then this is the right point to do so. Here you can update your view(s). *3. Gesture finished (ACTION_UP)* Here you need to iterate your ImageView children again in order to see if the finger has been lifted over another image view. In that case your gesture was successful. *4. Gesture canceled (ACTION_CANCEL)* Whatever your gesture is doing should be canceled here. On Friday, August 23, 2013 1:21:59 AM UTC-5, OronS wrote: Hi there [image: :)] I have two ImageViews in my app. I've added a gesture detector (GestureOverlayView), and added gestures to the app by using android's sample, which record gestures and save them to a file, and I then load this file. My Goal is to limit the gestures area.. I want them to start from one ImageView, and end on the other. I didn't find anything on google!! : / I've added OnTouch listener to both images, but I don't know how to detect a gesture coming from the outside of a View. I can detect a gesture starts from one Image (Down event), but when my finger goes over the second and then go up, the event triggered is Cancel on the first image Please Help Thanks, Oron -- 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 unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are
[android-developers] Does android emulator support ES 3.0?
Hi seems new Android 4.3 supports OGL ES 3.0 and new NDK also.. does android emulator from sdk support native ES 3.0 assuming a recent GPU and drivers on host (say OpenGL 4.3 drivers).. if not it's coming soon? -- 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 unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: Detect a gesture startet from the outside of a view
I did a combination.. I've created a subclass of GestureOverlayView as you have suggested, and then the approach with dispatchTouchEvent(MotionEvent)http://developer.android.com/reference/android/view/ViewGroup.html#dispatchTouchEvent%28android.view.MotionEvent%29didn't work. One problem was the big numbers, and the second one was that important callbacks like *OnGesturePerformedListener* that used for gesture recognition at the end of the user's motion, were not called at all...probably because of the Gesture\Touch system, which intercepts one another :) The final result was that the subclass also implemented *OnGestureListener*which has 4 methods: @Override public void onGesture(GestureOverlayView overlay, MotionEvent event) @Override public void onGestureCancelled(GestureOverlayView overlay, MotionEvent event) @Override public void onGestureEnded(GestureOverlayView overlay, MotionEvent event) @Override public void onGestureStarted(GestureOverlayView overlay, MotionEvent event) Then I could control the beginning and the ending of the gesture, and * OnGesturePerformedListener* did called, and performed it's actions from the main activity Quite a shame that there are no documentations to the Gesture\Touch system On Saturday, August 24, 2013 8:14:53 PM UTC+3, Nobu Games wrote: You could still try the approach I described by getting rawX and rawY from the motion event and match it with the global rect position of the target view. Motion event coordinates are usually in a local coordinate system. I guess the local coordinate system is the one of the ImageView you start your gesture with, hence the too big numbers when you get your ACTION_CANCEL on the other view. On Saturday, August 24, 2013 5:19:04 AM UTC-5, OronS wrote: Little search showed that ACTION_CANCEL is the right value to get from the system, but the (X,Y) values on this event are not proportional to the gesture I made :S Y values are way bigger than expected I did expand the HitRect size, but it's still too big On Friday, August 23, 2013 10:24:03 PM UTC+3, OronS wrote: Hi :) Thanks for your post I'm trying to implement specific gesture between images...no drag drop The images are inside *GestureOverlayView (because of prediction = gestureLibrary.recognize()...I don't know how to recognize a gestures which have curls or shapes)*, and I thought the parent intercepts touch event automatically (by automatically I mean set the OnTouch listener to the parent). Don't you think inheritance is wrongly used in this case?? Anyway..I used *gestureOverlayView.setOnTouchListener* to intercept touch events on children, and * gestureOverlayView.addOnGesturePerformedListener* to check whether the gesture was recognized, and user's finger passed through both images. The problem now is that in *gestureOverlayView.setOnTouchListener,*instead of ACTION_UP, I get ACTION_CANCEL :S I don't know if it should be like that On Friday, August 23, 2013 6:17:23 PM UTC+3, Nobu Games wrote: Is it just gestures or are you trying to implement drag and drophttp://developer.android.com/guide/topics/ui/drag-drop.html(because it sounds like that). Either way you could just intercept motion events in the parent view group that contains your images and let it handle your gesture recognition. So let's say you create a derivative class L of your layout that contains the image views. You could override dispatchTouchEvent(MotionEvent)http://developer.android.com/reference/android/view/ViewGroup.html#dispatchTouchEvent%28android.view.MotionEvent%29of L and check for the following motion event states: *1. Gesture started (ACTION_DOWN)* Iterate your list of ImageView children of L and see if the touch event point is in one of them. If yes, your gesture starts. The View class has the method getGlobalVisibleRect(Rect, Point)http://developer.android.com/reference/android/view/View.html#getGlobalVisibleRect(android.graphics.Rect,%20android.graphics.Point)which can be used for checking if your touch event coordinate hits one of your image views. It would roughly look like the following (not tested since I'm not sure if these methods return locations in screen or window coordinate system, you may need to debug it): *Rect* r = new *Rect*();* *// should be class member you can reuse float x = motionEvent.getRawX(); float y = motionEvent.getRawY(); *for*(*ImageView* iv : imageViews) { iv.getGlobalVisibleRect(r); *if*(r.contains(x, y)) { // Touch event is inside image view } } *2. Gesture ongoing (ACTION_MOVE)* If you visualize your gesture by drawing some trail or moving around the first touched image view then this is the right point to do so. Here you can update your view(s). *3. Gesture finished (ACTION_UP)* Here you need to iterate your ImageView children again in order to see if the finger has been lifted
[android-developers] Creating a list like the one in android dev guidlines
Hey guys I was going through the android dev guidelines and came upon this awesome list looking thing that would be awesome to have in my app http://i.stack.imgur.com/oLZ5V.png You can see the list on the left phone with the little picture and then the three lines of text. That is exactly what I am looking for although I really do not know how to go about making this so any help provided would be awesome. -- 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 unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: Creating a list like the one in android dev guidlines
Maybe something like this but with an image view? http://stackoverflow.com/questions/8841283/gmail-like-listview-with-checkboxes-and-using-the-actionbar -- 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 unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [android-developers] Re: Creating a list like the one in android dev guidlines
Last I checked (using Developer Options, show view boundaries), Gmail was not using Android layouts for items inside a message item view. It's one Android view per message list item, the internals are handled internally. Now back to your original question: consider RelativeLayout: http://developer.android.com/reference/android/widget/RelativeLayout.html -- K 2013/8/25 William Reed wree...@gmail.com Maybe something like this but with an image view? http://stackoverflow.com/questions/8841283/gmail-like-listview-with-checkboxes-and-using-the-actionbar -- 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 unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- 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 unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.