Skip to content

Commit

Permalink
[AN] feat(#83): 닉네임 변경 페이지 UI 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
saesang committed Jan 31, 2024
1 parent b925e99 commit 4ea3e5f
Show file tree
Hide file tree
Showing 3 changed files with 161 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package com.takseha.presentation.ui.home

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.takseha.presentation.R

// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private const val ARG_PARAM1 = "param1"
private const val ARG_PARAM2 = "param2"

/**
* A simple [Fragment] subclass.
* Use the [EditNicknameFragment.newInstance] factory method to
* create an instance of this fragment.
*/
class EditNicknameFragment : Fragment() {
// TODO: Rename and change types of parameters
private var param1: String? = null
private var param2: String? = null

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.let {
param1 = it.getString(ARG_PARAM1)
param2 = it.getString(ARG_PARAM2)
}
}

override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_edit_nickname, container, false)
}

companion object {
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment EditNicknameFragment.
*/
// TODO: Rename and change types and number of parameters
@JvmStatic
fun newInstance(param1: String, param2: String) =
EditNicknameFragment().apply {
arguments = Bundle().apply {
putString(ARG_PARAM1, param1)
putString(ARG_PARAM2, param2)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView 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="860dp"
android:layout_gravity="bottom"
android:layout_marginBottom="-20dp"
android:background="@color/BACKGROUND"
app:cardCornerRadius="16dp"
tools:context=".ui.home.EditNicknameFragment">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="20dp">

<ImageView
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginTop="31dp"
android:layout_marginRight="22dp"
android:src="@drawable/ic_exit"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/inputNicknameDescription1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="138dp"
android:fontFamily="@font/pretendard_semibold"
android:text="새로운 닉네임을 입력해주세요"
android:textColor="@color/GS_800"
android:textSize="26dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/inputNicknameDescription2"
style="@style/B3_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="생각이 안나면 이름도 괜찮아요"
android:textColor="@color/GS_700"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/inputNicknameDescription1" />

<EditText
android:id="@+id/inputNicknameEditText"
style="@style/B2_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="75dp"
android:background="@null"
android:text="@string/nickname"
android:textColor="@color/BLACK"
android:textColorHint="@color/GS_300"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/inputNicknameDescription2" />

<TextView
android:id="@+id/inputNicknameDescription3"
style="@style/B5_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/text_length"
android:textColor="@color/GS_500"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/inputNicknameEditText" />

<LinearLayout
android:id="@+id/confirmBtn"
android:layout_width="match_parent"
android:layout_height="97dp"
android:background="@color/BASIC_GREEN"
android:gravity="center"
app:layout_constraintBottom_toBottomOf="parent">

<TextView
android:id="@+id/confirmBtnText"
style="@style/B5_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/confirm"
android:textColor="@color/BLACK" />
</LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>


</androidx.cardview.widget.CardView>
6 changes: 3 additions & 3 deletions frontend/presentation/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
<string name="nickname">대머리깃터디</string>
<string name="github_id">\@boldgitudy</string>
<string name="post">등록</string>
<string name="text_length">%d/6</string>


<!-- Strings related to login -->
<!-- Strings related to home -->
<string name="score_with_ranking">활동점수 %d점 | 랭킹 %d위</string>


Expand All @@ -21,7 +22,6 @@

<!-- Strings related to profile -->
<string name="comment_hint">%s님에게 응원과 격려의 메세지를 남겨주세요!</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>


</resources>

0 comments on commit 4ea3e5f

Please sign in to comment.