mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-16 02:38:47 +00:00
Item details layout
This commit is contained in:
parent
790d935e40
commit
b269bc6e78
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<vector android:height="28dp" android:tint="?attr/colorControlNormal"
|
||||
<vector android:height="28dp"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="28dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
<vector android:height="28dp"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="28dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,9 @@
|
||||
<vector android:height="28dp"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="28dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M17,19.22H5V7h7V5H5C3.9,5 3,5.9 3,7v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2v-7h-2V19.22z"/>
|
||||
<path android:fillColor="@android:color/white" android:pathData="M19,2h-2v3h-3c0.01,0.01 0,2 0,2h3v2.99c0.01,0.01 2,0 2,0V7h3V5h-3V2z"/>
|
||||
<path android:fillColor="@android:color/white" android:pathData="M7,9h8v2h-8z"/>
|
||||
<path android:fillColor="@android:color/white" android:pathData="M7,12l0,2l8,0l0,-2l-3,0z"/>
|
||||
<path android:fillColor="@android:color/white" android:pathData="M7,15h8v2h-8z"/>
|
||||
</vector>
|
||||
@ -34,21 +34,56 @@
|
||||
|
||||
<include layout="@layout/content_item_details" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab2"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/lin2"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/fab_menu_item_margin"
|
||||
app:srcCompat="@android:drawable/ic_menu_camera" />
|
||||
android:layout_marginBottom="22dp">
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab1"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
<TextView
|
||||
android:id="@+id/add_item_to_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/add_to_list"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="5dp"/>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab2"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginEnd="22dp"
|
||||
android:layout_marginStart="5dp"
|
||||
app:srcCompat="@drawable/ic_baseline_post_add_28" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/lin1"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/fab_menu_item_margin"
|
||||
app:srcCompat="@android:drawable/ic_dialog_map" />
|
||||
android:layout_marginBottom="22dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/create_new_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/create_new_list"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="5dp"/>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab1"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginEnd="22dp"
|
||||
android:layout_marginStart="5dp"
|
||||
app:srcCompat="@drawable/ic_baseline_create_28" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
@ -58,13 +93,4 @@
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
app:srcCompat="@drawable/ic_baseline_add_28" />
|
||||
|
||||
|
||||
<!-- <com.google.android.material.floatingactionbutton.FloatingActionButton-->
|
||||
<!-- android:id="@+id/fab"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_gravity="bottom|end"-->
|
||||
<!-- android:layout_margin="@dimen/fab_margin"-->
|
||||
<!-- app:srcCompat="@android:drawable/ic_dialog_email" />-->
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@ -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" />
|
||||
|
||||
<!-- <Button-->
|
||||
<!-- android:id="@+id/button4"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text="Button"-->
|
||||
<!-- tools:layout_editor_absoluteX="69dp"-->
|
||||
<!-- tools:layout_editor_absoluteY="368dp" />-->
|
||||
|
||||
<!-- <Button-->
|
||||
<!-- android:id="@+id/button5"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text="Button"-->
|
||||
<!-- tools:layout_editor_absoluteX="247dp"-->
|
||||
<!-- tools:layout_editor_absoluteY="377dp" />-->
|
||||
<TextView
|
||||
android:id="@+id/store_name"
|
||||
android:layout_width="126dp"
|
||||
android:layout_height="28dp"
|
||||
android:layout_marginStart="52dp"
|
||||
android:layout_marginTop="50dp"
|
||||
android:text="@string/default_store"
|
||||
app:layout_constraintBottom_toTopOf="@+id/item_image"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="1.0" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/item_image"
|
||||
@ -46,35 +42,36 @@
|
||||
android:background="@color/light_gray"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="1.0"
|
||||
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" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="50dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="25dp"
|
||||
android:text="@string/default__00_00"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/item_desc"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/item_image" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_desc"
|
||||
android:layout_width="307dp"
|
||||
android:layout_height="300dp"
|
||||
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="Description"
|
||||
android:layout_marginHorizontal="50dp"
|
||||
android:text="@string/default_description"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/store_name"
|
||||
android:layout_width="126dp"
|
||||
android:layout_height="28dp"
|
||||
android:layout_marginStart="50dp"
|
||||
android:layout_marginTop="50dp"
|
||||
android:layout_marginBottom="11dp"
|
||||
android:text="Store"
|
||||
app:layout_constraintBottom_toTopOf="@+id/item_image"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="1.0" />
|
||||
<!-- app:srcCompat="@drawable/ic_baseline_arrow_downward_50"-->
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -30,4 +30,11 @@
|
||||
<string name="title_activity_search_results">SearchResults</string>
|
||||
<string name="store_selection">Store selection</string>
|
||||
<string name="title_activity_item_details">ItemDetails</string>
|
||||
<string name="add_to_list">Add to list</string>
|
||||
<string name="create_new_list">Create new list</string>
|
||||
<string name="default_product_name">Product Name</string>
|
||||
<string name="default_store">Store</string>
|
||||
<string name="default__00_00">$00.00</string>
|
||||
<string name="default_description">Description</string>
|
||||
<string name="product_image_description">Product Image</string>
|
||||
</resources>
|
||||
Loading…
Reference in New Issue
Block a user