Skip to content

Commit

Permalink
[FEAT/#1] 자기소개 페이지 만들기
Browse files Browse the repository at this point in the history
  • Loading branch information
b1urrrr committed Oct 3, 2022
1 parent 5742c9b commit 9109757
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 17 deletions.
14 changes: 13 additions & 1 deletion app/src/main/java/org/sopt/sample/HomeActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,22 @@ package org.sopt.sample

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import org.sopt.sample.databinding.ActivityHomeBinding

class HomeActivity : AppCompatActivity() {
private lateinit var binding: ActivityHomeBinding

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_home)
binding = ActivityHomeBinding.inflate(layoutInflater)
setContentView(binding.root)

// 회원정보 받아오기
if (intent.hasExtra("id")) {
binding.txtName.text = binding.txtName.text.toString() + intent.getStringExtra("id");
}
if (intent.hasExtra("mbti")) {
binding.txtMbti.text = binding.txtMbti.text.toString() + intent.getStringExtra("mbti");
}
}
}
29 changes: 25 additions & 4 deletions app/src/main/res/layout/activity_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,34 @@
android:layout_height="match_parent"
tools:context=".HomeActivity">

<ImageView
android:id="@+id/img_profile"
android:layout_width="100dp"
android:layout_height="100dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintDimensionRatio="1.0"
android:layout_marginTop="80dp"
app:srcCompat="@drawable/ic_launcher_background"/>

<TextView
android:id="@+id/textView"
android:id="@+id/txt_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Home Activity"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/img_profile"
android:layout_marginVertical="12dp"
android:text="@string/label_name"/>

<TextView
android:id="@+id/txt_mbti"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/txt_name"
android:layout_marginVertical="12dp"
android:text="@string/label_mbti"/>
</androidx.constraintlayout.widget.ConstraintLayout>
6 changes: 3 additions & 3 deletions app/src/main/res/layout/activity_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:id="@+id/txt_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/login_title"
android:text="@string/title_login"
android:textSize="20sp"
android:textStyle="bold"
android:layout_marginTop="60dp"
Expand All @@ -34,7 +34,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/id_hint"
android:hint="@string/hint_id"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/txt_id_title"
Expand Down Expand Up @@ -62,7 +62,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:hint="@string/pwd_hint"
android:hint="@string/hint_pwd"
android:inputType="textPassword"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/activity_sign_up.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:id="@+id/txt_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/signup_title"
android:text="@string/title_signup"
android:textSize="20sp"
android:textStyle="bold"
android:layout_marginTop="60dp"
Expand All @@ -34,7 +34,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/id_hint"
android:hint="@string/hint_id"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/txt_id_title"
Expand All @@ -56,7 +56,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:inputType="textPassword"
android:hint="@string/pwd_hint"
android:hint="@string/hint_pwd"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/txt_pwd_title"
Expand All @@ -77,7 +77,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:hint="@string/mbti_hint"
android:hint="@string/hint_mbti"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/txt_mbti_title"
Expand Down
13 changes: 8 additions & 5 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>
<string name="app_name">INSOPTAndroidPractice</string>
<string name="login_title">Welcome to SOPT</string>
<string name="signup_title">SIGNUP</string>
<string name="title_login">Welcome to SOPT</string>
<string name="title_signup">SIGNUP</string>

<string name="id">ID</string>
<string name="pwd">비밀번호</string>
Expand All @@ -10,7 +10,10 @@
<string name="signup">SIGNUP</string>
<string name="signup_complete">회원가입 완료</string>

<string name="id_hint">아이디를 입력하세요</string>
<string name="pwd_hint">비밀번호를 입력하세요</string>
<string name="mbti_hint">MBTI를 입력하세요</string>
<string name="hint_id">아이디를 입력하세요</string>
<string name="hint_pwd">비밀번호를 입력하세요</string>
<string name="hint_mbti">MBTI를 입력하세요</string>

<string name="label_name">이름:&#160;</string>
<string name="label_mbti">MBTI:&#160;</string>
</resources>

0 comments on commit 9109757

Please sign in to comment.