mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-16 10:48:46 +00:00
Update search results and item details layout
This commit is contained in:
parent
379a45fcd0
commit
981fb9ebda
@ -52,7 +52,6 @@ public class ItemDetails extends AppCompatActivity implements ListPickerDialogFr
|
|||||||
|
|
||||||
// Load Product object from search results activity
|
// Load Product object from search results activity
|
||||||
curProduct = (Product) getIntent().getSerializableExtra("SelectedProduct");
|
curProduct = (Product) getIntent().getSerializableExtra("SelectedProduct");
|
||||||
|
|
||||||
// Set up floating action buttons
|
// Set up floating action buttons
|
||||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||||
linAddItem = (LinearLayout) findViewById(R.id.lin_add_item);
|
linAddItem = (LinearLayout) findViewById(R.id.lin_add_item);
|
||||||
@ -123,8 +122,8 @@ public class ItemDetails extends AppCompatActivity implements ListPickerDialogFr
|
|||||||
tvItemPrice = (TextView) findViewById(R.id.item_price);
|
tvItemPrice = (TextView) findViewById(R.id.item_price);
|
||||||
tvItemPrice.setText(String.format("$%.2f", curProduct.getPrice()));
|
tvItemPrice.setText(String.format("$%.2f", curProduct.getPrice()));
|
||||||
|
|
||||||
tvItemDesc = (TextView) findViewById(R.id.item_desc);
|
// tvItemDesc = (TextView) findViewById(R.id.item_desc);
|
||||||
tvItemDesc.setText(curProduct.getDescription());
|
// tvItemDesc.setText(curProduct.getDescription());
|
||||||
|
|
||||||
tvCreateNew = (TextView) findViewById(R.id.create_new_list);
|
tvCreateNew = (TextView) findViewById(R.id.create_new_list);
|
||||||
tvCreateNew.setVisibility(View.INVISIBLE);
|
tvCreateNew.setVisibility(View.INVISIBLE);
|
||||||
|
|||||||
@ -57,8 +57,8 @@ public class SearchResultsListAdapter extends BaseAdapter {
|
|||||||
Product product = productList.get(position);
|
Product product = productList.get(position);
|
||||||
// TODO: If image url is broken, display @drawable/ic_baseline_broken_image_600.xml
|
// TODO: If image url is broken, display @drawable/ic_baseline_broken_image_600.xml
|
||||||
Glide.with(activity).load(product.getImageUrl()).into(productImage);
|
Glide.with(activity).load(product.getImageUrl()).into(productImage);
|
||||||
if (product.getItemName().length() >= 35) {
|
if (product.getItemName().length() >= 60) {
|
||||||
itemName.setText(product.getItemName().substring(0, 35) + "...");
|
itemName.setText(product.getItemName().substring(0, 60) + "...");
|
||||||
} else {
|
} else {
|
||||||
itemName.setText(product.getItemName());
|
itemName.setText(product.getItemName());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,15 +8,13 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/item_name"
|
android:id="@+id/item_name"
|
||||||
android:layout_width="307dp"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="56dp"
|
android:layout_height="56dp"
|
||||||
android:layout_marginStart="50dp"
|
android:layout_marginHorizontal="50dp"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:layout_marginEnd="50dp"
|
|
||||||
android:text="@string/default_product_name"
|
android:text="@string/default_product_name"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
@ -24,26 +22,23 @@
|
|||||||
android:id="@+id/store_name"
|
android:id="@+id/store_name"
|
||||||
android:layout_width="126dp"
|
android:layout_width="126dp"
|
||||||
android:layout_height="28dp"
|
android:layout_height="28dp"
|
||||||
android:layout_marginStart="52dp"
|
android:layout_marginStart="50dp"
|
||||||
android:layout_marginTop="50dp"
|
android:layout_marginTop="90dp"
|
||||||
android:text="@string/default_store"
|
android:text="@string/default_store"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/item_image"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintVertical_bias="1.0" />
|
app:layout_constraintVertical_bias="1.0" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/item_image"
|
android:id="@+id/item_image"
|
||||||
android:layout_width="307dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="224dp"
|
android:layout_height="224dp"
|
||||||
android:layout_marginStart="50dp"
|
|
||||||
android:layout_marginTop="120dp"
|
android:layout_marginTop="120dp"
|
||||||
android:layout_marginEnd="50dp"
|
android:layout_marginHorizontal="50dp"
|
||||||
|
android:foregroundGravity="center"
|
||||||
android:background="@color/light_gray"
|
android:background="@color/light_gray"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.75"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:contentDescription="@string/product_image_description" />
|
android:contentDescription="@string/product_image_description" />
|
||||||
|
|
||||||
@ -56,22 +51,18 @@
|
|||||||
android:layout_marginBottom="25dp"
|
android:layout_marginBottom="25dp"
|
||||||
android:text="@string/default__00_00"
|
android:text="@string/default__00_00"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/item_desc"
|
app:layout_constraintTop_toBottomOf="@id/item_image"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/item_image" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/item_desc"
|
|
||||||
android:layout_width="309dp"
|
|
||||||
android:layout_height="290dp"
|
|
||||||
android:layout_marginHorizontal="50dp"
|
|
||||||
android:layout_marginStart="50dp"
|
|
||||||
android:layout_marginEnd="50dp"
|
|
||||||
android:layout_marginBottom="7dp"
|
|
||||||
android:text="@string/default_description"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<!-- <TextView-->
|
||||||
|
<!-- android:id="@+id/item_desc"-->
|
||||||
|
<!-- android:layout_width="309dp"-->
|
||||||
|
<!-- android:layout_height="290dp"-->
|
||||||
|
<!-- android:layout_marginHorizontal="50dp"-->
|
||||||
|
<!-- android:layout_marginBottom="7dp"-->
|
||||||
|
<!-- android:text="@string/default_description"-->
|
||||||
|
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||||
|
<!-- app:layout_constraintStart_toStartOf="parent" />-->
|
||||||
<!-- app:srcCompat="@drawable/ic_baseline_arrow_downward_50"-->
|
<!-- app:srcCompat="@drawable/ic_baseline_arrow_downward_50"-->
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@ -44,6 +44,7 @@
|
|||||||
android:paddingTop="20dp"
|
android:paddingTop="20dp"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:layout_toEndOf="@+id/item_image"
|
android:layout_toEndOf="@+id/item_image"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
android:text=""/>
|
android:text=""/>
|
||||||
|
|
||||||
<!-- Only displays if the item is cheaper at another store -->
|
<!-- Only displays if the item is cheaper at another store -->
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user