Skip to content
Snippets Groups Projects
Commit 2301627a authored by Rizki Halasan's avatar Rizki Halasan
Browse files

menambahkan plank

parent f022b141
No related merge requests found
......@@ -2,8 +2,9 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/android.iml" filepath="$PROJECT_DIR$/android.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
<module fileurl="file://$PROJECT_DIR$/fitness.iml" filepath="$PROJECT_DIR$/fitness.iml" />
<module fileurl="file://D:\tugas\sem6\pbd\tubes\android\fitness.iml" filepath="D:\tugas\sem6\pbd\tubes\android\fitness.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.leo.fitnessdiy">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
......@@ -20,7 +21,8 @@
<activity android:name=".LoginActivity" />
<activity android:name=".RegistrationActivity" />
<activity android:name=".HIstoryActivity" />
<activity android:name=".HomeActivity"></activity>
<activity android:name=".HomeActivity" />
<activity android:name=".PlankActivity"></activity>
</application>
</manifest>
\ No newline at end of file
package com.example.leo.fitnessdiy;
import android.os.CountDownTimer;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
public class PlankActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_plank);
}
public void countDownPlank(View view) {
final TextView countText = findViewById(R.id.count_timer);
new CountDownTimer(60000, 1000){
@Override
public void onTick(long l) {
String waktu = Long.toString(l/1000);
countText.setText(waktu);
}
@Override
public void onFinish() {
countText.setText("BERHASIL");
}
}.start();
}
}
<?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: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.PlankActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="100dp"
android:text="@string/plank" />
<TextView
android:id="@+id/count_timer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="1:00" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:onClick="countDownPlank"
android:text="start" />
</LinearLayout>
......@@ -12,4 +12,5 @@
<string name="intermediate">Intermediate</string>
<string name="advanced">Advanced</string>
<string name="history">History</string>
<string name="plank">Plank</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