diff --git a/Lucky_clothes/app/src/main/java/com/example/orangesale_end/fragment/ShoppingCartFragment.java b/Lucky_clothes/app/src/main/java/com/example/orangesale_end/fragment/ShoppingCartFragment.java index f37faae..b9a3aa6 100644 --- a/Lucky_clothes/app/src/main/java/com/example/orangesale_end/fragment/ShoppingCartFragment.java +++ b/Lucky_clothes/app/src/main/java/com/example/orangesale_end/fragment/ShoppingCartFragment.java @@ -7,6 +7,8 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; +import android.widget.ImageView; +import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -21,28 +23,37 @@ public class ShoppingCartFragment extends Fragment implements View.OnClickListen private Button walkButton; private List cartList = new ArrayList<>(); private ProductFragment productFragment; + private ImageView imageView1,imageView2; + @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view; - if (cartList.size() > 0) { + if (cartList.size() >0) { //有商品 - view = LayoutInflater.from(getActivity()).inflate(R.layout.cart_have_product, container, false); - } else { view = LayoutInflater.from(getActivity()).inflate(R.layout.cart_no_product, container, false); + } else { + view = LayoutInflater.from(getActivity()).inflate(R.layout.cart_have_product, container, false); } - init(view); + /* init(view);*/ + return view; } /** * 组件初始化 */ - private void init(View view) { - walkButton = view.findViewById(R.id.random_search); - walkButton.setOnClickListener(this); - } + /* private void init(View view) { + + imageView1 = view.findViewById(R.id.imageView1); + imageView2 = view.findViewById(R.id.imageView2); + + + }*/ + /* walkButton = view.findViewById(R.id.random_search); + walkButton.setOnClickListener(this);*/ + @Override public void onClick(View v) { diff --git a/Lucky_clothes/app/src/main/res/drawable/bg_round_corner.xml b/Lucky_clothes/app/src/main/res/drawable/bg_round_corner.xml new file mode 100644 index 0000000..64bfafa --- /dev/null +++ b/Lucky_clothes/app/src/main/res/drawable/bg_round_corner.xml @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/Lucky_clothes/app/src/main/res/layout/cart_have_product.xml b/Lucky_clothes/app/src/main/res/layout/cart_have_product.xml index b7362e4..1b088a5 100644 --- a/Lucky_clothes/app/src/main/res/layout/cart_have_product.xml +++ b/Lucky_clothes/app/src/main/res/layout/cart_have_product.xml @@ -1,15 +1,187 @@ - + + + + + android:text="+" + android:gravity="center" + android:textSize="30dp" + style="Bold"/> + + + + + + + + + + +