mirror of
https://github.com/OMGeeky/andors-trail.git
synced 2026-02-23 15:38:29 +01:00
Update R.layout.inventoryitemview to a single TextView instead of a combined ImageView & TextView.
This commit is contained in:
@@ -1,20 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/inv_image"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="1dp"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/inv_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/textWithIcon"
|
||||
android:drawableLeft="@drawable/equip_weapon"
|
||||
android:text="Name"
|
||||
/>
|
||||
|
||||
@@ -17,9 +17,11 @@ public final class Range {
|
||||
}
|
||||
|
||||
public boolean equals(Range r) {
|
||||
if (r == null) return false;
|
||||
return max == r.max && current == r.current;
|
||||
}
|
||||
public boolean equals(ConstRange r) {
|
||||
if (r == null) return false;
|
||||
return max == r.max && current == r.current;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,12 +38,11 @@ public final class ActorConditionList extends LinearLayout {
|
||||
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
|
||||
for (ActorCondition c : conditions) {
|
||||
View v = View.inflate(context, R.layout.inventoryitemview, null);
|
||||
ImageView iw = (ImageView) v.findViewById(R.id.inv_image);
|
||||
world.tileManager.setImageViewTile(iw, c.conditionType);
|
||||
TextView v = (TextView) View.inflate(context, R.layout.inventoryitemview, null);
|
||||
world.tileManager.setImageViewTile(res, v, c.conditionType);
|
||||
SpannableString content = new SpannableString(describeEffect(res, c));
|
||||
content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
|
||||
((TextView) v.findViewById(R.id.inv_text)).setText(content);
|
||||
v.setText(content);
|
||||
final ActorConditionType conditionType = c.conditionType;
|
||||
v.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
|
||||
@@ -38,9 +38,10 @@ public final class ItemContainerAdapter extends ArrayAdapter<ItemEntry> {
|
||||
if (result == null) {
|
||||
result = View.inflate(getContext(), R.layout.inventoryitemview, null);
|
||||
}
|
||||
|
||||
tileManager.setImageViewTile(getContext().getResources(), (ImageView) result.findViewById(R.id.inv_image), item.itemType, tileCollection);
|
||||
((TextView) result.findViewById(R.id.inv_text)).setText(ItemController.describeItemForListView(item, player));
|
||||
TextView tv = (TextView) result;
|
||||
|
||||
tileManager.setImageViewTile(getContext().getResources(), tv, item.itemType, tileCollection);
|
||||
tv.setText(ItemController.describeItemForListView(item, player));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user