Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
meser
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhammad Suryono
meser
Commits
74011ad6
Commit
74011ad6
authored
Aug 23, 2020
by
iman Fauzi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix payment
parent
574af5e9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
PaymentAdapter.java
app/src/main/java/com/yono/messeripos/PaymentAdapter.java
+6
-3
activity_payment.xml
app/src/main/res/layout/activity_payment.xml
+10
-0
No files found.
app/src/main/java/com/yono/messeripos/PaymentAdapter.java
View file @
74011ad6
package
com
.
yono
.
messeripos
;
package
com
.
yono
.
messeripos
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.util.Log
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.Button
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
android.widget.RadioButton
;
import
android.widget.RadioButton
;
import
android.widget.TextView
;
import
android.widget.TextView
;
...
@@ -63,6 +65,7 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
...
@@ -63,6 +65,7 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
public
ImageView
logoComp
;
public
ImageView
logoComp
;
public
RadioButton
radioButton
;
public
RadioButton
radioButton
;
public
TextView
textView
;
public
TextView
textView
;
public
Button
btnPay
;
public
ViewHolder
(
@NonNull
View
itemView
)
{
public
ViewHolder
(
@NonNull
View
itemView
)
{
super
(
itemView
);
super
(
itemView
);
...
@@ -71,16 +74,16 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
...
@@ -71,16 +74,16 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
logoComp
=
itemView
.
findViewById
(
R
.
id
.
ivLogo
);
logoComp
=
itemView
.
findViewById
(
R
.
id
.
ivLogo
);
radioButton
=
itemView
.
findViewById
(
R
.
id
.
rbPayment
);
radioButton
=
itemView
.
findViewById
(
R
.
id
.
rbPayment
);
textView
=
itemView
.
findViewById
(
R
.
id
.
tvPayment
);
textView
=
itemView
.
findViewById
(
R
.
id
.
tvPayment
);
btnPay
=
itemView
.
findViewById
(
R
.
id
.
btnPay
);
Log
.
d
(
"ViewHolder: "
,
textView
.
toString
());
cardView
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
cardView
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
view
)
{
public
void
onClick
(
View
view
)
{
getPosition
=
getAdapterPosition
();
getPosition
=
getAdapterPosition
();
notifyDataSetChanged
();
notifyDataSetChanged
();
if
(
getPosition
==
Integer
.
parseInt
(
cardView
.
getTag
().
toString
()))
radioButton
.
setChecked
(
true
);
if
(
getPosition
==
Integer
.
parseInt
(
cardView
.
getTag
().
toString
()))
radioButton
.
setChecked
(
true
);
else
radioButton
.
setChecked
(
false
);
else
radioButton
.
setChecked
(
false
);
}
}
});
});
}
}
...
...
app/src/main/res/layout/activity_payment.xml
View file @
74011ad6
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:padding=
"10dp"
tools:context=
".PaymentActivity"
>
tools:context=
".PaymentActivity"
>
<androidx.recyclerview.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
...
@@ -12,4 +13,13 @@
...
@@ -12,4 +13,13 @@
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
app:layout_constraintTop_toTopOf=
"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>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment