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
2c28cff2
Commit
2c28cff2
authored
Sep 02, 2020
by
iman Fauzi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into cart
parents
3d82e9cd
a847797c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
10 deletions
+48
-10
build.gradle
app/build.gradle
+2
-0
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+3
-0
FormProductActivity.java
...rc/main/java/com/yono/messeripos/FormProductActivity.java
+25
-1
PaymentActivity.java
app/src/main/java/com/yono/messeripos/PaymentActivity.java
+1
-0
CategoryServise.java
...java/com/yono/messeripos/api/service/CategoryServise.java
+3
-0
activity_payment.xml
app/src/main/res/layout/activity_payment.xml
+14
-9
No files found.
app/build.gradle
View file @
2c28cff2
...
@@ -47,6 +47,8 @@ dependencies {
...
@@ -47,6 +47,8 @@ dependencies {
implementation
'com.github.bumptech.glide:glide:4.3.1'
implementation
'com.github.bumptech.glide:glide:4.3.1'
implementation
'com.squareup.okhttp3:logging-interceptor:4.2.1'
implementation
'com.squareup.okhttp3:logging-interceptor:4.2.1'
implementation
'com.ethanhua:skeleton:1.1.2'
implementation
'com.ethanhua:skeleton:1.1.2'
implementation
'com.github.florent37:expansionpanel:1.2.4'
implementation
'com.google.guava:guava:29.0-jre'
implementation
'io.supercharge:shimmerlayout:2.1.0'
implementation
'io.supercharge:shimmerlayout:2.1.0'
implementation
project
(
':library'
)
implementation
project
(
':library'
)
...
...
app/src/main/AndroidManifest.xml
View file @
2c28cff2
...
@@ -6,6 +6,9 @@
...
@@ -6,6 +6,9 @@
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<!--NFC PERMISSION AND FEATURE-->
<uses-permission
android:name=
"android.permission.NFC"
/>
<uses-feature
android:name=
"android.hardware.nfc"
/>
<uses-feature
<uses-feature
android:name=
"android.hardware.camera"
android:name=
"android.hardware.camera"
...
...
app/src/main/java/com/yono/messeripos/FormProductActivity.java
View file @
2c28cff2
...
@@ -66,6 +66,7 @@ public class FormProductActivity extends AppCompatActivity {
...
@@ -66,6 +66,7 @@ public class FormProductActivity extends AppCompatActivity {
String
locationPath
=
null
;
String
locationPath
=
null
;
int
idCategorySelected
=
0
;
int
idCategorySelected
=
0
;
public
int
id
=
0
;
public
int
id
=
0
;
public
String
categoryName
=
""
;
private
String
[]
permissions
=
new
String
[]{
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
private
String
[]
permissions
=
new
String
[]{
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
};
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
};
...
@@ -76,6 +77,7 @@ public class FormProductActivity extends AppCompatActivity {
...
@@ -76,6 +77,7 @@ public class FormProductActivity extends AppCompatActivity {
List
<
String
>
categorySelect
=
new
ArrayList
<>();
List
<
String
>
categorySelect
=
new
ArrayList
<>();
FormCategory
formCategory
;
FormCategory
formCategory
;
@RequiresApi
(
api
=
Build
.
VERSION_CODES
.
N
)
@Override
@Override
public
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
public
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
...
@@ -139,6 +141,7 @@ public class FormProductActivity extends AppCompatActivity {
...
@@ -139,6 +141,7 @@ public class FormProductActivity extends AppCompatActivity {
progressDialog
.
show
();
progressDialog
.
show
();
CategoryServise
categoryServise
=
client
.
Client
(
CategoryServise
.
class
);
CategoryServise
categoryServise
=
client
.
Client
(
CategoryServise
.
class
);
categoryServise
.
addCategory
(
categoryModels
).
enqueue
(
new
Callback
<
DataResponse
<
CategoryModels
>>()
{
categoryServise
.
addCategory
(
categoryModels
).
enqueue
(
new
Callback
<
DataResponse
<
CategoryModels
>>()
{
@RequiresApi
(
api
=
Build
.
VERSION_CODES
.
N
)
@Override
@Override
public
void
onResponse
(
Call
<
DataResponse
<
CategoryModels
>>
call
,
Response
<
DataResponse
<
CategoryModels
>>
response
)
{
public
void
onResponse
(
Call
<
DataResponse
<
CategoryModels
>>
call
,
Response
<
DataResponse
<
CategoryModels
>>
response
)
{
if
(
response
.
body
().
getStatusData
()){
if
(
response
.
body
().
getStatusData
()){
...
@@ -185,7 +188,11 @@ public class FormProductActivity extends AppCompatActivity {
...
@@ -185,7 +188,11 @@ public class FormProductActivity extends AppCompatActivity {
HashSet
<
String
>
set
=
new
HashSet
<>();
HashSet
<
String
>
set
=
new
HashSet
<>();
List
<
String
>
str
=
new
ArrayList
<>();
List
<
String
>
str
=
new
ArrayList
<>();
categoryModels
=
new
ArrayList
<>();
categoryModels
=
new
ArrayList
<>();
str
.
add
(
"SELECT CATEGORY"
);
if
(
productModelsIntent
==
null
){
str
.
add
(
"SELECT CATEGORY"
);
}
else
{
str
.
add
(
getCategoryById
(
productModelsIntent
.
getIdProduct
()));
}
mainViewModels
.
getCategory
().
observe
(
this
,
listDataResponse
->
{
mainViewModels
.
getCategory
().
observe
(
this
,
listDataResponse
->
{
progressDialog
.
dismiss
();
progressDialog
.
dismiss
();
for
(
CategoryModels
cd:
listDataResponse
.
getData
()){
for
(
CategoryModels
cd:
listDataResponse
.
getData
()){
...
@@ -329,6 +336,23 @@ public class FormProductActivity extends AppCompatActivity {
...
@@ -329,6 +336,23 @@ public class FormProductActivity extends AppCompatActivity {
return
id
;
return
id
;
}
}
private
String
getCategoryById
(
int
s
)
{
CategoryServise
categoryServise
=
client
.
Client
(
CategoryServise
.
class
);
categoryServise
.
getCategoryId
(
s
).
enqueue
(
new
Callback
<
DataResponse
<
CategoryModels
>>()
{
@Override
public
void
onResponse
(
Call
<
DataResponse
<
CategoryModels
>>
call
,
Response
<
DataResponse
<
CategoryModels
>>
response
)
{
categoryName
=
response
.
body
().
getData
().
getNameCategory
();
}
@Override
public
void
onFailure
(
Call
<
DataResponse
<
CategoryModels
>>
call
,
Throwable
t
)
{
}
});
return
categoryName
;
}
private
void
openFile
(){
private
void
openFile
(){
requestPermissions
(
permissions
,
REQUEST_PERMISSIONS
);
requestPermissions
(
permissions
,
REQUEST_PERMISSIONS
);
Intent
i
=
new
Intent
(
Intent
.
ACTION_PICK
,
MediaStore
.
Images
.
Media
.
EXTERNAL_CONTENT_URI
);
Intent
i
=
new
Intent
(
Intent
.
ACTION_PICK
,
MediaStore
.
Images
.
Media
.
EXTERNAL_CONTENT_URI
);
...
...
app/src/main/java/com/yono/messeripos/PaymentActivity.java
View file @
2c28cff2
...
@@ -163,6 +163,7 @@ public class PaymentActivity extends AppCompatActivity {
...
@@ -163,6 +163,7 @@ public class PaymentActivity extends AppCompatActivity {
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"
));
paymentResponses
.
add
(
new
PaymentResponse
(
"https://i.ibb.co/n1V3ZCf/Whats-App-Image-2020-09-01-at-14-50-13.jpg"
,
"nfc"
));
PaymentAdapter
adapter
=
new
PaymentAdapter
(
paymentResponses
,
this
);
PaymentAdapter
adapter
=
new
PaymentAdapter
(
paymentResponses
,
this
);
rvPayment
.
setAdapter
(
adapter
);
rvPayment
.
setAdapter
(
adapter
);
...
...
app/src/main/java/com/yono/messeripos/api/service/CategoryServise.java
View file @
2c28cff2
...
@@ -26,6 +26,9 @@ public interface CategoryServise {
...
@@ -26,6 +26,9 @@ public interface CategoryServise {
@GET
(
ApiHelper
.
VERSI_API_1
+
"category-name/{id}"
)
@GET
(
ApiHelper
.
VERSI_API_1
+
"category-name/{id}"
)
Call
<
DataResponse
<
List
<
CategoryModels
>>>
getCategoryByName
(
@Path
(
"id"
)
String
name
);
Call
<
DataResponse
<
List
<
CategoryModels
>>>
getCategoryByName
(
@Path
(
"id"
)
String
name
);
@GET
(
ApiHelper
.
VERSI_API_1
+
"category/{id}"
)
Call
<
DataResponse
<
CategoryModels
>>
getCategoryId
(
@Path
(
"id"
)
int
id
);
@POST
(
ApiHelper
.
VERSI_API_1
+
"category"
)
@POST
(
ApiHelper
.
VERSI_API_1
+
"category"
)
Call
<
DataResponse
<
CategoryModels
>>
addCategory
(
@Body
CategoryModels
categoryModels
);
Call
<
DataResponse
<
CategoryModels
>>
addCategory
(
@Body
CategoryModels
categoryModels
);
...
...
app/src/main/res/layout/activity_payment.xml
View file @
2c28cff2
...
@@ -40,7 +40,6 @@
...
@@ -40,7 +40,6 @@
android:nestedScrollingEnabled=
"false"
android:nestedScrollingEnabled=
"false"
android:layout_marginTop=
"20dp"
android:layout_marginTop=
"20dp"
tools:layout_editor_absoluteX=
"10dp"
tools:layout_editor_absoluteX=
"10dp"
tools:listitem=
"@layout/item_checkout"
/>
/>
<com.google.android.material.textview.MaterialTextView
<com.google.android.material.textview.MaterialTextView
...
@@ -59,15 +58,21 @@
...
@@ -59,15 +58,21 @@
/>
/>
<androidx.recyclerview.widget.RecyclerView
<ExpandableListView
android:id=
"@+id/rvPayment"
android:layout_width=
"fill_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"10dp"
android:layout_below=
"@+id/tvLabel"
>
android:nestedScrollingEnabled=
"false"
tools:layout_editor_absoluteX=
"10dp"
<androidx.recyclerview.widget.RecyclerView
tools:listitem=
"@layout/payment_list"
android:id=
"@+id/rvPayment"
android:layout_below=
"@id/tvLabel"
/>
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"10dp"
android:nestedScrollingEnabled=
"false"
tools:layout_editor_absoluteX=
"10dp"
tools:listitem=
"@layout/payment_list"
/>
</ExpandableListView>
</RelativeLayout>
</RelativeLayout>
</ScrollView>
</ScrollView>
...
...
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