Showing
8 changed files
with
122 additions
and
2 deletions
... | @@ -19,6 +19,8 @@ | ... | @@ -19,6 +19,8 @@ |
19 | <category android:name="android.intent.category.LAUNCHER" /> | 19 | <category android:name="android.intent.category.LAUNCHER" /> |
20 | </intent-filter> | 20 | </intent-filter> |
21 | </activity> | 21 | </activity> |
22 | + <activity android:name = ".ChoiceActivity"/> | ||
23 | + <activity android:name = ".ExerciseActivity"/> | ||
22 | </application> | 24 | </application> |
23 | 25 | ||
24 | </manifest> | 26 | </manifest> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | +package com.khuhacker.pocketgym; | ||
2 | + | ||
3 | +import androidx.appcompat.app.AppCompatActivity; | ||
4 | + | ||
5 | +import android.content.Intent; | ||
6 | +import android.os.Bundle; | ||
7 | +import android.view.View; | ||
8 | + | ||
9 | +public class ChoiceActivity extends AppCompatActivity { | ||
10 | + | ||
11 | + @Override | ||
12 | + protected void onCreate(Bundle savedInstanceState) { | ||
13 | + super.onCreate(savedInstanceState); | ||
14 | + setContentView(R.layout.activity_choice); | ||
15 | + } | ||
16 | + | ||
17 | + public void onClick(View view) { | ||
18 | + if(view.getId() == R.id.pushupBtn) { | ||
19 | + Intent intent = new Intent(this, ExerciseActivity.class); | ||
20 | + startActivity(intent); | ||
21 | + } | ||
22 | + else if(view.getId() == R.id.squatBtn){ | ||
23 | + | ||
24 | + } | ||
25 | + | ||
26 | + else if(view.getId() == R.id.backBtn){ | ||
27 | + finish(); | ||
28 | + } | ||
29 | + } | ||
30 | +} |
... | @@ -2,7 +2,9 @@ package com.khuhacker.pocketgym; | ... | @@ -2,7 +2,9 @@ package com.khuhacker.pocketgym; |
2 | 2 | ||
3 | import androidx.appcompat.app.AppCompatActivity; | 3 | import androidx.appcompat.app.AppCompatActivity; |
4 | 4 | ||
5 | +import android.content.Intent; | ||
5 | import android.os.Bundle; | 6 | import android.os.Bundle; |
7 | +import android.view.View; | ||
6 | 8 | ||
7 | public class FirstActivity extends AppCompatActivity { | 9 | public class FirstActivity extends AppCompatActivity { |
8 | 10 | ||
... | @@ -11,4 +13,14 @@ public class FirstActivity extends AppCompatActivity { | ... | @@ -11,4 +13,14 @@ public class FirstActivity extends AppCompatActivity { |
11 | super.onCreate(savedInstanceState); | 13 | super.onCreate(savedInstanceState); |
12 | setContentView(R.layout.activity_first); | 14 | setContentView(R.layout.activity_first); |
13 | } | 15 | } |
16 | + | ||
17 | + public void onClick(View view) { | ||
18 | + if(view.getId() == R.id.exerciseBtn) { | ||
19 | + Intent intent = new Intent(this, ChoiceActivity.class); | ||
20 | + startActivity(intent); | ||
21 | + } | ||
22 | + else if(view.getId() == R.id.reportBtn){ | ||
23 | + | ||
24 | + } | ||
25 | + } | ||
14 | } | 26 | } | ... | ... |

5.04 KB

3.99 KB

4.88 KB
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + android:layout_width="match_parent" | ||
4 | + android:layout_height="match_parent" | ||
5 | + android:background="#FFFFFF" | ||
6 | + android:orientation="vertical"> | ||
7 | + <ImageView | ||
8 | + android:layout_gravity="left|top" | ||
9 | + android:layout_width="50dp" | ||
10 | + android:layout_height="50dp" | ||
11 | + android:id="@+id/backBtn" | ||
12 | + android:src="@drawable/back_icon" | ||
13 | + android:padding="5dp" | ||
14 | + android:layout_margin="5dp" | ||
15 | + android:onClick="onClick"/> | ||
16 | + | ||
17 | + <LinearLayout | ||
18 | + android:layout_width="180dp" | ||
19 | + android:layout_height="180dp" | ||
20 | + android:layout_gravity="center" | ||
21 | + android:background="@drawable/stroke_main" | ||
22 | + android:elevation="40dp" | ||
23 | + android:orientation="vertical" | ||
24 | + android:padding="15dp" | ||
25 | + android:layout_margin="30dp" | ||
26 | + android:id="@+id/pushupBtn" | ||
27 | + android:onClick="onClick"> | ||
28 | + | ||
29 | + <ImageView | ||
30 | + android:layout_width="100dp" | ||
31 | + android:layout_height="100dp" | ||
32 | + android:layout_gravity="center" | ||
33 | + android:src="@drawable/pushup_icon" /> | ||
34 | + | ||
35 | + <TextView | ||
36 | + android:layout_width="wrap_content" | ||
37 | + android:layout_height="wrap_content" | ||
38 | + android:layout_gravity="center" | ||
39 | + android:text="팔굽혀펴기" | ||
40 | + android:textColor="@color/pacific" | ||
41 | + android:textSize="80px" | ||
42 | + android:textStyle="bold"/> | ||
43 | + </LinearLayout> | ||
44 | + | ||
45 | + <LinearLayout | ||
46 | + android:layout_width="180dp" | ||
47 | + android:layout_height="180dp" | ||
48 | + android:layout_gravity="center" | ||
49 | + android:background="@drawable/stroke_main" | ||
50 | + android:elevation="40dp" | ||
51 | + android:orientation="vertical" | ||
52 | + android:padding="15dp" | ||
53 | + android:layout_margin="30dp" | ||
54 | + android:id="@+id/squatBtn" | ||
55 | + android:onClick="onClick"> | ||
56 | + | ||
57 | + <ImageView | ||
58 | + android:layout_width="70dp" | ||
59 | + android:layout_height="100dp" | ||
60 | + android:layout_gravity="center" | ||
61 | + android:src="@drawable/squat_icon" /> | ||
62 | + | ||
63 | + <TextView | ||
64 | + android:layout_width="wrap_content" | ||
65 | + android:layout_height="wrap_content" | ||
66 | + android:layout_gravity="center" | ||
67 | + android:text="스쿼트" | ||
68 | + android:textColor="@color/pacific" | ||
69 | + android:textSize="80px" | ||
70 | + android:textStyle="bold"/> | ||
71 | + </LinearLayout> | ||
72 | +</LinearLayout> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -14,7 +14,9 @@ | ... | @@ -14,7 +14,9 @@ |
14 | android:elevation="40dp" | 14 | android:elevation="40dp" |
15 | android:orientation="vertical" | 15 | android:orientation="vertical" |
16 | android:padding="15dp" | 16 | android:padding="15dp" |
17 | - android:layout_margin="30dp"> | 17 | + android:layout_margin="30dp" |
18 | + android:id="@+id/exerciseBtn" | ||
19 | + android:onClick="onClick"> | ||
18 | 20 | ||
19 | <ImageView | 21 | <ImageView |
20 | android:layout_width="100dp" | 22 | android:layout_width="100dp" |
... | @@ -40,7 +42,9 @@ | ... | @@ -40,7 +42,9 @@ |
40 | android:elevation="40dp" | 42 | android:elevation="40dp" |
41 | android:orientation="vertical" | 43 | android:orientation="vertical" |
42 | android:padding="15dp" | 44 | android:padding="15dp" |
43 | - android:layout_margin="30dp"> | 45 | + android:layout_margin="30dp" |
46 | + android:id="@+id/reportBtn" | ||
47 | + android:onClick="onClick"> | ||
44 | 48 | ||
45 | <ImageView | 49 | <ImageView |
46 | android:layout_width="70dp" | 50 | android:layout_width="70dp" | ... | ... |
-
Please register or login to post a comment