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. Cancel IMEs word prediction from application code?

I have an EditText in my application where it never makes sense to use
word prediction. Most IMEs have a setting to enable or disable word
prediction, but is there any way I, as an application programmer, can
have control over the mechanism? Can I disable word prediction
manually/temporarily, independently of what exact IME is being used?

Would appreciate any help with this. The word prediction is
interfering with my own functionality.


2. DNS-lookup

Is there any way to do DNS-lookups of other records then just A and
I need to look up MX-records and parse the results.


3. Problem changing permission with chmod and runtime.getRuntime

4. S3C64XX RT2070L Android2.1 issue

5. Checking if phone is ROOTED

6. [WTHelp] Jaringan 3 -Three- di daerah Bekasi

7. Formats and browser