diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 4979f2c8eb0f0820d62a110f75151ab7dfc6f444..a80048d0990c25943358428bc103339ee5def98a 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -18,10 +18,12 @@ <application android:allowBackup="true" + android:hardwareAccelerated="false" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" + android:largeHeap="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> diff --git a/app/src/main/java/com/example/leo/fitnessdiy/PushupActivity.java b/app/src/main/java/com/example/leo/fitnessdiy/PushupActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..b33a874a0c79768f0afed942ea010be3a3188dfa --- /dev/null +++ b/app/src/main/java/com/example/leo/fitnessdiy/PushupActivity.java @@ -0,0 +1,31 @@ +package com.example.leo.fitnessdiy; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.view.View; + +/** + * Created by Heil on 2/19/2018. + */ + +public class PushupActivity extends AppCompatActivity{ + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_pushup); + } + + public void openVideo(View view) { + String url = (String)view.getTag(); + + Intent intent = new Intent(); + intent.setAction(Intent.ACTION_VIEW); + intent.addCategory(Intent.CATEGORY_BROWSABLE); + + intent.setData(Uri.parse(url)); + startActivity(intent); + } +} diff --git a/app/src/main/res/drawable/pushup_video1.png b/app/src/main/res/drawable/pushup_video1.png new file mode 100644 index 0000000000000000000000000000000000000000..33e5be01b679a2fd7ea94fa8a2c6f03558b3c03d Binary files /dev/null and b/app/src/main/res/drawable/pushup_video1.png differ diff --git a/app/src/main/res/drawable/pushup_video2.png b/app/src/main/res/drawable/pushup_video2.png new file mode 100644 index 0000000000000000000000000000000000000000..ce7c69a881f2d23e4455ded78b2da9608db40576 Binary files /dev/null and b/app/src/main/res/drawable/pushup_video2.png differ diff --git a/app/src/main/res/layout/activity_pushup.xml b/app/src/main/res/layout/activity_pushup.xml index d8fb3247f0f6c95a88a47fc12ddc3d2cf5f75980..174aad103fa2aa91563d3e0d2a765aa080f24197 100644 --- a/app/src/main/res/layout/activity_pushup.xml +++ b/app/src/main/res/layout/activity_pushup.xml @@ -1,6 +1,86 @@ <?xml version="1.0" encoding="utf-8"?> -<android.support.constraint.ConstraintLayout - xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" - android:layout_height="match_parent"> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + tools:context="com.example.leo.fitnessdiy.PushupActivity"> -</android.support.constraint.ConstraintLayout> \ No newline at end of file + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="100dp" + android:text="@string/pushup" /> + <!--<Button--> + <!--android:layout_width="wrap_content"--> + <!--android:layout_height="wrap_content"--> + <!--android:layout_gravity="center_horizontal"--> + <!--android:layout_marginBottom="30dp"--> + <!--android:onClick="countDownPlank"--> + <!--android:text="start" />--> + + <!--<TextView--> + <!--android:id="@+id/count_timer"--> + <!--android:layout_width="wrap_content"--> + <!--android:layout_height="wrap_content"--> + <!--android:layout_gravity="center_horizontal"--> + <!--android:textSize="32sp"--> + <!--android:text="2 : 00" />--> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="30dp" + android:text="@string/pushup_video" /> + + + + <!--<ScrollView--> + <!--android:layout_width="wrap_content"--> + <!--android:layout_height="wrap_content">--> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="4dp" + android:clickable="true" + android:focusable="true" + android:onClick="openVideo" + android:orientation="horizontal" + android:tag="https://www.youtube.com/watch?v=IODxDxX7oi4"> + + <ImageView + android:layout_width="260dp" + android:layout_height="158dp" + android:src="@drawable/pushup_video1" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/pushup_demo" /> + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="horizontal" + android:tag="https://www.youtube.com/watch?v=lHjj5vmzpy0" + android:clickable="true" + android:focusable="true" + android:onClick="openVideo" + android:layout_margin="4dp"> + + <ImageView + android:layout_width="258dp" + android:layout_height="148dp" + android:src="@drawable/pushup_video2" /> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/motivation_pushup"/> + </LinearLayout> + + <!--</ScrollView>--> + + +</LinearLayout> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 88128abbbb4673020b48b232fa46cccf71ec0555..f0885f0a9a1204483bb47114d57b8d96c3830905 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -20,4 +20,8 @@ <string name="title_activity_jogging">Map</string> <string name="start">START</string> <string name="plank_video">Plank Video</string> + <string name="pushup">Push Up</string> + <string name="motivation_pushup">Push Up Challenge : Before and After</string> + <string name="pushup_demo">How to Push Up Properly</string> + <string name="pushup_video">Push Up Video</string> </resources>