Skip to content

Commit

Permalink
DEP-187 ui: 짝꿍 만들기 3단계 UI 구현 (#57)
Browse files Browse the repository at this point in the history
* ui: 사용할 문자열 strings.xml에 추가

* feat: 짝꿍 만들기 3단계 fragment와 viewModel 생성

* ui: 짝꿍 만들기 3단계 ui 구현

* ui: editText background로 사용할 selector 구현

* ui: editText background 적용

* ui: editText에 완료 버튼 적용
  • Loading branch information
juhwankim-dev authored Dec 7, 2022
1 parent 68a234e commit b9a81d0
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.depromeet.threedays.mate.create.step3

import androidx.fragment.app.viewModels
import com.depromeet.threedays.core.BaseFragment
import com.depromeet.threedays.mate.R
import com.depromeet.threedays.mate.databinding.FragmentSetMateNicknameBinding
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class SetMateNicknameFragment :
BaseFragment<FragmentSetMateNicknameBinding, SetMateNicknameViewMoodel>(R.layout.fragment_set_mate_nickname) {
override val viewModel by viewModels<SetMateNicknameViewMoodel>()

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.depromeet.threedays.mate.create.step3

import com.depromeet.threedays.core.BaseViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class SetMateNicknameViewMoodel @Inject constructor(
) : BaseViewModel() {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

<item>
<shape android:shape="rectangle">
<solid android:color="@color/gray_300" />
<corners android:radius="10dp" />
</shape>
</item>

<item
android:bottom="1dp"
android:end="1dp"
android:start="1dp"
android:top="1dp">
<shape android:shape="rectangle">
<solid android:color="@color/gray_100" />
<corners android:radius="10dp" />
</shape>
</item>
</layer-list>
5 changes: 5 additions & 0 deletions presentation/mate/src/main/res/drawable/selector_edittext.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:drawable="@drawable/bg_rect_gray100_border_gray300_r10" />
<item android:state_focused="false" android:drawable="@drawable/bg_rect_gray100_r10"/>
</selector>
117 changes: 117 additions & 0 deletions presentation/mate/src/main/res/layout/fragment_set_mate_nickname.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">

<data>

</data>

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".create.SetMateNicknameFragment">

<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_begin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_begin="20dp" />

<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_end="20dp" />

<ImageView
android:id="@+id/iv_out"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="26dp"
android:layout_marginTop="32dp"
android:src="@drawable/ic_arrow_out"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/iv_illustrator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_rect_gray200_r10"
android:layout_marginTop="32dp"
android:paddingHorizontal="49dp"
android:paddingVertical="62dp"
android:text="임시영역"
app:layout_constraintEnd_toEndOf="@+id/gl_end"
app:layout_constraintStart_toStartOf="@id/gl_begin"
app:layout_constraintTop_toBottomOf="@+id/iv_out" />

<TextView
android:id="@+id/tv_set_mate_nickname_guide"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:text="@string/set_mate_nickname_guide"
android:textAppearance="@style/Typography.Title1"
app:layout_constraintStart_toStartOf="@id/gl_begin"
app:layout_constraintTop_toBottomOf="@+id/iv_illustrator" />

<EditText
android:id="@+id/et_nickname"
android:layout_width="0dp"
android:layout_height="45dp"
android:background="@drawable/selector_edittext"
android:layout_marginTop="24dp"
android:paddingStart="16dp"
android:hint="@string/input_nickname_hint"
android:textColorHint="@color/gray_400"
android:textColor="@color/gray_800"
android:textAppearance="@style/Typography.Body1"
android:inputType="text"
android:importantForAutofill="no"
android:imeOptions="actionDone"
app:layout_constraintTop_toBottomOf="@+id/tv_set_mate_nickname_guide"
app:layout_constraintStart_toStartOf="@id/gl_begin"
app:layout_constraintEnd_toEndOf="@id/gl_end" />

<TextView
android:id="@+id/tv_count_nickname_length"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:textAppearance="@style/Typography.Body4.Medium"
android:textColor="@color/gray_500"
android:text="@string/count_nickname_length"
app:layout_constraintTop_toTopOf="@id/et_nickname"
app:layout_constraintBottom_toBottomOf="@id/et_nickname"
app:layout_constraintEnd_toEndOf="@+id/et_nickname" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textAppearance="@style/Typography.Body4.Medium"
android:textColor="@color/green_system_color"
android:text="@string/available_nickname_guide"
app:layout_constraintTop_toBottomOf="@+id/et_nickname"
app:layout_constraintStart_toStartOf="@id/gl_begin" />

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_next"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_marginBottom="20dp"
android:background="@drawable/bg_rect_gray200_r15"
android:textAppearance="@style/Typography.Button1"
android:text="@string/step_3_button_text"
android:textColor="@color/gray_450"
android:gravity="center"
android:stateListAnimator="@null"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/gl_begin"
app:layout_constraintEnd_toEndOf="@id/gl_end" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
7 changes: 7 additions & 0 deletions presentation/mate/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@
<string name="i_need_whipping">엄격한 잔소리가 필요해요!</string>
<string name="carrot_mate">당근 짝꿍</string>
<string name="i_need_carrot">따뜻한 응원이 필요해요!</string>

<!-- step3 -->
<string name="set_mate_nickname_guide">짝꿍의 별명을 지어주세요.</string>
<string name="step_3_button_text">짝꿍 시작하기</string>
<string name="input_nickname_hint">별명을 입력해주세요.</string>
<string name="available_nickname_guide">별명은 바꿀 수 없어요. 신중하게 지어주세요.</string>
<string name="count_nickname_length">0/10</string>
</resources>

0 comments on commit b9a81d0

Please sign in to comment.