Skip to content
Snippets Groups Projects
Commit b20e784c authored by robby syaifullah's avatar robby syaifullah
Browse files

Add PushUp section + fixing for allocation memory error for some devices

parent cf280e94
Branches
No related merge requests found
......@@ -6,10 +6,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>
......
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);
}
}
app/src/main/res/drawable/pushup_video1.png

1.7 MiB

app/src/main/res/drawable/pushup_video2.png

1.24 MiB

<?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>
......@@ -18,4 +18,8 @@
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</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>
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment