Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
Max Console
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
Amir Firdaus bin Samsudin
Max Console
Commits
e8fd5a1e
Commit
e8fd5a1e
authored
Apr 15, 2019
by
Amir Firdaus bin Samsudin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// Update topap resit
parent
1f190cc1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
267 additions
and
118 deletions
+267
-118
TopapActivity.java
...va/com/maxmoney/maxcddconsole/Activity/TopapActivity.java
+45
-6
activity_topap.xml
app/src/main/res/layout/activity_topap.xml
+222
-112
No files found.
app/src/main/java/com/maxmoney/maxcddconsole/Activity/TopapActivity.java
View file @
e8fd5a1e
...
@@ -49,7 +49,7 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
...
@@ -49,7 +49,7 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
TextView
textView_receiver
,
textView_sender
;
TextView
textView_receiver
,
textView_sender
;
Button
button_operator
,
button_topap
;
Button
button_operator
,
button_topap
;
TextInputEditText
et_reference
;
TextInputEditText
et_reference
;
String
session
=
""
,
operatorId
=
""
,
retails_value
=
""
,
value
=
""
,
whosale_price
=
""
;
String
session
=
""
,
operatorId
=
""
,
retails_value
=
""
,
value
=
""
,
whosale_price
=
""
,
destinationCurrency
=
""
;
StandardProgressDialog
standardProgressDialog
;
StandardProgressDialog
standardProgressDialog
;
ArrayAdapter
<
String
>
spinnerNationalityAdapter
;
ArrayAdapter
<
String
>
spinnerNationalityAdapter
;
LinearLayout
linear_sender
,
linear_reference
;
LinearLayout
linear_sender
,
linear_reference
;
...
@@ -58,6 +58,9 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
...
@@ -58,6 +58,9 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
ArrayList
<
String
>
operatorNames
;
ArrayList
<
String
>
operatorNames
;
ArrayList
<
String
>
valueNames
;
ArrayList
<
String
>
valueNames
;
boolean
status_operator
=
false
;
boolean
status_operator
=
false
;
String
current_topap_operator
=
""
,
current_operator_id
=
""
;
TextView
textView_amount
,
textView_topapRate
,
textView_serviceFee
,
textView_totalAmout
;
LinearLayout
linear_details
;
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
...
@@ -78,6 +81,13 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
...
@@ -78,6 +81,13 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
linear_sender
=
findViewById
(
R
.
id
.
linear_sender
);
linear_sender
=
findViewById
(
R
.
id
.
linear_sender
);
linear_reference
=
findViewById
(
R
.
id
.
linear_reference
);
linear_reference
=
findViewById
(
R
.
id
.
linear_reference
);
linear_details
=
findViewById
(
R
.
id
.
linear_details
);
textView_amount
=
findViewById
(
R
.
id
.
textView_amount
);
textView_topapRate
=
findViewById
(
R
.
id
.
textView_topapRate
);
textView_serviceFee
=
findViewById
(
R
.
id
.
textView_serviceFee
);
textView_totalAmout
=
findViewById
(
R
.
id
.
textView_totalAmout
);
linear_details
.
setVisibility
(
View
.
GONE
);
imageView_back
.
setOnClickListener
(
this
);
imageView_back
.
setOnClickListener
(
this
);
button_operator
.
setOnClickListener
(
this
);
button_operator
.
setOnClickListener
(
this
);
button_topap
.
setOnClickListener
(
this
);
button_topap
.
setOnClickListener
(
this
);
...
@@ -221,7 +231,13 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
...
@@ -221,7 +231,13 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
params
.
put
(
"senderMobileNo"
,
textView_sender
.
getText
().
toString
()+
""
+
editText_sender
.
getText
().
toString
());
params
.
put
(
"senderMobileNo"
,
textView_sender
.
getText
().
toString
()+
""
+
editText_sender
.
getText
().
toString
());
params
.
put
(
"product"
,
value
);
params
.
put
(
"product"
,
value
);
params
.
put
(
"smscontent"
,
et_reference
.
getText
().
toString
());
params
.
put
(
"smscontent"
,
et_reference
.
getText
().
toString
());
params
.
put
(
"operatorId"
,
operatorId
);
if
(
operatorId
.
equals
(
""
)){
params
.
put
(
"operatorId"
,
current_operator_id
);
}
else
{
params
.
put
(
"operatorId"
,
operatorId
);
}
return
params
;
return
params
;
}
}
...
@@ -259,8 +275,11 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
...
@@ -259,8 +275,11 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
@Override
@Override
public
void
onResponse
(
String
response
)
{
public
void
onResponse
(
String
response
)
{
standardProgressDialog
.
dismiss
();
standardProgressDialog
.
dismiss
();
Log
.
d
(
"RESPONSE "
,
response
);
try
{
try
{
JSONObject
obj
=
new
JSONObject
(
response
);
JSONObject
obj
=
new
JSONObject
(
response
);
current_topap_operator
=
obj
.
getString
(
"operator"
);
current_operator_id
=
obj
.
getString
(
"operatorId"
);
showDialogOperator
(
obj
.
getString
(
"countryId"
));
showDialogOperator
(
obj
.
getString
(
"countryId"
));
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -309,6 +328,7 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
...
@@ -309,6 +328,7 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
mDialogOperator
.
dismiss
();
mDialogOperator
.
dismiss
();
status_operator
=
false
;
status_operator
=
false
;
linear_details
.
setVisibility
(
View
.
GONE
);
}
}
});
});
...
@@ -317,6 +337,7 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
...
@@ -317,6 +337,7 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
mDialogOperator
.
dismiss
();
mDialogOperator
.
dismiss
();
status_operator
=
true
;
status_operator
=
true
;
linear_details
.
setVisibility
(
View
.
VISIBLE
);
}
}
});
});
...
@@ -341,6 +362,9 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
...
@@ -341,6 +362,9 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
operatorOnselect
(
mView
,
spinner_operator
,
countryId
,
spinner_value
);
operatorOnselect
(
mView
,
spinner_operator
,
countryId
,
spinner_value
);
}
}
spinner_operator
.
setAdapter
(
new
ArrayAdapter
<
String
>(
mView
.
getContext
(),
android
.
R
.
layout
.
simple_spinner_dropdown_item
,
operatorNames
));
spinner_operator
.
setAdapter
(
new
ArrayAdapter
<
String
>(
mView
.
getContext
(),
android
.
R
.
layout
.
simple_spinner_dropdown_item
,
operatorNames
));
spinner_operator
.
setSelection
(
getIndex
(
spinner_operator
,
current_topap_operator
));
getSpinnerValue
(
mView
,
spinner_value
,
current_operator_id
);
Log
.
d
(
"current_operator_id"
,
current_operator_id
);
}
}
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -475,6 +499,9 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
...
@@ -475,6 +499,9 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
}
}
public
void
valueOnselect
(
final
View
mView
,
final
Spinner
spinner_operator
,
final
Spinner
spinner_value
){
public
void
valueOnselect
(
final
View
mView
,
final
Spinner
spinner_operator
,
final
Spinner
spinner_value
){
if
(
operatorId
.
equals
(
""
)){
operatorId
=
current_operator_id
;
}
StringRequest
stringRequest
=
new
StringRequest
(
GET
,
BasedUrl
.
URL_STAGING
+
"topup/operator/"
+
operatorId
+
"/product"
,
StringRequest
stringRequest
=
new
StringRequest
(
GET
,
BasedUrl
.
URL_STAGING
+
"topup/operator/"
+
operatorId
+
"/product"
,
new
com
.
android
.
volley
.
Response
.
Listener
<
String
>()
{
new
com
.
android
.
volley
.
Response
.
Listener
<
String
>()
{
@Override
@Override
...
@@ -494,13 +521,17 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
...
@@ -494,13 +521,17 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
value
=
spinner
;
value
=
spinner
;
retails_value
=
arrs
.
getString
(
i
);
retails_value
=
arrs
.
getString
(
i
);
whosale_price
=
who
.
getString
(
i
);
whosale_price
=
who
.
getString
(
i
);
destinationCurrency
=
obj
.
getString
(
"destinationCurrency"
);
textView_amount
.
setText
(
value
+
" "
+
destinationCurrency
);
textView_topapRate
.
setText
(
retails_value
+
" "
+
destinationCurrency
);
textView_serviceFee
.
setText
(
"0 MYR"
);
textView_totalAmout
.
setText
(
retails_value
+
" "
+
destinationCurrency
);
Log
.
d
(
"VALUE"
,
value
);
Log
.
d
(
"retails_value"
,
retails_value
);
Log
.
d
(
"WHOSALE PRICE "
,
whosale_price
);
}
}
}
}
}
}
}
catch
(
JSONException
e
){
}
catch
(
JSONException
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -535,4 +566,12 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
...
@@ -535,4 +566,12 @@ public class TopapActivity extends AppCompatActivity implements View.OnClickList
}
}
private
int
getIndex
(
Spinner
spinner
,
String
myString
){
for
(
int
i
=
0
;
i
<
spinner
.
getCount
();
i
++){
if
(
spinner
.
getItemAtPosition
(
i
).
toString
().
equalsIgnoreCase
(
myString
)){
return
i
;
}
}
return
0
;
}
}
}
app/src/main/res/layout/activity_topap.xml
View file @
e8fd5a1e
This diff is collapsed.
Click to expand it.
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