GyuhoLee

[Add] submenu

......@@ -19,6 +19,8 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name = ".ChoiceActivity"/>
<activity android:name = ".ExerciseActivity"/>
</application>
</manifest>
\ No newline at end of file
......
package com.khuhacker.pocketgym;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
public class ChoiceActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_choice);
}
public void onClick(View view) {
if(view.getId() == R.id.pushupBtn) {
Intent intent = new Intent(this, ExerciseActivity.class);
startActivity(intent);
}
else if(view.getId() == R.id.squatBtn){
}
else if(view.getId() == R.id.backBtn){
finish();
}
}
}
......@@ -2,7 +2,9 @@ package com.khuhacker.pocketgym;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
public class FirstActivity extends AppCompatActivity {
......@@ -11,4 +13,14 @@ public class FirstActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_first);
}
public void onClick(View view) {
if(view.getId() == R.id.exerciseBtn) {
Intent intent = new Intent(this, ChoiceActivity.class);
startActivity(intent);
}
else if(view.getId() == R.id.reportBtn){
}
}
}
......
<?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="match_parent"
android:background="#FFFFFF"
android:orientation="vertical">
<ImageView
android:layout_gravity="left|top"
android:layout_width="50dp"
android:layout_height="50dp"
android:id="@+id/backBtn"
android:src="@drawable/back_icon"
android:padding="5dp"
android:layout_margin="5dp"
android:onClick="onClick"/>
<LinearLayout
android:layout_width="180dp"
android:layout_height="180dp"
android:layout_gravity="center"
android:background="@drawable/stroke_main"
android:elevation="40dp"
android:orientation="vertical"
android:padding="15dp"
android:layout_margin="30dp"
android:id="@+id/pushupBtn"
android:onClick="onClick">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
android:src="@drawable/pushup_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="팔굽혀펴기"
android:textColor="@color/pacific"
android:textSize="80px"
android:textStyle="bold"/>
</LinearLayout>
<LinearLayout
android:layout_width="180dp"
android:layout_height="180dp"
android:layout_gravity="center"
android:background="@drawable/stroke_main"
android:elevation="40dp"
android:orientation="vertical"
android:padding="15dp"
android:layout_margin="30dp"
android:id="@+id/squatBtn"
android:onClick="onClick">
<ImageView
android:layout_width="70dp"
android:layout_height="100dp"
android:layout_gravity="center"
android:src="@drawable/squat_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="스쿼트"
android:textColor="@color/pacific"
android:textSize="80px"
android:textStyle="bold"/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -14,7 +14,9 @@
android:elevation="40dp"
android:orientation="vertical"
android:padding="15dp"
android:layout_margin="30dp">
android:layout_margin="30dp"
android:id="@+id/exerciseBtn"
android:onClick="onClick">
<ImageView
android:layout_width="100dp"
......@@ -40,7 +42,9 @@
android:elevation="40dp"
android:orientation="vertical"
android:padding="15dp"
android:layout_margin="30dp">
android:layout_margin="30dp"
android:id="@+id/reportBtn"
android:onClick="onClick">
<ImageView
android:layout_width="70dp"
......