Friday, August 10, 2012

Re: [android-developers] Re: how best to move canvas dimensions to tablet proportions. Functions I could use...

Don't hardcode any values...  With a little imagination and research you should be able to achieve what you want without detecting the screen size either...

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Fri, Aug 10, 2012 at 3:43 PM, bob <bob@coolfone.comze.com> wrote:
Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay();
int width = display.getWidth();  
int height = display.getHeight();


On Friday, August 10, 2012 4:34:12 PM UTC-5, cellurl wrote:
I have an app that looks fine on an HTC-G1, but is all misaligned on a tablet.
Q: What functions should I use to find screen size, so I can get rid
of the hard numbers you see below.
For example, 347 is 50% in the X direction...
Thanks for any leads!
-cellurl


public class View extends SurfaceView implements SurfaceHolder.Callback {

    class Thread extends Thread implements OnJetEventListener {}

      public Thread(SurfaceHolder surfaceHolder, Context context,
Handler handler) {}

       c = mSurfaceHolder.lockCanvas(null);
                    // synchronized (mSurfaceHolder) {
                    doDraw(c);
        }

        private void doNeedleAnimation2nd(Canvas canvas) {

            float px= 347;  //this is the center for R.drawable.needle
            float py= 33;
            canvas.translate(-110, 245);    //this is the pivot for
R.drawable.background_a
        }

--
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+unsubscribe@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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate