diff --git a/Listify/app/src/main/java/com/example/listify/ItemDetails.java b/Listify/app/src/main/java/com/example/listify/ItemDetails.java index 8b70f19..8da738f 100644 --- a/Listify/app/src/main/java/com/example/listify/ItemDetails.java +++ b/Listify/app/src/main/java/com/example/listify/ItemDetails.java @@ -9,15 +9,19 @@ import androidx.appcompat.widget.Toolbar; import android.view.View; import android.widget.ImageButton; import android.widget.ImageView; +import android.widget.LinearLayout; import android.widget.TextView; public class ItemDetails extends AppCompatActivity { private Product curProduct; - private FloatingActionButton fab1; - private FloatingActionButton fab2; + private LinearLayout lin1; + private LinearLayout lin2; + private TextView tvCreateNew; + private TextView tvAddItem; private TextView tvItemName; private TextView tvStoreName; private ImageView itemImage; + private TextView tvItemPrice; private TextView tvItemDesc; private ImageButton backToSearchbutton; @@ -33,8 +37,10 @@ public class ItemDetails extends AppCompatActivity { curProduct = (Product) getIntent().getSerializableExtra("SelectedProduct"); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); - fab1 = (FloatingActionButton) findViewById(R.id.fab1); - fab2 = (FloatingActionButton) findViewById(R.id.fab2); +// fab1 = (FloatingActionButton) findViewById(R.id.fab1); +// fab2 = (FloatingActionButton) findViewById(R.id.fab2); + lin1 = (LinearLayout) findViewById(R.id.lin1); + lin2 = (LinearLayout) findViewById(R.id.lin2); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -55,9 +61,18 @@ public class ItemDetails extends AppCompatActivity { tvStoreName = (TextView) findViewById(R.id.store_name); tvStoreName.setText(curProduct.getChainName()); + tvItemPrice = (TextView) findViewById(R.id.item_price); + tvItemPrice.setText(String.format("$%.2f", curProduct.getPrice())); + tvItemDesc = (TextView) findViewById(R.id.item_desc); tvItemDesc.setText(curProduct.getDescription()); + tvCreateNew = (TextView) findViewById(R.id.create_new_list); + tvCreateNew.setVisibility(View.INVISIBLE); + + tvAddItem = (TextView) findViewById(R.id.add_item_to_list); + tvAddItem.setVisibility(View.INVISIBLE); + backToSearchbutton = (ImageButton) findViewById(R.id.back_to_search_results_button); backToSearchbutton.setOnClickListener(new View.OnClickListener() { @Override @@ -69,14 +84,18 @@ public class ItemDetails extends AppCompatActivity { private void showFABMenu(){ isFABOpen=true; - fab1.animate().translationY(-getResources().getDimension(R.dimen.standard_55)); - fab2.animate().translationY(-getResources().getDimension(R.dimen.standard_105)); + lin1.animate().translationY(-getResources().getDimension(R.dimen.standard_55)); + lin2.animate().translationY(-getResources().getDimension(R.dimen.standard_105)); + tvAddItem.setVisibility(View.VISIBLE); + tvCreateNew.setVisibility(View.VISIBLE); } private void closeFABMenu(){ isFABOpen=false; - fab1.animate().translationY(0); - fab2.animate().translationY(0); + lin1.animate().translationY(0); + lin2.animate().translationY(0); + tvAddItem.setVisibility(View.INVISIBLE); + tvCreateNew.setVisibility(View.INVISIBLE); } diff --git a/Listify/app/src/main/res/drawable/ic_baseline_add_28.xml b/Listify/app/src/main/res/drawable/ic_baseline_add_28.xml index 28957a3..f320e60 100644 --- a/Listify/app/src/main/res/drawable/ic_baseline_add_28.xml +++ b/Listify/app/src/main/res/drawable/ic_baseline_add_28.xml @@ -1,4 +1,4 @@ - diff --git a/Listify/app/src/main/res/drawable/ic_baseline_create_28.xml b/Listify/app/src/main/res/drawable/ic_baseline_create_28.xml new file mode 100644 index 0000000..3740c94 --- /dev/null +++ b/Listify/app/src/main/res/drawable/ic_baseline_create_28.xml @@ -0,0 +1,5 @@ + + + diff --git a/Listify/app/src/main/res/drawable/ic_baseline_post_add_28.xml b/Listify/app/src/main/res/drawable/ic_baseline_post_add_28.xml new file mode 100644 index 0000000..4b9cc60 --- /dev/null +++ b/Listify/app/src/main/res/drawable/ic_baseline_post_add_28.xml @@ -0,0 +1,9 @@ + + + + + + + diff --git a/Listify/app/src/main/res/layout/activity_item_details.xml b/Listify/app/src/main/res/layout/activity_item_details.xml index feace5e..6ad4ac1 100644 --- a/Listify/app/src/main/res/layout/activity_item_details.xml +++ b/Listify/app/src/main/res/layout/activity_item_details.xml @@ -34,21 +34,56 @@ - + android:layout_marginBottom="22dp"> - + + + + + + android:layout_marginBottom="22dp"> + + + + + + + + - - - - - - - - - \ No newline at end of file diff --git a/Listify/app/src/main/res/layout/content_item_details.xml b/Listify/app/src/main/res/layout/content_item_details.xml index 35c243a..0e98ba7 100644 --- a/Listify/app/src/main/res/layout/content_item_details.xml +++ b/Listify/app/src/main/res/layout/content_item_details.xml @@ -13,28 +13,24 @@ android:layout_marginStart="50dp" android:layout_marginTop="16dp" android:layout_marginEnd="50dp" - android:text="Product Name" + android:text="@string/default_product_name" android:textSize="16sp" android:textStyle="bold" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - - - - - - - - - - - - - - - + + app:layout_constraintTop_toTopOf="parent" + android:contentDescription="@string/product_image_description" /> + + - - \ No newline at end of file diff --git a/Listify/app/src/main/res/values/strings.xml b/Listify/app/src/main/res/values/strings.xml index 8869c5d..2de5c80 100644 --- a/Listify/app/src/main/res/values/strings.xml +++ b/Listify/app/src/main/res/values/strings.xml @@ -30,4 +30,11 @@ SearchResults Store selection ItemDetails + Add to list + Create new list + Product Name + Store + $00.00 + Description + Product Image \ No newline at end of file