Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hds
flexin
android-app
Commits
2a02f23b
Commit
2a02f23b
authored
Oct 27, 2017
by
Nastuzzi Samy
Browse files
Foundation management
Preparation Optimization
parent
0173795e
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/fr/utc/simde/payutc/BaseActivity.java
View file @
2a02f23b
...
...
@@ -17,7 +17,7 @@ import fr.utc.simde.payutc.tools.NemopaySession;
*/
public
abstract
class
BaseActivity
extends
NFCActivity
{
private
static
final
String
LOG_TAG
=
"_
LOG_TAG
"
;
private
static
final
String
LOG_TAG
=
"_
BaseActivity
"
;
protected
static
Dialog
dialog
;
protected
static
NemopaySession
nemopaySession
;
protected
static
CASConnexion
casConnexion
;
...
...
@@ -76,7 +76,9 @@ public abstract class BaseActivity extends NFCActivity {
throw
new
Exception
(
"JSON unexpected"
);
if
(
foundationList
.
size
()
==
0
)
{
dialog
.
stopLoading
();
fatal
(
activity
,
getString
(
R
.
string
.
information_collection
),
nemopaySession
.
getUsername
()
+
" "
+
getString
(
R
.
string
.
user_no_rights
));
return
;
}
...
...
@@ -85,6 +87,13 @@ public abstract class BaseActivity extends NFCActivity {
throw
new
Exception
(
"Unexpected JSON"
);
}
if
(
foundationList
.
size
()
==
1
)
{
dialog
.
stopLoading
();
nemopaySession
.
setFoundation
(
foundationList
.
get
(
0
).
get
(
"fun_id"
).
intValue
());
Log
.
d
(
LOG_TAG
,
String
.
valueOf
(
foundationList
.
get
(
0
).
get
(
"fun_id"
).
intValue
()));
return
;
}
Intent
intent
=
new
Intent
(
activity
,
FoundationListActivity
.
class
);
intent
.
putExtra
(
"foundationList"
,
response
);
dialog
.
stopLoading
();
...
...
app/src/main/java/fr/utc/simde/payutc/FoundationListActivity.java
View file @
2a02f23b
...
...
@@ -62,7 +62,7 @@ public class FoundationListActivity extends BaseActivity {
throw
new
Exception
(
"Unexpected JSON"
);
foundationButton
.
setText
(
foundation
.
get
(
"name"
).
textValue
());
foundationButton
.
setOnClickListener
(
new
onClickFoundation
(
foundation
.
get
(
"fun_id"
).
asInt
()));
foundationButton
.
setOnClickListener
(
new
onClickFoundation
(
foundation
.
get
(
"fun_id"
).
intValue
()));
linearLayout
.
addView
(
foundationButton
);
}
...
...
Write
Preview
Supports
Markdown
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