Commit 74011ad6 authored by iman Fauzi's avatar iman Fauzi

fix payment

parent 574af5e9
package com.yono.messeripos;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.TextView;
......@@ -63,6 +65,7 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
public ImageView logoComp;
public RadioButton radioButton;
public TextView textView;
public Button btnPay;
public ViewHolder(@NonNull View itemView) {
super(itemView);
......@@ -71,16 +74,16 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
logoComp = itemView.findViewById(R.id.ivLogo);
radioButton = itemView.findViewById(R.id.rbPayment);
textView = itemView.findViewById(R.id.tvPayment);
btnPay = itemView.findViewById(R.id.btnPay);
Log.d("ViewHolder: ", textView.toString());
cardView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
getPosition = getAdapterPosition();
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);
}
});
}
......
......@@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp"
tools:context=".PaymentActivity">
<androidx.recyclerview.widget.RecyclerView
......@@ -12,4 +13,13 @@
android:layout_height="match_parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.button.MaterialButton
android:id="@+id/btnPay"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="pay"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
</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