ListAdapter in Android 1.5 and 1.6: are there any differences?
<p>I made an application that uses a <code>ListAdapter</code> to display some items. In my <code>getView</code> method I use <code>LinearLayout#setPadding()</code> to define the indention of each view depending of some object specific states.</p>

<p>This worked fine in Android 1.5. Last week I decided to move to 1.6 since it's better suitable for different screen sizes. It all worked fine, but the <code>ListAdapter</code> looks really weird now. The padding isn't working correctly anymore.</p>

<p>Does anybody know if there is a difference in the <code>ListAdapter</code> or <code>setPadding</code> implementation between Android 1.5 and Android 1.6?</p>

<p>===EDIT: Code added===</p>

<pre><code>@Override
        public View getView(int position, View convertView, ViewGroup parent) {
            TextView text = (TextView) View.inflate(lexs, R.layout.law_list_book_view, null);

            if (items.get(position) instanceof Chapter) {
                LinearLayout chapterView = new LinearLayout(lexs);
                chapterView.setOrientation(LinearLayout.HORIZONTAL);
                chapterView.setGravity(Gravity.CENTER);

                ImageView img = new ImageView(lexs);
                img.setPadding(0, 0, 5, 0);
                chapterView.addView(img);

                chapterView.addView(text);
                text.setTextColor(Color.BLACK);
                text.setText((CharSequence) items.get(position).getName() + ": " + ((Chapter) items.get(position)).getTitle());
                text.setMinWidth(320);
                switch (((Chapter) items.get(position)).getLevel()) {
                    case 0:
                        text.setTextColor(Color.rgb(0, 0, 0));
                        break;
                    case 1:
                        text.setTextColor(Color.rgb(50, 50, 50));
                        chapterView.setPadding(10, 0, 0, 0);
                        break;
                    case 2:
                        text.setTextColor(Color.rgb(100, 100, 100));
                        chapterView.setPadding(20, 0, 0, 0);
                        break;
                    case 3:
                        text.setTextColor(Color.rgb(150, 150, 150));
                        chapterView.setPadding(30, 0, 0, 0);
                        break;
                    case 4:
                        text.setTextColor(Color.rgb(175, 175, 175));
                        chapterView.setPadding(40, 0, 0, 0);
                        break;
                    default:
                        text.setTextColor(Color.rgb(200, 200, 200));
                        chapterView.setPadding(50, 0, 0, 0);
                        break;
                }

                if (((Chapter) items.get(position)).isExpanded()) {
                    img.setImageResource(R.drawable.minus);
                } else {
                    img.setImageResource(R.drawable.plus);
                }

                if (((Chapter) items.get(position)).isSearched()) {
                    text.setBackgroundColor(Color.MAGENTA);
                }
                text.setTextSize(15);
                return chapterView;
            } else {
                LinearLayout paragraphView = new LinearLayout(lexs);
                paragraphView.setOrientation(LinearLayout.HORIZONTAL);
                paragraphView.setGravity(Gravity.CENTER);
                paragraphView.setPadding( (((Chapter) ((Paragraph) items.get(position)).getRoot()).getLevel() * 10) + 15 + 8 , 0, 0, 0);

                DisplayMetrics metrics = new DisplayMetrics();
                lexs.getWindowManager().getDefaultDisplay().getMetrics(metrics);

                ImageView paragraphImg = new ImageView(lexs);
                paragraphImg.setImageResource(R.drawable.paragraph);
                paragraphView.addView(paragraphImg);

                LinearLayout textLayer = new LinearLayout(lexs);
                textLayer.setGravity(Gravity.LEFT);
                textLayer.setMinimumWidth(metrics.widthPixels / 2);
                text.setTextColor(Color.BLACK);
                textLayer.addView(text);
                textLayer.setOnClickListener(new BookViewOnClickListener(position));
                paragraphView.addView(textLayer);
                text.setText("Artikel " + (CharSequence) items.get(position).getName());

                LinearLayout buttonLayer = new LinearLayout(lexs);
                buttonLayer.setGravity(Gravity.RIGHT);
                ImageButton mark = new ImageButton(lexs);
                if (WorkspaceView.createView(lexs).isFavorite((Paragraph) items.get(position))) {
                    mark.setBackgroundResource(R.drawable.article_not_favorite);
                } else {
                    mark.setBackgroundResource(R.drawable.article_favorit);
                }
                mark.setOnClickListener(new BookViewOnClickListener(position));
                buttonLayer.addView(mark);
                buttonLayer.setPadding(0, 0, 10, 0);
                buttonLayer.setMinimumWidth(metrics.widthPixels / 2);
                paragraphView.addView(buttonLayer);
                text.setTextSize(15);

                if (((Paragraph) items.elementAt(position)).isSearched()) {
                    text.setBackgroundColor(Color.RED);
                }

                return paragraphView;
            } 

        }
</code></pre>

<p>===EDIT 2: Screenshot added===</p>

<p><img src="http://i.stack.imgur.com/bTiPe.png" alt="alt text"></p>

<p>I know that this elements of the list are all level 0 elements and should therefore have no padding (I used logcat to verify the level of the elements. they are all 0). the level of the elements i use in the switch case to check the padding (see code)</p>
