aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcinzelent <zelent.marcin@gmail.com>2018-04-19 23:03:13 +0200
committermarcinzelent <zelent.marcin@gmail.com>2018-04-19 23:03:13 +0200
commit4e6fc4fcdbcc3c75be13b3f8b80c24e4648fe354 (patch)
tree9588d81ee5e3e470d242f82b015fac6e34d54014 /app/src/main/java/org/marcinzelent/liberavem/ObservationDetailsActivity.java
parent7294c6bd32e362b4c0a64cadbf4dd2c191e1ad8e (diff)
Added details view, improved observations list
Diffstat (limited to 'app/src/main/java/org/marcinzelent/liberavem/ObservationDetailsActivity.java')
-rw-r--r--app/src/main/java/org/marcinzelent/liberavem/ObservationDetailsActivity.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/app/src/main/java/org/marcinzelent/liberavem/ObservationDetailsActivity.java b/app/src/main/java/org/marcinzelent/liberavem/ObservationDetailsActivity.java
new file mode 100644
index 0000000..8373145
--- /dev/null
+++ b/app/src/main/java/org/marcinzelent/liberavem/ObservationDetailsActivity.java
@@ -0,0 +1,36 @@
+package org.marcinzelent.liberavem;
+
+import android.content.Intent;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.widget.TextView;
+
+public class ObservationDetailsActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_observation_details);
+
+ Intent intent = getIntent();
+ Observation observation = (Observation) intent.getSerializableExtra("Observation");
+ //String photoUrl = (String) intent.getSerializableExtra("Photo");
+
+ TextView detailsName = findViewById(R.id.details_name);
+ detailsName.setText(observation.getNameEnglish());
+ TextView detailsCreated = findViewById(R.id.details_created);
+ detailsCreated.setText(observation.getCreated());
+ TextView detailsUser = findViewById(R.id.details_user);
+ detailsUser.setText(observation.getUserId());
+ TextView detailsPopulation = findViewById(R.id.details_population);
+ detailsPopulation.setText(String.valueOf(observation.getPopulation()));
+ TextView detailsPlacename = findViewById(R.id.details_placename);
+ detailsPlacename.setText(observation.getPlaceName());
+ TextView detailsLongitude = findViewById(R.id.details_longitude);
+ detailsLongitude.setText(String.valueOf(observation.getLongitude()));
+ TextView detailsLatitude = findViewById(R.id.details_latitude);
+ detailsLatitude.setText(String.valueOf(observation.getLatitude()));
+ TextView detailsComment = findViewById(R.id.details_comment);
+ if(observation.getComment() != null) detailsComment.setText(observation.getComment());
+ }
+}