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
5f80b369
Commit
5f80b369
authored
Nov 12, 2017
by
Nastuzzi Samy
Browse files
Removing useless file
parent
aac1e9cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/fr/utc/simde/jessy/FoundationListActivity.java
deleted
100644 → 0
View file @
aac1e9cf
package
fr.utc.simde.jessy
;
import
android.content.DialogInterface
;
import
android.os.Bundle
;
import
android.util.Log
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.LinearLayout
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
/**
* Created by Samy on 26/10/2017.
*/
public
class
FoundationListActivity
extends
BaseActivity
{
private
static
final
String
LOG_TAG
=
"_FoundationListActivity"
;
LinearLayout
listLayout
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_foundation_list
);
listLayout
=
findViewById
(
R
.
id
.
foundationList
);
try
{
setFoundationList
(
new
ObjectMapper
().
readTree
(
getIntent
().
getExtras
().
getString
(
"foundationList"
)));
}
catch
(
Exception
e
)
{
Log
.
wtf
(
LOG_TAG
,
"error: "
+
e
.
getMessage
());
dialog
.
errorDialog
(
this
,
getResources
().
getString
(
R
.
string
.
information_collection
),
getResources
().
getString
(
R
.
string
.
error_unexpected
),
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialogInterface
,
int
id
)
{
finish
();
}
});
}
}
@Override
protected
void
onIdentification
(
final
String
badgeId
)
{}
protected
void
setFoundationList
(
final
JsonNode
foundationList
)
throws
Exception
{
for
(
final
JsonNode
foundation
:
foundationList
)
{
Button
foundationButton
=
new
Button
(
this
);
if
(!
foundation
.
has
(
"name"
)
||
!
foundation
.
has
(
"fun_id"
))
throw
new
Exception
(
"Unexpected JSON"
);
foundationButton
.
setText
(
foundation
.
get
(
"name"
).
textValue
());
foundationButton
.
setOnClickListener
(
new
onClickFoundation
(
foundation
.
get
(
"fun_id"
).
intValue
(),
foundation
.
get
(
"name"
).
textValue
()));
this
.
listLayout
.
addView
(
foundationButton
);
}
}
public
class
onClickFoundation
implements
View
.
OnClickListener
{
final
int
foundationId
;
final
String
foundationName
;
public
onClickFoundation
(
final
int
foundationId
,
final
String
foundationName
)
{
this
.
foundationId
=
foundationId
;
this
.
foundationName
=
foundationName
;
}
@Override
public
void
onClick
(
View
view
)
{
nemopaySession
.
setFoundation
(
this
.
foundationId
,
this
.
foundationName
,
-
1
);
startArticleGroupActivity
(
FoundationListActivity
.
this
);
}
};
}
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