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. GK : Ho to Skip DroidDo

Hi all,
    Am  compiling the Android Platform source code. It took around 4
hrs to compile the package.
I Used $ make -j4 sdk

Can any one suggess how to minimize the time and I dont want for
compile the javadoc everytime
How to skip this DroidDoc. ?
Help me out.

Thanks in Advance.


2. UI Testing in Android Frameworks

Now, we want to develop a tool to test the software under Android
frameworks, mainly UI testing without software source, so we can't get
the UI object.  is there a method to get the handler of the UI object?


3. How to load a file from assets directory in native code?

4. Android 2.0 Review

5. access Java code from WebKit plugin

6. Figuring out android.telephony.cdma

7. Always stop at "Waiting for HOME ('android.process.acore') to be launched..."