package org.yriarte.tracklogger;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;


public class TrackLogger extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_track_logger);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_track_logger, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_log_start) {
            return true;
        }
        if (id == R.id.action_log_stop) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}

@@ -158,16 +158,102 @@
 nuItem;%0A
+import android.widget.TextView;%0Aimport java.sql.Timestamp;%0Aimport java.util.Calendar;%0A
 %0A%0Apublic
@@ -471,16 +471,105 @@
 ogger);%0A
+        updateTrackPoint(43.611769,4.010320,3,Calendar.getInstance().getTimeInMillis());%0A
     %7D%0A%0A%0A
@@ -1376,16 +1376,467 @@
 (item);%0A
-
     %7D%0A
+%0A    public void updateTrackPoint(double lat, double lon, double ele, long time) %7B%0A        ((TextView)findViewById(R.id.value_lat)).setText(Double.valueOf(lat).toString());%0A        ((TextView)findViewById(R.id.value_lon)).setText(Double.valueOf(lon).toString());%0A        ((TextView)findViewById(R.id.value_ele)).setText(Double.valueOf(ele).toString());%0A        ((TextView)findViewById(R.id.value_time)).setText(new Timestamp(time).toString());%0A    %7D%0A%0A
 %7D%0A

update track point UI