Android Open Source - GeoFencingDemo Location Details Activity






From Project

Back to project page GeoFencingDemo.

License

The source code is released under:

MIT License

If you think the Android project GeoFencingDemo listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.ehc.GeoFencingDemo;
/* w w w.  j av a2  s.  c om*/
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

/**
 * Created with IntelliJ IDEA.
 * User: ehc
 * Date: 10/10/13
 * Time: 5:52 PM
 * To change this template use File | Settings | File Templates.
 */
public class LocationDetailsActivity extends GeoFencingActivity {
  TextView locationDetails;
  ImageView frontImage;
  ImageView backImage;
  Button saveButton;
  Button shareButton;

  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.step_result);
    getWidgets();
    showDetails();
  }

  private void getWidgets() {
    locationDetails = (TextView) findViewById(R.id.location_result);
    frontImage = (ImageView) findViewById(R.id.front_image_result);
    frontImage.setMinimumWidth(250);
    frontImage.setMinimumHeight(250);
    backImage = (ImageView) findViewById(R.id.back_image_result);
    frontImage.setPadding(8, 0, 0, 0);
    backImage.setPadding(8, 0, 0, 0);
    backImage.setMinimumWidth(250);
    backImage.setMinimumHeight(250);
    saveButton = (Button) findViewById(R.id.save);
    saveButton.setVisibility(View.GONE);
    shareButton = (Button) findViewById(R.id.send);
    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    params.gravity = Gravity.CENTER_VERTICAL;
    params.setMargins(8, 0, 8, 0);
    shareButton.setLayoutParams(params);
  }

  private void showDetails() {
    String timeStamp = getIntent().getStringExtra("timeStamp");
    final GeoFencingDTO dto = getRecord(timeStamp);
    locationDetails.setText(getLocationDetails(dto));
    frontImage.setImageBitmap(dto.getFrontImage());
    backImage.setImageBitmap(dto.getBackImage());
    shareButton.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
        sendInformation(dto);
      }
    });
  }

  private GeoFencingDTO getRecord(String timeStamp) {
    GeoFencingDTO dto = new GeoFencingDTO();
    SqlLiteDbHelper sqlLiteDbHelper = new SqlLiteDbHelper(getBaseContext());
    dto = sqlLiteDbHelper.getRecord(timeStamp);
    return dto;
  }


}




Java Source Code List

com.ehc.GeoFencingDemo.CameraPreview.java
com.ehc.GeoFencingDemo.FinalActivity.java
com.ehc.GeoFencingDemo.FirstStepActivity.java
com.ehc.GeoFencingDemo.GeoFencingActivity.java
com.ehc.GeoFencingDemo.GeoFencingDTO.java
com.ehc.GeoFencingDemo.HomeActivity.java
com.ehc.GeoFencingDemo.LocationActivity.java
com.ehc.GeoFencingDemo.LocationDetailsActivity.java
com.ehc.GeoFencingDemo.LoginActivity.java
com.ehc.GeoFencingDemo.SecondStepActivity.java
com.ehc.GeoFencingDemo.SqlLiteDbHelper.java
com.ehc.GeoFencingDemo.ThirdStepActivity.java