diff --git a/app/src/main/java/com/example/leo/fitnessdiy/Adapter/JogginHistoryAdapter.java b/app/src/main/java/com/example/leo/fitnessdiy/Adapter/JogginHistoryAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..ec4b71f015fa6aafb6e1f1cb1ae15c7ec8332630 --- /dev/null +++ b/app/src/main/java/com/example/leo/fitnessdiy/Adapter/JogginHistoryAdapter.java @@ -0,0 +1,75 @@ +package com.example.leo.fitnessdiy.Adapter; + +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.example.leo.fitnessdiy.R; +import com.example.leo.fitnessdiy.model.Jogging; + +import java.util.List; + +/** + * Created by Leo on 22/02/2018. + */ + +public class JogginHistoryAdapter extends RecyclerView.Adapter<JogginHistoryAdapter.JoggingHistoryViewHolder> { + private List<Jogging> joggings; + + public JogginHistoryAdapter(List<Jogging> j) { + this.joggings = j; + } + + @Override + public JoggingHistoryViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + View v = LayoutInflater.from(parent.getContext()) + .inflate(R.layout.jogging_card, parent, false); + + return new JoggingHistoryViewHolder(v); + } + + @Override + public void onBindViewHolder(JogginHistoryAdapter.JoggingHistoryViewHolder holder, int position) { + holder.Date.setText(joggings.get(position).getDate()); + holder.Time.setText( + String.format("%s - %s", joggings.get(position).getStart(), + joggings.get(position).getEnd()) + ); + holder.Distance.setText(String.format("Your Jogging Distance : %s m", + joggings.get(position).getDistance())); + + holder.Track.setText( + String.format("You have been running from %s to %s", + joggings.get(position).getStartingPoint(), + joggings.get(position).getEndPoint()) + ); + } + + @Override + public int getItemCount() { + return joggings.size(); + } + + @Override + public void onAttachedToRecyclerView(RecyclerView recyclerView) { + super.onAttachedToRecyclerView(recyclerView); + } + + public static class JoggingHistoryViewHolder extends RecyclerView.ViewHolder{ + TextView Date; + TextView Time; + TextView Distance; + TextView Track; + + public JoggingHistoryViewHolder(View itemView) { + super(itemView); + + Date = (TextView) itemView.findViewById(R.id.jogging_date); + Time = (TextView) itemView.findViewById(R.id.jogging_time); + Distance = (TextView) itemView.findViewById(R.id.jogging_distance); + Track = (TextView) itemView.findViewById(R.id.jogging_track); + } + } +} diff --git a/app/src/main/java/com/example/leo/fitnessdiy/Adapter/PlankHistoryAdapter.java b/app/src/main/java/com/example/leo/fitnessdiy/Adapter/PlankHistoryAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..41b31d3939de138321c9f532e6e2bba9a7e35227 --- /dev/null +++ b/app/src/main/java/com/example/leo/fitnessdiy/Adapter/PlankHistoryAdapter.java @@ -0,0 +1,68 @@ +package com.example.leo.fitnessdiy.Adapter; + +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.example.leo.fitnessdiy.R; +import com.example.leo.fitnessdiy.model.Jogging; +import com.example.leo.fitnessdiy.model.Plank; + +import java.util.List; + +/** + * Created by Leo on 22/02/2018. + */ + +public class PlankHistoryAdapter extends RecyclerView.Adapter<PlankHistoryAdapter.PlankHistoryViewHolder>{ + private List<Plank> planks; + + public PlankHistoryAdapter(List<Plank> p) { + this.planks = p; + } + + @Override + public PlankHistoryViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + View v = LayoutInflater.from(parent.getContext()) + .inflate(R.layout.plank_card, parent, false); + + return new PlankHistoryViewHolder(v); + } + + @Override + public void onBindViewHolder(PlankHistoryViewHolder holder, int position) { + holder.Date.setText(planks.get(position).getDate()); + holder.Time.setText( + String.format("%s - %s", planks.get(position).getStart(), + planks.get(position).getEnd()) + ); + holder.Duration.setText(String.format("You last for : %s detik", + planks.get(position).getDuration())); + } + + @Override + public int getItemCount() { + return planks.size(); + } + + @Override + public void onAttachedToRecyclerView(RecyclerView recyclerView) { + super.onAttachedToRecyclerView(recyclerView); + } + + public static class PlankHistoryViewHolder extends RecyclerView.ViewHolder{ + TextView Date; + TextView Time; + TextView Duration; + + public PlankHistoryViewHolder(View itemView) { + super(itemView); + + Date = (TextView) itemView.findViewById(R.id.plank_date); + Time = (TextView) itemView.findViewById(R.id.plank_time); + Duration = (TextView) itemView.findViewById(R.id.plank_duration); + } + } +} diff --git a/app/src/main/java/com/example/leo/fitnessdiy/HIstoryActivity.java b/app/src/main/java/com/example/leo/fitnessdiy/HIstoryActivity.java index cfb5b6f7d83cf448cc602c0a2953eba59595d4d3..bed6a4be13fb9e2987da7c0c0bfecffa845e5ac0 100644 --- a/app/src/main/java/com/example/leo/fitnessdiy/HIstoryActivity.java +++ b/app/src/main/java/com/example/leo/fitnessdiy/HIstoryActivity.java @@ -1,18 +1,28 @@ package com.example.leo.fitnessdiy; +import android.content.Context; +import android.hardware.Sensor; +import android.hardware.SensorManager; import android.os.AsyncTask; import android.os.StrictMode; +import android.support.design.widget.TabLayout; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; +import android.support.v7.widget.CardView; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; +import android.util.Log; +import android.view.View; import android.widget.TextView; +import com.example.leo.fitnessdiy.Adapter.JogginHistoryAdapter; +import com.example.leo.fitnessdiy.Adapter.PlankHistoryAdapter; import com.example.leo.fitnessdiy.Utilities.NetworkUtils; import com.example.leo.fitnessdiy.model.History; import com.example.leo.fitnessdiy.model.Jogging; +import com.example.leo.fitnessdiy.model.Plank; import com.example.leo.fitnessdiy.model.PushUp; import com.example.leo.fitnessdiy.model.SitUp; import com.example.leo.fitnessdiy.routes.api; @@ -30,25 +40,76 @@ import java.util.List; public class HIstoryActivity extends AppCompatActivity { - public static final String TAG = HIstoryActivity.class.getSimpleName(); private RecyclerView mRecyclerView; - private List<Jogging> joggingHistory; + private RecyclerView plankRecyclerView; + private List<Jogging> joggingHistory = new ArrayList<>(); + private CardView jogging; + private CardView plank; private List<PushUp> pushupHistory; + private List<Plank> plankHistory = new ArrayList<>(); private List<SitUp> situpHistory; + public static final String TAG = HIstoryActivity.class.getSimpleName(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_history); -// mRecyclerView = (RecyclerView) findViewById(R.id.rv_history); -// -// LinearLayoutManager layoutManager = new LinearLayoutManager(this); -// -// mRecyclerView.setLayoutManager(layoutManager); -// mRecyclerView.setHasFixedSize(true); -// RecyclerViewAdapter rv = new RecyclerViewAdapter(histories); -// mRecyclerView.setAdapter(rv); + mRecyclerView = (RecyclerView) findViewById(R.id.jogging_history); + mRecyclerView.setVisibility(View.GONE); + + plankRecyclerView = (RecyclerView) findViewById(R.id.plank_history); + plankRecyclerView.setVisibility(View.GONE); + + getJoggingData(); + getPlankData(); + + jogging = (CardView) findViewById(R.id.jogging); + jogging.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Log.d(TAG, "Jogging Title Clicked"); + if (mRecyclerView.getVisibility() == View.GONE) { + Log.d(TAG, "Jogging View Gone"); + LinearLayoutManager layoutManager = new LinearLayoutManager(getApplicationContext()); + +// Set Jogging Adapter + mRecyclerView.setLayoutManager(layoutManager); + mRecyclerView.setHasFixedSize(true); + JogginHistoryAdapter adapter = new JogginHistoryAdapter(joggingHistory); + mRecyclerView.setAdapter(adapter); + mRecyclerView.setVisibility(View.VISIBLE); + } else { + Log.d(TAG, "Jogging View Visible"); + mRecyclerView.setVisibility(View.GONE); + mRecyclerView.removeAllViewsInLayout(); + } + } + }); + + plank = (CardView) findViewById(R.id.plank); + plank.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Log.d(TAG, "Plank Title Clicked"); + if (plankRecyclerView.getVisibility() == View.GONE) { + LinearLayoutManager layoutManager2 = new LinearLayoutManager(getApplicationContext()); + //Set Plank Adapter + plankRecyclerView.setLayoutManager(layoutManager2); + plankRecyclerView.setHasFixedSize(true); + PlankHistoryAdapter pa = new PlankHistoryAdapter(plankHistory); + plankRecyclerView.setAdapter(pa); + plankRecyclerView.setVisibility(View.VISIBLE); + Log.d(TAG, "Plank View Now Visible"); + } else { + plankRecyclerView.setVisibility(View.GONE); + plankRecyclerView.removeAllViewsInLayout(); + Log.d(TAG, "Plank View Now Gone"); + + } + } + }); + } public void getJoggingData() { @@ -56,6 +117,7 @@ public class HIstoryActivity extends AppCompatActivity { String response = NetworkUtils.getResponseFromHttpUrl( new URL(api.JOGGING_HISTORY_URL + "1") ); + Log.d(TAG, response); JSONArray jsonArray = new JSONArray(response); for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); @@ -67,6 +129,32 @@ public class HIstoryActivity extends AppCompatActivity { jsonObject.getString("starting_point"), jsonObject.getString("end_point") )); + Log.d(TAG, i + jsonObject.getString("jogging_date")); + } + } catch (MalformedURLException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + public void getPlankData() { + try { + String response = NetworkUtils.getResponseFromHttpUrl( + new URL(api.PLANK_HISTORY_URL + "1") + ); + Log.d(TAG, response); + JSONArray jsonArray = new JSONArray(response); + for (int i = 0; i < jsonArray.length(); i++) { + JSONObject jsonObject = jsonArray.getJSONObject(i); + plankHistory.add(new Plank( + jsonObject.getString("plank_date"), + jsonObject.getString("plank_time_start"), + jsonObject.getString("plank_time_end"), + jsonObject.getInt("plank_duration") + )); } } catch (MalformedURLException e) { e.printStackTrace(); diff --git a/app/src/main/java/com/example/leo/fitnessdiy/JoggingActivity.java b/app/src/main/java/com/example/leo/fitnessdiy/JoggingActivity.java index 5ade481ec5d14cce8d75864d6d587049733b6880..a2141ddd253fcb369ab9d3bd7ed3229bcabdc22d 100644 --- a/app/src/main/java/com/example/leo/fitnessdiy/JoggingActivity.java +++ b/app/src/main/java/com/example/leo/fitnessdiy/JoggingActivity.java @@ -6,6 +6,10 @@ import android.content.Context; import android.content.DialogInterface; import android.content.pm.PackageManager; import android.graphics.Color; +import android.hardware.Sensor; +import android.hardware.SensorEvent; +import android.hardware.SensorEventListener; +import android.hardware.SensorManager; import android.location.Address; import android.location.Geocoder; import android.location.Location; @@ -15,6 +19,7 @@ import android.os.Build; import android.os.StrictMode; import android.support.annotation.NonNull; import android.support.annotation.Nullable; +import android.support.annotation.RequiresApi; import android.support.v4.app.ActivityCompat; import android.support.v4.app.FragmentActivity; import android.os.Bundle; @@ -29,6 +34,7 @@ import android.widget.TextView; import android.widget.Toast; import com.example.leo.fitnessdiy.Utilities.NetworkUtils; +import com.example.leo.fitnessdiy.Utilities.PositionUtils; import com.example.leo.fitnessdiy.model.Jogging; import com.example.leo.fitnessdiy.routes.api; import com.google.android.gms.common.ConnectionResult; @@ -68,6 +74,7 @@ import java.util.Calendar; import java.util.List; import java.util.Locale; +@RequiresApi(api = Build.VERSION_CODES.KITKAT) public class JoggingActivity extends FragmentActivity implements OnMapReadyCallback, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, @@ -108,6 +115,9 @@ public class JoggingActivity extends FragmentActivity implements OnMapReadyCallb private TextView infoJoggingEnd; private Button mButton; private String startTime; + SensorManager sensorManager; + Sensor stepSensor; + private double distance = 0; @Override protected void onCreate(Bundle savedInstanceState) { @@ -251,6 +261,10 @@ public class JoggingActivity extends FragmentActivity implements OnMapReadyCallb public void onLocationChanged(Location location) { mMap.clear(); + distance += PositionUtils.distance(mLastKnownLocation.getLatitude(), + mLastKnownLocation.getLongitude(), + location.getLatitude(), + location.getLongitude()); MarkerOptions mp = new MarkerOptions(); mp.position(new LatLng(location.getLatitude(), location.getLongitude())); @@ -260,6 +274,7 @@ public class JoggingActivity extends FragmentActivity implements OnMapReadyCallb mMap.animateCamera(CameraUpdateFactory.newLatLngZoom( new LatLng(location.getLatitude(), location.getLongitude()), 16 )); + mLastKnownLocation = location; } @Override @@ -449,6 +464,7 @@ public class JoggingActivity extends FragmentActivity implements OnMapReadyCallb mButton.setBackgroundColor(Color.parseColor("#FF0000")); startTime = new SimpleDateFormat("HH:mm:ss") .format(Calendar.getInstance().getTime()); + distance = 0; } public void stopJogging(View view) { @@ -463,13 +479,12 @@ public class JoggingActivity extends FragmentActivity implements OnMapReadyCallb mButton.setBackgroundColor(Color.parseColor("#4CFF00")); // TODO : Distance itung berapa langkah - float distance = 1000; Calendar c = Calendar.getInstance(); Jogging jogging = new Jogging( new SimpleDateFormat("yyyy-MM-dd").format(c.getTime()), startTime, new SimpleDateFormat("HH:mm:ss").format(c.getTime()), - distance, + (float) distance, infoJoggingStart.getText().toString(), infoJoggingEnd.getText().toString() ); @@ -483,7 +498,7 @@ public class JoggingActivity extends FragmentActivity implements OnMapReadyCallb jogging.getDistance(), jogging.getStartingPoint(), jogging.getEndPoint() - ); + ).replaceAll(" ", "%20"); Log.d(TAG, url); try { String response = NetworkUtils.getResponseFromHttpUrl( diff --git a/app/src/main/java/com/example/leo/fitnessdiy/Utilities/PositionUtils.java b/app/src/main/java/com/example/leo/fitnessdiy/Utilities/PositionUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..731313fe6c35959b0140ab3b173d56a18f88bce1 --- /dev/null +++ b/app/src/main/java/com/example/leo/fitnessdiy/Utilities/PositionUtils.java @@ -0,0 +1,28 @@ +package com.example.leo.fitnessdiy.Utilities; + +/** + * Created by Leo on 22/02/2018. + */ + +public class PositionUtils { + public static double distance(double lat1, double lon1, double lat2, double lon2) { + double theta = lon1 - lon2; + double dist = Math.sin(deg2rad(lat1)) + * Math.sin(deg2rad(lat2)) + + Math.cos(deg2rad(lat1)) + * Math.cos(deg2rad(lat2)) + * Math.cos(deg2rad(theta)); + dist = Math.acos(dist); + dist = rad2deg(dist); + dist = dist * 60 * 1.1515; + return (dist); + } + + public static double deg2rad(double deg) { + return (deg * Math.PI / 180.0); + } + + public static double rad2deg(double rad) { + return (rad * 180.0 / Math.PI); + } +} diff --git a/app/src/main/java/com/example/leo/fitnessdiy/routes/api.java b/app/src/main/java/com/example/leo/fitnessdiy/routes/api.java index 8da80def697ef55d74a180e72dbaa2b6a0a6e828..c2cc686be728c486e56683a0b1c881811e2489f3 100644 --- a/app/src/main/java/com/example/leo/fitnessdiy/routes/api.java +++ b/app/src/main/java/com/example/leo/fitnessdiy/routes/api.java @@ -23,6 +23,8 @@ public class api { public static final String JOGGING_HISTORY_URL = BASE_URL + "jogging_history.php?user="; + public static final String PLANK_HISTORY_URL = BASE_URL + "plank_history.php?user="; + public static final String PUSHUP_HISTORY_URL = BASE_URL + "pushup_history.php?user="; public static final String SITUP_HISTORY_URL = BASE_URL + "situp_history.php?user="; diff --git a/app/src/main/res/drawable/down_button.png b/app/src/main/res/drawable/down_button.png new file mode 100644 index 0000000000000000000000000000000000000000..7dba95c6cad6af9f720d4f1096ac93299856014d Binary files /dev/null and b/app/src/main/res/drawable/down_button.png differ diff --git a/app/src/main/res/drawable/jogging_icon.png b/app/src/main/res/drawable/jogging_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..8497feb4c7200a17b4ae93a8db6f685eb28ab0a3 Binary files /dev/null and b/app/src/main/res/drawable/jogging_icon.png differ diff --git a/app/src/main/res/layout/activity_history.xml b/app/src/main/res/layout/activity_history.xml index 609d7034a5828ab3f77867703ecab31ce9e849a9..1a29c7f935e6809d168e349bca141e61759f764e 100644 --- a/app/src/main/res/layout/activity_history.xml +++ b/app/src/main/res/layout/activity_history.xml @@ -1,22 +1,101 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:card_view="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - xmlns:card_view="http://schemas.android.com/tools" - tools:context="com.example.leo.fitnessdiy.HIstoryActivity" + android:orientation="vertical" android:padding="16dp" - android:orientation="vertical"> + tools:context="com.example.leo.fitnessdiy.HIstoryActivity"> + <android.support.v7.widget.CardView + android:id="@+id/jogging" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <RelativeLayout + android:id="@+id/layout_jogging" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:padding="8dp"> + + <ImageView + android:id="@+id/jogging_icon" + android:layout_width="48dp" + android:layout_height="40dp" + android:layout_marginRight="8dp" + android:contentDescription="TODO" + android:src="@drawable/jogging_icon"/> + + <TextView + android:id="@+id/jogging_title" + style="@style/TextAppearance.AppCompat.Headline" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="5dp" + android:layout_toRightOf="@id/jogging_icon" + android:text="@string/jogging_history" /> + + <ImageView + android:layout_width="24dp" + android:layout_height="24dp" + android:layout_alignParentEnd="true" + android:layout_alignParentRight="true" + android:layout_marginTop="10dp" + android:src="@drawable/down_button"/> + + </RelativeLayout> + + </android.support.v7.widget.CardView> + + <android.support.v7.widget.RecyclerView + android:id="@+id/jogging_history" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + + <android.support.v7.widget.CardView + android:id="@+id/plank" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <RelativeLayout + android:id="@+id/layout_plank" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:padding="8dp"> + + <ImageView + android:id="@+id/plank_icon" + android:layout_width="48dp" + android:layout_height="40dp" + android:layout_marginRight="8dp" + android:contentDescription="TODO" + android:src="@drawable/jogging_icon"/> + + <TextView + android:id="@+id/plank_title" + style="@style/TextAppearance.AppCompat.Headline" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="5dp" + android:layout_toEndOf="@id/plank_icon" + android:layout_toRightOf="@id/plank_icon" + android:text="@string/plank_history" /> + + <ImageView + android:layout_width="24dp" + android:layout_height="24dp" + android:layout_alignParentEnd="true" + android:layout_alignParentRight="true" + android:layout_marginTop="10dp" + android:src="@drawable/down_button"/> - <android.support.v7.widget.CardView - android:layout_width="match_parent" - android:layout_height="wrap_content"> + </RelativeLayout> - </android.support.v7.widget.CardView> - <android.support.v7.widget.RecyclerView - android:layout_width="match_parent" - android:layout_height="match_parent" - android:id="@+id/rv_history"/> + </android.support.v7.widget.CardView> + <android.support.v7.widget.RecyclerView + android:id="@+id/plank_history" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> </LinearLayout> diff --git a/app/src/main/res/layout/activity_jogging.xml b/app/src/main/res/layout/activity_jogging.xml index 8e64945d69861848ca47a69f80e079207915cb5f..9c9f27006c23a0cc2e75deefb00daf15c609d1da 100644 --- a/app/src/main/res/layout/activity_jogging.xml +++ b/app/src/main/res/layout/activity_jogging.xml @@ -39,14 +39,19 @@ android:layout_marginLeft="16dp" android:layout_marginRight="16dp" android:layout_marginTop="16dp"> - <TextView + <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:id="@+id/tv_info_start"/> - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:id="@+id/tv_info_end"/> + android:orientation="vertical"> + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:id="@+id/tv_info_start"/> + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:id="@+id/tv_info_end"/> + </LinearLayout> </android.support.v7.widget.CardView> </FrameLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/card.xml b/app/src/main/res/layout/card.xml deleted file mode 100644 index b2f4f92a437f9a0ac903224f1e5fe1c8d839212e..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/card.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:card_view="http://schemas.android.com/apk/res-auto" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical" - android:padding="16dp"> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:id="@+id/sport_name"/> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:id="@+id/sport_date" - android:layout_below="@id/sport_name"/> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:id="@+id/sport_start" - android:layout_below="@id/sport_date"/> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:id="@+id/sport_end" - android:layout_below="@id/sport_start"/> - - -</RelativeLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/jogging_card.xml b/app/src/main/res/layout/jogging_card.xml new file mode 100644 index 0000000000000000000000000000000000000000..b23e2e41c85f09c2839f4c0c518826cc57642921 --- /dev/null +++ b/app/src/main/res/layout/jogging_card.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="8dp" + android:orientation="vertical"> + + <TextView + android:id="@+id/jogging_date" + android:layout_width="match_parent" + android:layout_height="wrap_content" + style="@style/TextAppearance.AppCompat.Title" /> + + <TextView + android:id="@+id/jogging_time" + android:layout_width="match_parent" + android:layout_height="wrap_content" + style="@style/TextAppearance.AppCompat" /> + + <TextView + android:id="@+id/jogging_distance" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textColor="#000000" + android:textSize="12dp" /> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textColor="#000000" + android:textSize="14dp" + android:id="@+id/jogging_track"/> +</LinearLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/plank_card.xml b/app/src/main/res/layout/plank_card.xml new file mode 100644 index 0000000000000000000000000000000000000000..1bd41b64c54ca63229e42333fb5ed05851347c03 --- /dev/null +++ b/app/src/main/res/layout/plank_card.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="8dp" + android:orientation="vertical"> + + <TextView + android:id="@+id/plank_date" + android:layout_width="match_parent" + android:layout_height="wrap_content" + style="@style/TextAppearance.AppCompat.Title" /> + + <TextView + android:id="@+id/plank_time" + android:layout_width="match_parent" + android:layout_height="wrap_content" + style="@style/TextAppearance.AppCompat" /> + + <TextView + android:id="@+id/plank_duration" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textColor="#000000" + android:textSize="12dp" /> + +</LinearLayout> \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b63175215fe54ee9fe058fd173f19a0098c797f9..7ec71d62c13e1b9ec32b83ef527118f0fca46636 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -28,4 +28,6 @@ <string name="motivation_situp">Sit Up Challenge : Before and After</string> <string name="situp_demo">How to do sit up properly</string> <string name="situp_video">Sit Up Video</string> + <string name="jogging_history">Jogging History</string> + <string name="plank_history">Plank History</string> </resources>