Commit 5d9142dd authored by iman Fauzi's avatar iman Fauzi

fix

parent 64bfc353
package com.yono.messeripos; package com.yono.messeripos;
import android.content.Intent;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log; import android.util.Log;
...@@ -37,6 +38,7 @@ public class MainActivity extends AppCompatActivity { ...@@ -37,6 +38,7 @@ public class MainActivity extends AppCompatActivity {
int id = item.getItemId(); int id = item.getItemId();
if (id == R.id.menu_cart){ if (id == R.id.menu_cart){
startActivity(new Intent(getApplicationContext(), PaymentActivity.class));
Toast.makeText(MainActivity.this, "Pesan cart", Toast.LENGTH_LONG).show(); Toast.makeText(MainActivity.this, "Pesan cart", Toast.LENGTH_LONG).show();
} }
return true; return true;
......
...@@ -13,10 +13,13 @@ import android.widget.TextView; ...@@ -13,10 +13,13 @@ import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.cardview.widget.CardView; import androidx.cardview.widget.CardView;
import androidx.databinding.DataBindingComponent;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.RequestOptions;
import com.google.android.material.button.MaterialButton;
import com.yono.messeripos.databinding.PaymentListBinding;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -34,10 +37,12 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold ...@@ -34,10 +37,12 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
@NonNull @NonNull
@Override @Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()) PaymentListBinding paymentListBinding =
.inflate(R.layout.payment_list, parent, false);
return new ViewHolder(view); // View view = LayoutInflater.from(parent.getContext())
// .inflate(R.layout.payment_list, parent, false);
//
// return new ViewHolder(view);
} }
@Override @Override
...@@ -45,6 +50,7 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold ...@@ -45,6 +50,7 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
holder.cardView.setTag(position); holder.cardView.setTag(position);
holder.radioButton.setChecked(position == getPosition); holder.radioButton.setChecked(position == getPosition);
final PaymentModel paymentModel = paymentModels.get(position); final PaymentModel paymentModel = paymentModels.get(position);
holder.btnPay.setEnabled(false);
ImageView imageView = holder.logoComp; ImageView imageView = holder.logoComp;
...@@ -83,7 +89,7 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold ...@@ -83,7 +89,7 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
getPosition = getAdapterPosition(); getPosition = getAdapterPosition();
notifyDataSetChanged(); notifyDataSetChanged();
if (getPosition == Integer.parseInt(cardView.getTag().toString())) radioButton.setChecked(true); else radioButton.setChecked(false); if (getPosition == Integer.parseInt(cardView.getTag().toString())) radioButton.setChecked(true); else radioButton.setChecked(false);
btnPay.setEnabled(true);
} }
}); });
} }
......
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