Commit 5f80b369 authored by Nastuzzi Samy's avatar Nastuzzi Samy
Browse files

Removing useless file

parent 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);
}
};
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment