I'm trying to optimize my grid adapter item. I'm already using ViewHolder
(as suggested by various google talks) when calling getView in my adapter.
My xml also doesn't go that deep. There are no linear layouts, only
relative layouts, and it's five layers at the deepest. Are there other
tweaks that I can do? I've attached a snippet of my xml.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="178dp"
android:background="@color/Transparent"
android:clickable="true" >
<RelativeLayout
android:id="@+id/Holder"
android:layout_width="147dp"
android:layout_height="178dp"
android:layout_centerInParent="true"
android:background="@color/Transparent" >
<ImageView
android:id="@+id/userIcon"
android:layout_width="141dp"
android:layout_height="141dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="1dp"
android:background="@color/Transparent" />
<RelativeLayout
android:id="@+id/userInfoSection"
android:layout_width="143dp"
android:layout_height="35dp"
android:layout_below="@id/userIcon"
android:layout_centerHorizontal="true"
android:background="@color/Black" >
<Button
android:id="@+id/MenuButton"
android:layout_width="31dp"
android:layout_height="25dp"
android:layout_alignParentRight="true"
android:scaleType="fitCenter"
android:src="@drawable/btn_menu" />
<TextView
android:id="@+id/Name"
android:layout_width="100dp"
android:layout_height="17dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_marginLeft="3dp"
android:layout_toLeftOf="@id/MenuButton"
android:singleLine="true"
android:ellipsize="end"/>
<TextView
android:id="@+id/Age"
android:layout_width="39dp"
android:layout_height="14dp"
android:layout_below="@id/Name"
android:layout_marginRight="20dp"
android:layout_toLeftOf="@id/MenuButton"
android:singleLine="true"
android:ellipsize="end"
style="@style/Text.Default" />
<TextView
android:id="@+id/Location"
android:layout_width="30dp"
android:layout_height="14dp"
android:layout_below="@id/Name"
android:layout_alignParentLeft="true"
android:layout_marginLeft="3dp"
android:layout_toLeftOf="@id/Price"
android:singleLine="true"
android:ellipsize="end"
style="@style/Text.Default" />
</RelativeLayout>
</RelativeLayout>
<ImageView
android:id="@+id/loading_indicator"
android:contentDescription="@string/imageView_caption_loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="115dp"
android:layout_marginTop="5dp"
android:src="@drawable/loading_indicator"
android:visibility="gone" />
</RelativeLayout>