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
152d4f10
Commit
152d4f10
authored
Aug 24, 2020
by
Muhammad Suryono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Paymen adapter dan category
parent
6d594ba1
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
48 additions
and
15 deletions
+48
-15
CartActivity.java
app/src/main/java/com/yono/messeripos/CartActivity.java
+12
-0
MainActivity.java
app/src/main/java/com/yono/messeripos/MainActivity.java
+2
-0
PaymentActivity.java
app/src/main/java/com/yono/messeripos/PaymentActivity.java
+1
-0
ToolbarApp.java
app/src/main/java/com/yono/messeripos/ToolbarApp.java
+2
-2
CategoryAdapter.java
...ain/java/com/yono/messeripos/adapter/CategoryAdapter.java
+7
-1
PaymentAdapter.java
...main/java/com/yono/messeripos/adapter/PaymentAdapter.java
+11
-0
ic_baseline_notification_important_24.xml
...in/res/drawable/ic_baseline_notification_important_24.xml
+5
-0
item_category.xml
app/src/main/res/layout/item_category.xml
+3
-1
payment_list.xml
app/src/main/res/layout/payment_list.xml
+4
-11
colors.xml
app/src/main/res/values/colors.xml
+1
-0
No files found.
app/src/main/java/com/yono/messeripos/CartActivity.java
View file @
152d4f10
...
@@ -3,12 +3,14 @@ package com.yono.messeripos;
...
@@ -3,12 +3,14 @@ package com.yono.messeripos;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.annotation.SuppressLint
;
import
android.annotation.SuppressLint
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.ImageButton
;
import
android.widget.ImageButton
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.google.android.material.appbar.MaterialToolbar
;
import
com.google.android.material.appbar.MaterialToolbar
;
import
com.google.android.material.button.MaterialButton
;
import
com.google.android.material.textfield.TextInputEditText
;
import
com.google.android.material.textfield.TextInputEditText
;
import
java.text.NumberFormat
;
import
java.text.NumberFormat
;
...
@@ -19,6 +21,7 @@ public class CartActivity extends AppCompatActivity {
...
@@ -19,6 +21,7 @@ public class CartActivity extends AppCompatActivity {
ImageButton
btMinus
,
btPlus
,
btDelete
;
ImageButton
btMinus
,
btPlus
,
btDelete
;
TextInputEditText
tiQty
;
TextInputEditText
tiQty
;
TextView
tvQtyView
,
tvPrice
,
tvTotal
;
TextView
tvQtyView
,
tvPrice
,
tvTotal
;
MaterialButton
btnCheckout
;
public
int
counter
,
prices
;
public
int
counter
,
prices
;
...
@@ -37,6 +40,7 @@ public class CartActivity extends AppCompatActivity {
...
@@ -37,6 +40,7 @@ public class CartActivity extends AppCompatActivity {
btMinus
=
findViewById
(
R
.
id
.
btMinus
);
btMinus
=
findViewById
(
R
.
id
.
btMinus
);
btPlus
=
findViewById
(
R
.
id
.
btPlus
);
btPlus
=
findViewById
(
R
.
id
.
btPlus
);
btDelete
=
findViewById
(
R
.
id
.
btDelete
);
btDelete
=
findViewById
(
R
.
id
.
btDelete
);
btnCheckout
=
findViewById
(
R
.
id
.
btCheckout
);
tiQty
=
findViewById
(
R
.
id
.
etQty
);
tiQty
=
findViewById
(
R
.
id
.
etQty
);
tvQtyView
=
findViewById
(
R
.
id
.
tvQuantity
);
tvQtyView
=
findViewById
(
R
.
id
.
tvQuantity
);
...
@@ -73,6 +77,14 @@ public class CartActivity extends AppCompatActivity {
...
@@ -73,6 +77,14 @@ public class CartActivity extends AppCompatActivity {
countTotal
();
countTotal
();
}
}
});
});
btnCheckout
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
startActivity
(
new
Intent
(
CartActivity
.
this
,
PaymentActivity
.
class
));
finish
();
}
});
}
}
private
void
countTotal
()
{
private
void
countTotal
()
{
...
...
app/src/main/java/com/yono/messeripos/MainActivity.java
View file @
152d4f10
package
com
.
yono
.
messeripos
;
package
com
.
yono
.
messeripos
;
import
android.app.Notification
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Build
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Bundle
;
...
@@ -11,6 +12,7 @@ import android.view.WindowManager;
...
@@ -11,6 +12,7 @@ import android.view.WindowManager;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.widget.Toolbar
;
import
androidx.appcompat.widget.Toolbar
;
import
androidx.core.app.NotificationCompat
;
import
androidx.core.content.ContextCompat
;
import
androidx.core.content.ContextCompat
;
import
androidx.databinding.DataBindingUtil
;
import
androidx.databinding.DataBindingUtil
;
import
androidx.lifecycle.Observer
;
import
androidx.lifecycle.Observer
;
...
...
app/src/main/java/com/yono/messeripos/PaymentActivity.java
View file @
152d4f10
...
@@ -36,6 +36,7 @@ public class PaymentActivity extends AppCompatActivity {
...
@@ -36,6 +36,7 @@ public class PaymentActivity extends AppCompatActivity {
LinearLayoutManager
llm
=
new
LinearLayoutManager
(
this
);
LinearLayoutManager
llm
=
new
LinearLayoutManager
(
this
);
rvPayment
.
setLayoutManager
(
llm
);
rvPayment
.
setLayoutManager
(
llm
);
paymentResponses
.
add
(
new
PaymentResponse
(
"https://i.ibb.co/RjJQT9K/BNI-logo.png"
,
"cash"
));
paymentResponses
.
add
(
new
PaymentResponse
(
"https://i.ibb.co/XCsdmmT/Bank-Mandiri-logo.png"
,
"mandiri"
));
paymentResponses
.
add
(
new
PaymentResponse
(
"https://i.ibb.co/XCsdmmT/Bank-Mandiri-logo.png"
,
"mandiri"
));
paymentResponses
.
add
(
new
PaymentResponse
(
"https://i.ibb.co/2n65nCT/bca-bank-central-asia.png"
,
"bca"
));
paymentResponses
.
add
(
new
PaymentResponse
(
"https://i.ibb.co/2n65nCT/bca-bank-central-asia.png"
,
"bca"
));
paymentResponses
.
add
(
new
PaymentResponse
(
"https://i.ibb.co/RjJQT9K/BNI-logo.png"
,
"bni"
));
paymentResponses
.
add
(
new
PaymentResponse
(
"https://i.ibb.co/RjJQT9K/BNI-logo.png"
,
"bni"
));
...
...
app/src/main/java/com/yono/messeripos/ToolbarApp.java
View file @
152d4f10
...
@@ -2,9 +2,9 @@ package com.yono.messeripos;
...
@@ -2,9 +2,9 @@ package com.yono.messeripos;
import
android.content.Context
;
import
android.content.Context
;
import
com.google.android.material.appbar.MaterialToolbar
;
public
class
ToolbarApp
{
public
class
ToolbarApp
{
public
ToolbarApp
(
Context
context
,
int
toolbar
,
String
title
)
{
}
}
}
app/src/main/java/com/yono/messeripos/adapter/CategoryAdapter.java
View file @
152d4f10
...
@@ -55,9 +55,15 @@ public class CategoryAdapter extends RecyclerView.Adapter<CategoryAdapter.MyView
...
@@ -55,9 +55,15 @@ public class CategoryAdapter extends RecyclerView.Adapter<CategoryAdapter.MyView
super
(
itemView
.
getRoot
());
super
(
itemView
.
getRoot
());
this
.
binding
=
itemView
;
this
.
binding
=
itemView
;
}
}
public
void
binData
(
CategoryModels
categoryModels
){
public
void
binData
(
CategoryModels
categoryModels
){
binding
.
setCategory
(
categoryModels
);
binding
.
setCategory
(
categoryModels
);
binding
.
cvCategory
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
binding
.
cvCategory
.
toggle
();
}
});
}
}
}
}
}
}
app/src/main/java/com/yono/messeripos/adapter/PaymentAdapter.java
View file @
152d4f10
...
@@ -6,6 +6,7 @@ import android.util.Log;
...
@@ -6,6 +6,7 @@ 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.Toast
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.cardview.widget.CardView
;
import
androidx.cardview.widget.CardView
;
...
@@ -77,6 +78,7 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
...
@@ -77,6 +78,7 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
public
class
ViewHolder
extends
RecyclerView
.
ViewHolder
{
public
class
ViewHolder
extends
RecyclerView
.
ViewHolder
{
MaterialCardView
cardView
;
MaterialCardView
cardView
;
PaymentListBinding
binding
;
PaymentListBinding
binding
;
public
int
position
;
public
ViewHolder
(
@NonNull
PaymentListBinding
view
)
{
public
ViewHolder
(
@NonNull
PaymentListBinding
view
)
{
super
(
view
.
getRoot
());
super
(
view
.
getRoot
());
this
.
binding
=
view
;
this
.
binding
=
view
;
...
@@ -90,6 +92,15 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
...
@@ -90,6 +92,15 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
binding
.
setPayment
(
paymentResponse
);
binding
.
setPayment
(
paymentResponse
);
binding
.
setLogo
(
paymentResponse
.
getUrl
());
binding
.
setLogo
(
paymentResponse
.
getUrl
());
Log
.
d
(
"Position "
,
""
+
getAdapterPosition
());
binding
.
cvPayment
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
Log
.
d
(
"Click VC"
,
paymentResponse
.
getBank
());
binding
.
cvPayment
.
toggle
();
}
});
}
}
}
}
}
}
app/src/main/res/drawable/ic_baseline_notification_important_24.xml
0 → 100644
View file @
152d4f10
<vector
android:height=
"24dp"
android:tint=
"#FC151B"
android:viewportHeight=
"24"
android:viewportWidth=
"24"
android:width=
"24dp"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<path
android:fillColor=
"@android:color/white"
android:pathData=
"M18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2zM13,16h-2v-2h2v2zM13,12h-2L11,8h2v4zM12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2z"
/>
</vector>
app/src/main/res/layout/item_category.xml
View file @
152d4f10
...
@@ -11,9 +11,11 @@
...
@@ -11,9 +11,11 @@
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_height=
"40dp"
android:layout_height=
"40dp"
android:layout_width=
"wrap_content"
>
android:layout_width=
"wrap_content"
android:layout_marginEnd=
"5dp"
>
<com.google.android.material.card.MaterialCardView
<com.google.android.material.card.MaterialCardView
android:id=
"@+id/cvCategory"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:backgroundTint=
"@color/ic_launcher_background"
android:backgroundTint=
"@color/ic_launcher_background"
...
...
app/src/main/res/layout/payment_list.xml
View file @
152d4f10
...
@@ -21,11 +21,14 @@
...
@@ -21,11 +21,14 @@
<com.google.android.material.card.MaterialCardView
<com.google.android.material.card.MaterialCardView
android:id=
"@+id/cvPayment"
android:id=
"@+id/cvPayment"
android:clickable=
"true"
android:focusable=
"true"
android:checkable=
"true"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:strokeWidth=
"1dp"
app:strokeWidth=
"1dp"
app:strokeColor=
"
#22333333
"
>
app:strokeColor=
"
@color/color_stroke
"
>
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
@@ -64,16 +67,6 @@
...
@@ -64,16 +67,6 @@
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
/>
<com.google.android.material.radiobutton.MaterialRadioButton
android:id=
"@+id/rbPayment"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:enabled=
"false"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"@id/ivLogo"
app:layout_constraintTop_toTopOf=
"@id/ivLogo"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
</com.google.android.material.card.MaterialCardView>
...
...
app/src/main/res/values/colors.xml
View file @
152d4f10
...
@@ -4,4 +4,5 @@
...
@@ -4,4 +4,5 @@
<color
name=
"colorPrimaryDark"
>
#3498DB
</color>
<color
name=
"colorPrimaryDark"
>
#3498DB
</color>
<color
name=
"colorAccent"
>
#0f4c75
</color>
<color
name=
"colorAccent"
>
#0f4c75
</color>
<color
name=
"colorWhite"
>
#fff
</color>
<color
name=
"colorWhite"
>
#fff
</color>
<color
name=
"color_stroke"
>
#22333333
</color>
</resources>
</resources>
\ 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