bringing pre-release SDK code to date

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

bringing pre-release SDK code to date

Postby kellogs » Wed Jan 27, 2010 2:53 am

Hi everyone, plusminus,


my ArrayAdapter implementation:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public View getView(int position, View convertView, android.view.ViewGroup parent)
  2. {
  3.                 View singleView;
  4.                
  5.                 LinearLayout lL = new LinearLayout (getContext());
  6.                 [s]/*LayoutParams lP = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
  7.                 lL.setLayoutParams(lP);*/[/s]
  8.                
  9.                
  10.                 OvalShape circle = new OvalShape();
  11.                 circle.resize(8, <img src="http://www.anddev.org/images/smilies/cool.png" alt="8)" title="Cool" />;
  12.                 ShapeDrawable dwb = new ShapeDrawable (circle);
  13.                 PointColour clr = ((ListRow) content[position]).pointColour;
  14.                 <span style="font-style: italic">dwb.setColorFilter(Color.argb (clr.getAlpha(), clr.getRed(), clr.getGreen(), clr.getBlue() ), PorterDuff.Mode.SRC);</span>
  15.                 <span style="font-weight: bold">dwb.setIntrinsicWidth(10);
  16.                 dwb.setIntrinsicHeight(10);</span>
  17.                 //dwb.invalidateSelf();
  18.                
  19.                 singleView = new ImageView (getContext());
  20.                 ((ImageView)singleView).setImageDrawable(dwb);
  21.                 LayoutParams params = new LayoutParams (10, 10);
  22.                 //singleView.invalidate();
  23.                
  24.                 lL.addView(singleView, params);
  25.                
  26.                 singleView = new TextView (getContext());
  27.                 ((TextView)singleView).setText((CharSequence) ("  " + ((ListRow)content[position]).participant));
  28.                 params = new LayoutParams (189, 20);
  29.                
  30.                 lL.addView(singleView, params);
  31.                
  32.                 return lL;
  33.         }
  34.  
  35. [s][/s] = striked line;
  36.  = italics line;
  37.  = bolded line;
Parsed in 0.036 seconds, using GeSHi 1.0.8.4


1. if I uncomment the stroke lines I get some exception while dalvik is trying to calculate the list elements' dimensions. These lines worked ok in m5 r14 but I dont mind...

2. The line in italics just does not have the effect of colouring the circle to my liking no matter how I approach it. It used to work in m5r14, and if I change the exact same colours from outside 'getView()' it works. Every time my istView initializes I only get a bunch of black circles. What can I do about it ?

3. Without the bolded lines there is no circle displayed on my rows whatsoever. Again, these lines were not needed in m5r14

I am only really concerned about getting around issue 2; your comments are welcome;

thank you,
kellogs
kellogs
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Jan 27, 2010 2:43 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 5 guests