[android-developers] obtaining true dimensions of a View larger than the screen

2011-05-05 Thread kellogs
Hello,

trying to implement a dynamic scrolview wrapping mechanism here. But
no matter what method I try from the View class they all return me the
view's part of height that is currently visible on screen. So if there
are 360 pixels available for a textview that has lots of text and is
currently using 400 pixels its getHeight() and many other related
methods always report 360.

Any way around this ? maybe getting to the View's Canvas ? How can I
go about that ?

Thank you!

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


[android-developers] Re: obtaining true dimensions of a View larger than the screen

2011-05-05 Thread kellogs
Good hint. I was able to do

int h1 = computeVerticalScrollExtent();
int h3 = computeVerticalScrollRange();

if (h1 == h3)
{
//switch to linearlayout wrapper
}

inside a ScrollView wrapper. The above methods return the same thing
on a LinearLayout though (and probably also on regular Views), so at
first the trick needs assuming that the wrapped View needs a scrollbar
and then see if it really needs one.

Thanks!


On May 5, 6:41 pm, Dianne Hackborn hack...@android.com wrote:
 The only thing View knows is these methods it calls on itself to have
 subclasses tell it how to show the scroll bars:

 http://developer.android.com/reference/android/view/View.html#compute...()

 Beyond that, you will need to look at a specific class that is doing
 scrolling.









 On Thu, May 5, 2011 at 8:09 AM, kellogs mihai0...@gmail.com wrote:
  Hello,

  trying to implement a dynamic scrolview wrapping mechanism here. But
  no matter what method I try from the View class they all return me the
  view's part of height that is currently visible on screen. So if there
  are 360 pixels available for a textview that has lots of text and is
  currently using 400 pixels its getHeight() and many other related
  methods always report 360.

  Any way around this ? maybe getting to the View's Canvas ? How can I
  go about that ?

  Thank you!

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

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.

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


[android-developers] Re: obtaining true dimensions of a View larger than the screen

2011-05-05 Thread kellogs
Good hint. I was able to do

int h1 = computeVerticalScrollExtent();
int h3 = computeVerticalScrollRange();

if (h1 == h3)
{
//switch to linearlayout wrapper
}

inside a ScrollView wrapper. The above methods return the same thing
on a LinearLayout though (and probably also on regular Views), so at
first the trick needs assuming that the wrapped View needs a scrollbar
and then see if it really needs one.

Thanks!


On May 5, 6:41 pm, Dianne Hackborn hack...@android.com wrote:
 The only thing View knows is these methods it calls on itself to have
 subclasses tell it how to show the scroll bars:

 http://developer.android.com/reference/android/view/View.html#compute...()

 Beyond that, you will need to look at a specific class that is doing
 scrolling.









 On Thu, May 5, 2011 at 8:09 AM, kellogs mihai0...@gmail.com wrote:
  Hello,

  trying to implement a dynamic scrolview wrapping mechanism here. But
  no matter what method I try from the View class they all return me the
  view's part of height that is currently visible on screen. So if there
  are 360 pixels available for a textview that has lots of text and is
  currently using 400 pixels its getHeight() and many other related
  methods always report 360.

  Any way around this ? maybe getting to the View's Canvas ? How can I
  go about that ?

  Thank you!

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

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.

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


[android-developers] ListView Drawables

2010-01-27 Thread kellogs
Hi,

Can anyone point me to the right way of drawing a circle as part of a
ListView row ? The code below used to work ok in some android beta SDK
but now under 1.6 it only draws me a black cirle. How can I change
it's colour from getView(..) ?


My code:



public View getView(int position, View convertView,
android.view.ViewGroup parent)
{
  View singleView;
  LinearLayout lL = new LinearLayout (getContext());


  OvalShape circle = new OvalShape();
  circle.resize(8, 8);
  ShapeDrawable dwb = new ShapeDrawable (circle);
  PointColour clr = ((ListRow) content[position]).pointColour;
  dwb.setColorFilter(Color.argb (clr.getAlpha(), clr.getRed(),
clr.getGreen(), clr.getBlue() ), PorterDuff.Mode.SRC);
  dwb.setIntrinsicWidth(10);
  dwb.setIntrinsicHeight(10);
  singleView = new ImageView (getContext());
  ((ImageView)singleView).setImageDrawable(dwb);
  LayoutParams params = new LayoutParams (10, 10);

  lL.addView(singleView, params);

  singleView = new TextView (getContext());
  ((TextView)singleView).setText((CharSequence) (   +
((ListRow)content[position]).participant));
  params = new LayoutParams (189, 20);

  lL.addView(singleView, params);

  return lL;
 }

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


[android-developers] Re: java SE and the emulator

2008-06-26 Thread kellogs

No more help needed. Issue solved

kellogs

On 20 Iun, 13:36, kellogs [EMAIL PROTECTED] wrote:
 Hi,

 I am the happy owner of a desktop computer running on win xp, jdk
 1.6.0.4 and android sdk m5.rc14. On this computer I have managed to
 develop an application for andoid under eclipse IDE using ADT. I do
 not know precisely what version of ADt is installed on my dektop
 computer. All went well, my application ran flowlessly :)

 Now the time has come for presenting my work .. for that, I shall need
 a laptop. So I have acquired one, same XP, jdk 1.6.0.6, same android
 sdk m5.rc14, same eclipse 3.3.1.1, some newer version of the ADT (of
 course, if there was another release in arround 3 months), and,
 surpirse: my project does not start appropiately. emulator launches
 ok, but just after my first activity gets started, I get a big lng
 screen just oon the emulator saying something like:

 unresolved compilation problems: Syntax error, annotations aare only
 available if source level is 5.0.
 The type Map is not generic; it cannot be parametrized with arguments
 String, String
 Syyntax error, parametrized types are only available if source level
 is 5.0
 etc etc...

 Sooo, help please !

 thank you,kellogs

--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---