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
d0f84c04
Commit
d0f84c04
authored
Aug 26, 2020
by
Muhammad Suryono
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dashboard' into dev
parents
01ddc8a6
fff3b0a2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
76 additions
and
47 deletions
+76
-47
Project.xml
.idea/codeStyles/Project.xml
+24
-0
misc.xml
.idea/misc.xml
+1
-1
CartActivity.java
app/src/main/java/com/yono/messeripos/CartActivity.java
+37
-36
activity_invoice.xml
app/src/main/res/layout/activity_invoice.xml
+1
-1
activity_payment.xml
app/src/main/res/layout/activity_payment.xml
+12
-9
strings.xml
app/src/main/res/values/strings.xml
+1
-0
No files found.
.idea/codeStyles/Project.xml
View file @
d0f84c04
<component
name=
"ProjectCodeStyleConfiguration"
>
<code_scheme
name=
"Project"
version=
"173"
>
<DBN-PSQL>
<case-options
enabled=
"true"
>
<option
name=
"KEYWORD_CASE"
value=
"lower"
/>
<option
name=
"FUNCTION_CASE"
value=
"lower"
/>
<option
name=
"PARAMETER_CASE"
value=
"lower"
/>
<option
name=
"DATATYPE_CASE"
value=
"lower"
/>
<option
name=
"OBJECT_CASE"
value=
"preserve"
/>
</case-options>
<formatting-settings
enabled=
"false"
/>
</DBN-PSQL>
<DBN-SQL>
<case-options
enabled=
"true"
>
<option
name=
"KEYWORD_CASE"
value=
"lower"
/>
<option
name=
"FUNCTION_CASE"
value=
"lower"
/>
<option
name=
"PARAMETER_CASE"
value=
"lower"
/>
<option
name=
"DATATYPE_CASE"
value=
"lower"
/>
<option
name=
"OBJECT_CASE"
value=
"preserve"
/>
</case-options>
<formatting-settings
enabled=
"false"
>
<option
name=
"STATEMENT_SPACING"
value=
"one_line"
/>
<option
name=
"CLAUSE_CHOP_DOWN"
value=
"chop_down_if_statement_long"
/>
<option
name=
"ITERATION_ELEMENTS_WRAPPING"
value=
"chop_down_if_not_single"
/>
</formatting-settings>
</DBN-SQL>
<DBN-PSQL>
<case-options
enabled=
"true"
>
<option
name=
"KEYWORD_CASE"
value=
"lower"
/>
...
...
.idea/misc.xml
View file @
d0f84c04
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_8"
project-jdk-name=
"
1.8
"
project-jdk-type=
"JavaSDK"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_8"
project-jdk-name=
"
JDK
"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
</component>
<component
name=
"ProjectType"
>
...
...
app/src/main/java/com/yono/messeripos/CartActivity.java
View file @
d0f84c04
...
...
@@ -60,7 +60,7 @@ public class CartActivity extends AppCompatActivity {
recyclerView
=
findViewById
(
R
.
id
.
rvCart
);
cartAdapter
=
new
CartAdapter
();
btnCheckout
=
findViewById
(
R
.
id
.
btCheckout
);
btnCheckout
=
findViewById
(
R
.
id
.
btCheckout
);
LinearLayoutManager
llm
=
new
LinearLayoutManager
(
this
);
recyclerView
.
setLayoutManager
(
llm
);
...
...
@@ -70,42 +70,42 @@ public class CartActivity extends AppCompatActivity {
modelsCart
=
new
ViewModelProvider
(
this
).
get
(
MainViewModelsCart
.
class
);
modelsCart
.
getCartProduct
().
observe
(
this
,
new
Observer
<
List
<
ProductCartModels
>>()
{
@Override
public
void
onChanged
(
List
<
ProductCartModels
>
productCartModels
)
{
if
(
productCartModels
!=
null
)
{
dataCart
=
productCartModels
;
cartAdapter
.
setCartAdapter
(
CartActivity
.
this
,
productCartModels
);
recyclerView
.
setAdapter
(
cartAdapter
);
}
}
});
cartAdapter
.
setListener
(
new
CartAdapter
.
CartListener
()
{
@Override
public
void
onDelete
(
ProductCartModels
productCartModels
)
{
modelsCart
.
deleteCart
(
productCartModels
);
}
@Override
public
void
onUpdateQuantityPlus
(
ProductCartModels
productCartModels
)
{
productCartModels
.
setQuantity_orders
(
productCartModels
.
getQuantity_orders
()
+
1
);
modelsCart
.
getCartProduct
().
observe
(
this
,
new
Observer
<
List
<
ProductCartModels
>>()
{
@Override
public
void
onChanged
(
List
<
ProductCartModels
>
productCartModels
)
{
if
(
productCartModels
!=
null
)
{
dataCart
=
productCartModels
;
cartAdapter
.
setCartAdapter
(
CartActivity
.
this
,
productCartModels
);
recyclerView
.
setAdapter
(
cartAdapter
);
}
}
});
cartAdapter
.
setListener
(
new
CartAdapter
.
CartListener
()
{
@Override
public
void
onDelete
(
ProductCartModels
productCartModels
)
{
modelsCart
.
deleteCart
(
productCartModels
);
}
@Override
public
void
onUpdateQuantityPlus
(
ProductCartModels
productCartModels
)
{
productCartModels
.
setQuantity_orders
(
productCartModels
.
getQuantity_orders
()
+
1
);
modelsCart
.
updateCart
(
productCartModels
);
}
}
@Override
public
void
onUpdateQuantityMinus
(
ProductCartModels
productCartModels
)
{
if
(
productCartModels
.
getQuantity_orders
()
>
1
)
{
productCartModels
.
setQuantity_orders
(
productCartModels
.
getQuantity_orders
()-
1
);
modelsCart
.
updateCart
(
productCartModels
);
}
}
@Override
public
void
onUpdateQuantityMinus
(
ProductCartModels
productCartModels
)
{
if
(
productCartModels
.
getQuantity_orders
()
>
1
)
{
productCartModels
.
setQuantity_orders
(
productCartModels
.
getQuantity_orders
()
-
1
);
modelsCart
.
updateCart
(
productCartModels
);
}
}
@Override
public
void
onCheckout
(
ProductCartModels
productCartModels
)
{
}
});
@Override
public
void
onCheckout
(
ProductCartModels
productCartModels
)
{
}
});
btnCheckout
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
...
...
@@ -116,14 +116,15 @@ public class CartActivity extends AppCompatActivity {
OrdersResponse
ordersResponse
=
new
OrdersResponse
();
List
<
ProductCartModels
>
productCartModels
;
Log
.
d
(
"Data cart checkout"
,
"onClick: "
+
dataCart
);
for
(
ProductCartModels
pd
:
dataCart
){
Log
.
d
(
"Data cart checkout"
,
"onClick: "
+
dataCart
);
for
(
ProductCartModels
pd
:
dataCart
)
{
ordersResponse
.
setOrders_id
(
pd
.
getId_orders
());
}
ordersResponse
.
setProduct_cart
(
dataCart
);
modelsCart
.
insertOrders
(
ordersResponse
);
progressDialog
.
dismiss
();
SharedPreferences
.
Editor
editor
=
sharedPreferences
.
edit
();
editor
.
putBoolean
(
SplashScreen
.
CHECKOUT
,
true
);
if
(
editor
.
commit
()){
...
...
app/src/main/res/layout/activity_invoice.xml
View file @
d0f84c04
...
...
@@ -48,7 +48,7 @@
android:id=
"@+id/btCheckout"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/title_
checkout
"
android:text=
"@string/title_
success
"
android:padding=
"15dp"
android:textSize=
"16sp"
android:layout_margin=
"10dp"
...
...
app/src/main/res/layout/activity_payment.xml
View file @
d0f84c04
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
...
...
@@ -6,6 +7,7 @@
android:layout_height=
"match_parent"
tools:context=
".PaymentActivity"
>
<include
android:id=
"@+id/appbar"
layout=
"@layout/app_bar"
...
...
@@ -18,7 +20,8 @@
android:id=
"@+id/cvInvoice"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:padding=
"12dp"
android:padding=
"18dp"
android:layout_marginBottom=
"10dp"
android:layout_margin=
"16dp"
app:cardCornerRadius=
"20dp"
android:scrollbars=
"vertical"
...
...
@@ -41,7 +44,7 @@
android:textSize=
"24sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
tools:text=
"@string/hint_billing"
/>
android:text=
"Billing "
/>
<ImageView
android:id=
"@+id/image_splash"
...
...
@@ -62,7 +65,7 @@
android:textAlignment=
"center"
android:textSize=
"14sp"
app:layout_constraintTop_toBottomOf=
"@+id/image_splash"
tools
:text=
"@string/hint_product_name"
/>
android
:text=
"@string/hint_product_name"
/>
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/tvBillingPrice"
...
...
@@ -73,7 +76,7 @@
android:textAlignment=
"center"
android:textSize=
"14sp"
app:layout_constraintTop_toBottomOf=
"@+id/tvBillingProduct"
tools
:text=
"@string/hint_price"
/>
android
:text=
"@string/hint_price"
/>
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/tvBillingQuantity"
...
...
@@ -84,7 +87,7 @@
android:textAlignment=
"center"
android:textSize=
"14sp"
app:layout_constraintTop_toBottomOf=
"@+id/tvBillingPrice"
tools
:text=
"@string/hint_quantity"
/>
android
:text=
"@string/hint_quantity"
/>
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/tvBillingCategory"
...
...
@@ -95,7 +98,7 @@
android:textAlignment=
"center"
android:textSize=
"14sp"
app:layout_constraintTop_toBottomOf=
"@+id/tvBillingQuantity"
tools
:text=
"@string/hint_category"
/>
android
:text=
"@string/hint_category"
/>
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/tvBillingDesc"
...
...
@@ -106,7 +109,7 @@
android:textAlignment=
"center"
android:textSize=
"14sp"
app:layout_constraintTop_toBottomOf=
"@+id/tvBillingCategory"
tools
:text=
"@string/hint_description"
/>
android
:text=
"@string/hint_description"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
...
...
@@ -115,7 +118,7 @@
android:id=
"@+id/rvPayment"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:overScrollMode=
"
never
"
android:overScrollMode=
"
ifContentScrolls
"
app:layout_constraintTop_toBottomOf=
"@id/cvInvoice"
/>
<com.google.android.material.button.MaterialButton
...
...
@@ -131,4 +134,4 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
</androidx.constraintlayout.widget.ConstraintLayout>
app/src/main/res/values/strings.xml
View file @
d0f84c04
...
...
@@ -23,6 +23,7 @@
<string
name=
"stock"
>
Stock
</string>
<string
name=
"add"
>
Add
</string>
<string
name=
"hint_billing"
>
Billing
</string>
<string
name=
"title_success"
>
Success
</string>
<string-array
name=
"planets_array"
>
<item>
Mercury
</item>
...
...
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