[android-beginners] Re: When I run getSize() on my text view it returns 0

2009-10-21 Thread Mark Murphy

jax wrote:
 When I run getSize() on my text view it returns 0?

TextView does not have a getSize() method.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Development Wiki: http://wiki.andmob.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Beginners group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: When I run getSize() on my text view it returns 0

2009-10-21 Thread jax

Sorry Mark...I mean getWidth() here is the sample that I am following
from API demo.

(target is a TextView)


final View target = findViewById(R.id.target);
final View targetParent = (View) target.getParent();

Animation a = new TranslateAnimation(0.0f,
targetParent.getWidth() - target.getWidth() -
targetParent.getPaddingLeft() -
targetParent.getPaddingRight(), 0.0f, 0.0f);
a.setDuration(1000);
a.setStartOffset(300);
a.setRepeatMode(Animation.RESTART);
a.setRepeatCount(Animation.INFINITE);

   a.setInterpolator(AnimationUtils.loadInterpolator
(this,android.R.anim.bounce_interpolator));

  target.startAnimation(a);

On Oct 22, 12:58 am, Mark Murphy mmur...@commonsware.com wrote:
 jax wrote:
  When I run getSize() on my text view it returns 0?

 TextView does not have a getSize() method.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://twitter.com/commonsguy

 Android Development Wiki:http://wiki.andmob.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Beginners group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: When I run getSize() on my text view it returns 0

2009-10-21 Thread nirav shah
To get size first of all you need to display that view on screen. after that
you can have size of view.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Beginners group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---