Possibility of a curved Gallery

by Navaneeth » Sun, 19 Sep 2010 23:03:21 GMT

Sponsored Links
 Hi All,
Is it possible to change the default arrangement of the Android
Gallery? What i meant is can we make the Gallery in a curved path,
where the images will be along the curved path and the same time it
has all the properties of the Android gallery(which appears to be
center locked and horizontal right now..)?

If possible, please tell me your ideas. All ideas are welcome.

Thanks & Regards,


Possibility of a curved Gallery

by Dianne Hackborn » Mon, 20 Sep 2010 04:12:33 GMT

 I'd suggest taking the platform's code for the gallery and modifying it to
do what you want.  You'll need to tweak some things to be able to build it
against the SDK, but it is entirely implementable with the SDK.


Sponsored Links

Possibility of a curved Gallery

by Navaneeth » Mon, 20 Sep 2010 16:44:57 GMT

 hanks Dianne,
But i dint understand what you meant by this :
"but it is entirely implementable with the SDK.". Could you please

I also want to know whether the approach i am following is correct one
or is there a better approach.
So far i have tried to draw a curved line and was able to place some
text(not TextViews) along the path at specific intervals.
I was also able to place a drawable on the center Text.
The things to be implemented are :
a) Give click property to every text along the path
b) update the list of text with the new list on UP or DOWN key press.

The problem i am facing right now is :
a) the onDraw is getting called in an infinte loop. (I tried to set a
flag but then it is drawing and in the next instant the screen gets
b) i am not getting the onKey functionalities.

Please find my code below :
package com.android.mygallery;

import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PathMeasure;
import android.graphics.PixelFormat;
import android.graphics.PointF;
import android.graphics.RectF;
import android.graphics.Matrix.ScaleToFit;
import android.graphics.Paint.Style;
import android.graphics.Path.Direction;
import android.graphics.drawable.BitmapDrawable;

import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.View.OnKeyListener;
import android.widget.Gallery;
import android.widget.ImageView.ScaleType;

public class MyCurvedGallery extends Activity {
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {


myView view = new myView(this);


class myView extends View implements OnKeyListener{

private Paint myPaint;

boolean completeFlag = false;

public myView(Context context) {

myPaint = new Paint();



protected void onDraw(Canvas canvas) {

PointF mPoint1 = new PointF(600, 30);
PointF mPoint2 = new PointF(2500, 700);
PointF mPoint3 = new PointF(300, 1070);
Path myPath = new Path();
Path m

Possibility of a curved Gallery

by Dianne Hackborn » Tue, 21 Sep 2010 01:24:26 GMT

  mean that there is nothing about the implementation of the gallery widget
that requires it be in the framework. You can implement the exact same
thing in your app, and make it behave however you want. You can start by
copying the code from the framework (though this will probably require some
tweaking to get it to use only SDK APIs).

On Mon, Sep 20, 2010 at 1:44 AM, Navaneeth <sen4u....@gmail.com> wrote:

> > >

Other Threads

1. MediaScannerConnection

MediaScannerConnection provides a way to add a newly created (audio)
file to the phone's mediastore. However, I am wondering how to tell
the mediastore that the application deleted an (audio) file and
therefore is not available anymore ?


2. VerifyError with Maps Add-ons

After the first time I (re)install a new APK sometimes I get
VerifyErrors when an Activity references another Activity that extends
MapActivity.  The app will crash, and then when I restart it it works

This is only on 1.5 targets with the google API addons (target 3).  If
anyone has any suggestions please let me know.

Here is the logcat:
05-07 15:44:32.024: WARN/dalvikvm(16630): Unable to resolve superclass
of Lcom/tunewiki/lyricplayer/android/community/maps/MusicMapActivity;
05-07 15:44:32.024: WARN/dalvikvm(16630): Link of class 'Lcom/tunewiki/
lyricplayer/android/community/maps/MusicMapActivity;' failed
05-07 15:44:32.024: ERROR/dalvikvm(16630): Could not find class
referenced from method
05-07 15:44:32.024: WARN/dalvikvm(16630): VFY: unable to resolve const-
class 464 (Lcom/tunewiki/lyricplayer/android/community/maps/
MusicMapActivity;) in Lcom/tunewiki/lyricplayer/android/player/
05-07 15:44:32.024: WARN/dalvikvm(16630): VFY:  rejecting opcode 0x1c
at 0x0004
05-07 15:44:32.024: WARN/dalvikvm(16630): VFY:  rejected Lcom/tunewiki/
lyricplayer/android/player/VideoPlayer;.launchMusicMap ()V
05-07 15:44:32.024: WARN/dalvikvm(16630): Verifier rejected class Lcom/
05-07 15:44:32.024: WARN/dalvikvm(16630): Class init failed in
newInstance call (Lcom/tunewiki/lyricplayer/android/player/
05-07 15:44:32.024: DEBUG/AndroidRuntime(16630): Shutting down VM
05-07 15:44:32.034: WARN/dalvikvm(16630): threadid=3: thread exiting
with uncaught exception (group=0x4000fe70)
05-07 15:44:32.214: ERROR/AndroidRuntime(16630): Uncaught handler:
thread main exiting due to uncaught exception
05-07 15:44:32.224: ERROR/AndroidRuntime(16630):
05-07 15:44:32.224: ERROR/AndroidRuntime(16630):     at
java.lang.Class.newInstanceImpl(Native Method)
05-07 15:44:32.224: ERROR/AndroidRuntime(16630):     at
05-07 15:44:32.224: ERROR/AndroidRuntime(16630):     at
05-07 15:44:32.224: ERROR/AndroidRuntime(16630):     at
05-07 15:44:32.224: ERROR/AndroidRuntime(16630):     at
05-07 15:44:32.224: ERROR/AndroidRuntime(16630):     at
05-07 15:44:32.224: ERROR/AndroidRuntime(16630):     at
05-07 15:44:32.224: ERROR/AndroidRuntime(16630):     at
05-07 15:44:32.224: ERROR/AndroidRuntime(16630):     at
05-07 15:44:32.224: ERROR/AndroidRuntime(16630):     at
05-07 15:44:32.224: ERROR/AndroidRuntime(16630):     at
java.lang.reflect.Method.invokeNative(Native Method)
05-07 15:44:32.224: ERROR/AndroidRuntime(16630):     at
05-07 15:44:32.224: ERROR/AndroidRuntime(16630):     at
05-07 15:44:32.224: ERROR/AndroidRuntime(16630):     at
05-07 15:44:32.224: ERROR/AndroidRuntime(16630):     at
dalvik.system.NativeStart.main(Native Method)


3. canvas and android.graphics.camera 3d rotation issue

4. Settings.Secure.getInt got wrong value in AdbSettingsObserver

5. How to prevent Failed Binder Transaction

6. How to get Application Name from the process?

7. virgin map