Skip to content

Commit

Permalink
#11 / [UI] login 모두 TextInput으로 변환
Browse files Browse the repository at this point in the history
  • Loading branch information
Marchbreeze committed Jun 2, 2023
1 parent e2cc1bf commit 1441637
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ class SignUpActivity : BindingActivity<ActivitySignUpBinding>(R.layout.activity_
}

private fun setKeyboardHeight() {
keyboardVisibilityUtils = KeyboardVisibilityUtils(window,
onShowKeyboard = { keyboardHeight ->
keyboardVisibilityUtils =
KeyboardVisibilityUtils(window, onShowKeyboard = { keyboardHeight ->
binding.svSignUp.run {
smoothScrollTo(scrollX, scrollY + keyboardHeight)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import org.android.go.sopt.module.AuthServicePool
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
import timber.log.Timber
import java.util.regex.Pattern

class SignUpViewModel : ViewModel() {
Expand Down Expand Up @@ -70,7 +69,7 @@ class SignUpViewModel : ViewModel() {
fun setButtonState() {
buttonVaild.value =
(isIdValid.value == true && isPwValid.value == true && idText.value!!.isNotBlank() && pwText.value!!.isNotBlank())
Log.d("qqqq","${buttonVaild}")
Log.d("qqqq", "${buttonVaild}")
}

companion object {
Expand Down
55 changes: 35 additions & 20 deletions app/src/main/res/layout/activity_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,28 @@
android:textSize="25sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="@id/tv_login_title"
app:layout_constraintBottom_toTopOf="@id/et_login_id"/>
app:layout_constraintBottom_toTopOf="@id/layout_login_id"/>

<EditText
android:id="@+id/et_login_id"

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/layout_login_id"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_marginBottom="15dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="30dp"
android:autofillHints="username"
android:hint="@string/et_login_id_hint"
android:imeOptions="actionNext"
android:layout_marginBottom="15dp"
android:inputType="text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toTopOf="@id/tv_login_pw"/>
app:layout_constraintBottom_toTopOf="@id/tv_login_pw">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/et_login_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionNext"
android:inputType="text" />

</com.google.android.material.textfield.TextInputLayout>

<TextView
android:id="@+id/tv_login_pw"
Expand All @@ -58,29 +65,36 @@
android:text="@string/tv_login_pw_title"
android:textSize="25sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="@id/et_login_id"
app:layout_constraintBottom_toTopOf="@id/et_login_pw"/>
app:layout_constraintStart_toStartOf="@id/tv_login_title"
app:layout_constraintBottom_toTopOf="@id/layout_login_pw"/>

<EditText
android:id="@+id/et_login_pw"
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/layout_login_pw"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_marginBottom="20dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="30dp"
android:autofillHints="password"
android:hint="@string/et_login_pw_hint"
android:imeOptions="actionDone"
android:inputType="textPassword"
android:layout_marginBottom="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toTopOf="@id/btn_login"/>
app:layout_constraintBottom_toTopOf="@id/btn_login">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/et_login_pw"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionDone"
android:autofillHints="password"
android:inputType="textPassword" />

</com.google.android.material.textfield.TextInputLayout>

<Button
android:id="@+id/btn_login"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="30dp"
android:padding="24dp"
android:padding="20dp"
android:text="@string/btn_login_login"
android:textSize="15sp"
app:layout_constraintBottom_toTopOf="@+id/btn_sign_up"
Expand All @@ -93,6 +107,7 @@
android:layout_height="48dp"
android:layout_marginHorizontal="30dp"
android:layout_marginBottom="10dp"
android:backgroundTint="@color/light_blue_A700"
android:text="@string/btn_login_sign_up"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="parent"
Expand Down
37 changes: 18 additions & 19 deletions app/src/main/res/layout/activity_sign_up.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,28 @@
android:textStyle="bold"
app:layout_constraintStart_toStartOf="@id/tv_sign_up_title"
app:layout_constraintTop_toBottomOf="@+id/tv_sign_up_title" />

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/layout_sign_up_id"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_marginHorizontal="30dp"
android:layout_marginTop="5dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_sign_up_id">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/et_sign_up_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autofillHints="username"
android:text="@={vm.idText}"
android:hint="@string/et_signup_id_hint"
android:imeOptions="actionNext"
android:inputType="text"/>

android:inputType="text"
android:text="@={vm.idText}" />

</com.google.android.material.textfield.TextInputLayout>

<TextView
Expand All @@ -85,10 +85,10 @@

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/layout_sign_up_pw"
android:layout_width="0dp"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"

android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_marginHorizontal="30dp"
android:layout_marginTop="5dp"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -100,10 +100,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autofillHints="username"
android:text="@={vm.pwText}"
android:hint="@string/et_signup_pw_hint"
android:imeOptions="actionNext"
android:inputType="text"/>
android:inputType="text"
android:text="@={vm.pwText}" />

</com.google.android.material.textfield.TextInputLayout>

Expand All @@ -119,25 +119,24 @@
app:layout_constraintTop_toBottomOf="@+id/layout_sign_up_pw" />



<com.google.android.material.textfield.TextInputLayout
android:id="@+id/layout_sign_up_name"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_marginHorizontal="30dp"
android:layout_marginTop="5dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_sign_up_name" >
app:layout_constraintTop_toBottomOf="@id/tv_sign_up_name">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/et_sign_up_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@={vm.nameText}"
android:imeOptions="actionNext"
android:inputType="text"/>
android:inputType="text"
android:text="@={vm.nameText}" />

</com.google.android.material.textfield.TextInputLayout>

Expand All @@ -155,22 +154,22 @@

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/layout_sign_up_skill"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_marginHorizontal="30dp"
android:layout_marginTop="5dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_sign_up_skill" >
app:layout_constraintTop_toBottomOf="@id/tv_sign_up_skill">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/et_sign_up_skill"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@={vm.skillText}"
android:imeOptions="actionNext"
android:inputType="text"/>
android:inputType="text"
android:text="@={vm.skillText}" />

</com.google.android.material.textfield.TextInputLayout>

Expand Down

0 comments on commit 1441637

Please sign in to comment.