generated from NOW-SOPT-ANDROID/now-sopt-android-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat/#4] week2 - xml / essential(필수) : 홈화면 구현 (마이페이지 intent 정보 띄우기)
- Loading branch information
Showing
4 changed files
with
74 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,9 @@ android { | |
buildFeatures { | ||
viewBinding true | ||
} | ||
buildFeatures { | ||
dataBinding true | ||
} | ||
} | ||
|
||
dependencies { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,41 @@ | ||
package com.sopt.now | ||
|
||
import android.os.Bundle | ||
import android.util.Log | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import android.widget.TextView | ||
import androidx.fragment.app.Fragment | ||
import com.sopt.now.databinding.FragmentHomeBinding | ||
|
||
import androidx.recyclerview.widget.LinearLayoutManager | ||
import com.sopt.now.databinding.FragmentMypageBinding | ||
class MyPageFragment: Fragment() { | ||
private lateinit var binding: FragmentHomeBinding | ||
|
||
private var _binding: FragmentMypageBinding? = null | ||
private val binding get() = _binding!! | ||
private lateinit var friendListAdapter: FriendListAdapter // | ||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
return super.onCreateView(inflater, container, savedInstanceState) | ||
): View { | ||
_binding = FragmentMypageBinding.inflate(inflater, container, false) | ||
return binding.root | ||
} | ||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
|
||
val id = arguments?.getString("id") | ||
val password = arguments?.getString("password") | ||
val nickname = arguments?.getString("nickname") | ||
|
||
Log.d("MyPageFragment", "ID: $id, Password: $password, Nickname: $nickname") | ||
|
||
view.findViewById<TextView>(R.id.tvId).text = "아이디: $id" | ||
view.findViewById<TextView>(R.id.tvPassword).text = "비밀번호: $password" | ||
view.findViewById<TextView>(R.id.tvNickname).text = "닉네임: $nickname" | ||
} | ||
override fun onDestroyView() { | ||
super.onDestroyView() | ||
_binding = null | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,38 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
<androidx.constraintlayout.widget.ConstraintLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<TextView | ||
android:id="@+id/tvHome" | ||
android:id="@+id/tvNickname" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="마이페이지화면" | ||
android:textSize="30sp" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
android:textSize="35sp" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
android:layout_marginTop="190dp" | ||
android:layout_marginStart="50dp"/> | ||
|
||
<TextView | ||
android:id="@+id/tvId" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:textSize="20sp" | ||
app:layout_constraintTop_toBottomOf="@id/tvNickname" | ||
app:layout_constraintStart_toStartOf="parent" | ||
android:layout_marginTop="60dp" | ||
android:layout_marginStart="50dp"/> | ||
|
||
<TextView | ||
android:id="@+id/tvPassword" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:textSize="20sp" | ||
app:layout_constraintTop_toBottomOf="@id/tvId" | ||
app:layout_constraintStart_toStartOf="parent" | ||
android:layout_marginTop="10dp" | ||
android:layout_marginStart="50dp"/> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |