Commit 230ec49b authored by iman Fauzi's avatar iman Fauzi

add activity cart

parent a216bd2c
......@@ -12,7 +12,7 @@ import com.google.android.material.textfield.TextInputEditText;
import java.text.NumberFormat;
import java.util.Locale;
public class cart_activity extends AppCompatActivity {
public class CartActivity extends AppCompatActivity {
ImageButton btMinus, btPlus, btDelete;
TextInputEditText tiQty;
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
<com.google.android.material.card.MaterialCardView xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".cart_activity">
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="15dp"
android:paddingHorizontal="20dp">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvProductName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hint_product_name"
android:fontFamily="@font/roboto"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hint_price"
android:fontFamily="@font/roboto"
android:textSize="16sp"
app:layout_constraintTop_toBottomOf="@+id/tvProductName"
app:layout_constraintStart_toStartOf="@id/tvProductName"/>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/cross"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="x"
android:fontFamily="@font/roboto"
android:textSize="16sp"
android:layout_marginStart="10dp"
app:layout_constraintStart_toEndOf="@id/tvPrice"
app:layout_constraintBottom_toBottomOf="@id/tvPrice"/>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvQuantity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:fontFamily="@font/roboto"
android:textSize="16sp"
android:layout_marginStart="10dp"
app:layout_constraintStart_toEndOf="@id/cross"
app:layout_constraintBottom_toBottomOf="@id/cross"/>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvTotal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hint_price"
android:fontFamily="@font/roboto"
android:textSize="16sp"
android:textFontWeight="600"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="@id/tvQuantity"/>
<ImageButton
android:id="@+id/btMinus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:layout_marginTop="20dp"
android:src="@drawable/ic_baseline_minus_24"
android:background="@drawable/ic_rounded_circle"
app:layout_constraintTop_toBottomOf="@id/tvPrice"
app:layout_constraintStart_toStartOf="parent"/>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tiQty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:boxBackgroundColor="#fff"
app:layout_constraintBottom_toBottomOf="@id/btMinus"
app:layout_constraintStart_toEndOf="@id/btMinus">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/etQty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:textColor="#333"/>
</com.google.android.material.textfield.TextInputLayout>
<ImageButton
android:id="@+id/btPlus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:src="@drawable/ic_baseline_plus_24"
android:background="@drawable/ic_rounded_circle"
app:layout_constraintStart_toEndOf="@id/tiQty"
app:layout_constraintBottom_toBottomOf="@id/tiQty"/>
<ImageButton
android:id="@+id/btDelete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="#00FFFFFF"
android:src="@drawable/ic_baseline_delete_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="@id/btPlus"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment