package shivamdh.com.fitness60;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;


public class DistanceActivity extends Activities {


    DistanceActivity(ViewGroup mainContainer, View theLayout, LayoutInflater theInflate, Context aContext, int activityNum, Activity currActivity) {
        super(mainContainer, theLayout, theInflate, aContext, activityNum, currActivity);
    }
}

@@ -106,84 +106,494 @@
 oid.
-view.LayoutInflater;%0Aimport android.view.View;%0Aimport android.view.ViewGroup
+text.Editable;%0Aimport android.text.TextWatcher;%0Aimport android.view.Gravity;%0Aimport android.view.LayoutInflater;%0Aimport android.view.View;%0Aimport android.view.ViewGroup;%0Aimport android.widget.EditText;%0Aimport android.widget.LinearLayout;%0Aimport android.widget.TableRow;%0Aimport android.widget.TextView;%0A%0Aimport org.w3c.dom.Text;%0A%0Aimport java.util.Locale;%0Aimport java.util.Timer;%0A%0Aimport static shivamdh.com.fitness60.Options.distanceC;%0Aimport static shivamdh.com.fitness60.Options.timerC
 ;%0A%0A%0A
@@ -647,13 +647,51 @@
 s %7B%0A
-%0A%0A
    
+ private TextView repHeader;%0A%0A    public
  Dis
@@ -846,16 +846,80 @@
   super(
+); //just call on a constructor from above%0A        defaultSetup(
 mainCont
@@ -990,12 +990,2244 @@
 y);%0A
-    %7D
+%0A        //replace reps from default activity with distance%0A        repHeader = (TextView) n.findViewById(R.id.reps_text);%0A        if (distanceC) %7B%0A            repHeader.setText(R.string.kmC);%0A        %7D else %7B%0A            repHeader.setText(R.string.milesC);%0A        %7D%0A%0A        TableRow header = (TableRow) n.findViewById(R.id.new_workout_header);%0A        header.removeViewAt(1); //remove weight column%0A%0A        //set the columns to correct widths%0A        table.setColumnStretchable(0, true);%0A        table.setColumnStretchable(1, true);%0A        table.setColumnStretchable(2, true);%0A%0A        start = System.currentTimeMillis();%0A        setTimer = new Timer();%0A        setTimer.schedule(new runTimer(ourActivity), 1000, 1000);%0A%0A        createDistanceRow();%0A    %7D%0A%0A    public void createDistanceRow() %7B%0A        newRow = new TableRow(theContext);%0A        sets = new EditText(theContext);%0A        reps = new EditText(theContext);%0A        setNumber++;%0A        sets.setText(String.format(Locale.getDefault(), %22%25d%22, setNumber));%0A        if (setNumber == 1) %7B%0A            createFirstDistanceRowOnly(); //special syntax for first row only%0A        %7D%0A%0A        sets.setGravity(Gravity.CENTER);%0A        reps.setGravity(Gravity.CENTER);%0A        newRow.addView(sets);%0A        newRow.addView(reps);%0A%0A        if (timerC) %7B%0A            time = new TextView(theContext);%0A            time.setText(R.string.defaultTime);%0A            start = System.currentTimeMillis();%0A            time.setGravity(Gravity.CENTER);%0A            newRow.addView(time);%0A        %7D%0A        table.addView(newRow,setNumber);%0A%0A    %7D%0A%0A    private void createFirstDistanceRowOnly() %7B%0A        reps.setHint(%22Distance%22);%0A        reps.addTextChangedListener(new TextWatcher() %7B%0A            @Override%0A            public void beforeTextChanged(CharSequence s, int start, int count, int after) %7B%0A%0A            %7D%0A%0A            @Override%0A            public void onTextChanged(CharSequence s, int start, int before, int count) %7B%0A               try %7B%0A                   firstReps = Integer.parseInt(s.toString());%0A               %7D catch (Exception ignored) %7B%0A%0A               %7D%0A            %7D%0A%0A            @Override%0A            public void afterTextChanged(Editable s) %7B%0A%0A            %7D%0A        %7D);%0A    %7D%0A
 %0A%7D%0A

Set up a distance activity for users to use