Commit f562c45b authored by iman Fauzi's avatar iman Fauzi

fix button redirect to payment

parent 037f62b8
...@@ -18,6 +18,7 @@ import android.view.Window; ...@@ -18,6 +18,7 @@ import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.Adapter; import android.widget.Adapter;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Filter; import android.widget.Filter;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.TextView; import android.widget.TextView;
...@@ -57,6 +58,7 @@ public class CartActivity extends AppCompatActivity { ...@@ -57,6 +58,7 @@ public class CartActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cart); setContentView(R.layout.activity_cart);
Button btnCheckout;
Window w = getWindow(); Window w = getWindow();
w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
...@@ -70,6 +72,7 @@ public class CartActivity extends AppCompatActivity { ...@@ -70,6 +72,7 @@ public class CartActivity extends AppCompatActivity {
recyclerView = findViewById(R.id.rvCart); recyclerView = findViewById(R.id.rvCart);
cartAdapter = new CartAdapter(); cartAdapter = new CartAdapter();
btnCheckout = findViewById(R.id.btCheckout);
LinearLayoutManager llm = new LinearLayoutManager(this); LinearLayoutManager llm = new LinearLayoutManager(this);
recyclerView.setLayoutManager(llm); recyclerView.setLayoutManager(llm);
...@@ -112,7 +115,6 @@ public class CartActivity extends AppCompatActivity { ...@@ -112,7 +115,6 @@ public class CartActivity extends AppCompatActivity {
@Override @Override
public void onCheckout(ProductCartModels productCartModels) { public void onCheckout(ProductCartModels productCartModels) {
} }
}); });
...@@ -149,15 +151,14 @@ public class CartActivity extends AppCompatActivity { ...@@ -149,15 +151,14 @@ public class CartActivity extends AppCompatActivity {
// countTotal(); // countTotal();
// } // }
// }); // });
//
// btnCheckout.setOnClickListener(new View.OnClickListener() { btnCheckout.setOnClickListener(new View.OnClickListener() {
// @Override @Override
// public void onClick(View view) { public void onClick(View view) {
// startActivity(new Intent(CartActivity.this, PaymentActivity.class)); startActivity(new Intent(CartActivity.this, PaymentActivity.class));
// finish(); }
// } });
// }); }
// }
// //
// private void countTotal() { // private void countTotal() {
// int price = prices; // int price = prices;
...@@ -175,7 +176,6 @@ public class CartActivity extends AppCompatActivity { ...@@ -175,7 +176,6 @@ public class CartActivity extends AppCompatActivity {
// return NumberFormat.getCurrencyInstance(ID); // return NumberFormat.getCurrencyInstance(ID);
// } // }
} }
}
/** /**
......
...@@ -109,6 +109,8 @@ public class CartAdapter extends RecyclerView.Adapter<CartAdapter.MyViewHolder> ...@@ -109,6 +109,8 @@ public class CartAdapter extends RecyclerView.Adapter<CartAdapter.MyViewHolder>
binding.btMinus.setOnClickListener(view -> { binding.btMinus.setOnClickListener(view -> {
listener.onUpdateQuantityMinus(cartModels); listener.onUpdateQuantityMinus(cartModels);
}); });
} }
} }
} }
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