Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

스페이스,보드,유저 글자 수 크기 대응 #295

Merged
merged 10 commits into from
Dec 13, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class EditNickNameDialog : DialogFragment() {

private fun setupModifyBtn() {
binding.btnEditProfileModify.setOnClickListener {
profileViewModel.updateNickName(binding.etEditProfileNickname.text)
profileViewModel.updateNickName(binding.etEditProfileNickname.text.toString())
dismiss()
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package boostcamp.and07.mindsync.ui.util

import android.net.Uri
import android.widget.Button
import android.widget.ImageView
import android.widget.TextView
import androidx.databinding.BindingAdapter
Expand Down Expand Up @@ -37,3 +38,12 @@ fun TextView.bindDate(date: String) {

this.text = "$year-$month-$day"
}

@BindingAdapter("app:editButtonEnabled")
fun Button.bindEnabled(content: String) {
this.isEnabled =
when (content.length) {
in 1..20 -> true
else -> false
}
}
9 changes: 5 additions & 4 deletions AOS/app/src/main/res/layout/activity_add_space.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,20 @@

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tfl_add_space_edit_space"
android:layout_width="264dp"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:counterEnabled="true"
app:layout_constraintTop_toBottomOf="@id/iv_add_space_thumbnail">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/tfl_add_space_edit_space_input_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:hint="@string/space_name"
android:hint="@string/space_name_hint"
android:onTextChanged="@{vm.onSpaceNameChanged}"
android:text="@{vm.uiState.spaceName}" />
</com.google.android.material.textfield.TextInputLayout>
Expand All @@ -117,8 +118,8 @@
android:layout_width="264dp"
android:layout_height="50dp"
android:layout_marginTop="30dp"
android:backgroundTint="@{vm.uiState.spaceName.length() > 0 ? @color/main4 : @color/gray3}"
android:enabled="@{vm.uiState.spaceName.length() > 0 ? true : false}"
android:backgroundTint="@{vm.uiState.spaceName.length() > 0 &amp;&amp; vm.uiState.spaceName.length &lt;=20 ? @color/main4 : @color/gray3}"
app:editButtonEnabled="@{vm.uiState.spaceName}"
android:onClick="@{()->vm.addSpace(@string/space_image_name)}"
android:text="@string/check_message"
android:textColor="@color/white"
Expand Down
7 changes: 4 additions & 3 deletions AOS/app/src/main/res/layout/dialog_create_board.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,15 @@
android:layout_marginTop="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:counterEnabled="true"
app:layout_constraintTop_toBottomOf="@id/iv_add_space_thumbnail">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/tfl_add_space_edit_space_input_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:hint="@string/board_list_board_name"
android:hint="@string/board_list_board_name_hint"
android:onTextChanged="@{vm.onBoardNameChanged}"
android:text="@{vm.uiState.boardName}" />
</com.google.android.material.textfield.TextInputLayout>
Expand All @@ -91,10 +92,10 @@
android:layout_width="264dp"
android:layout_height="50dp"
android:layout_marginTop="30dp"
android:backgroundTint="@{vm.uiState.boardName.length() > 0 ? @color/main4 : @color/gray3}"
android:onClick="@{()->view.onClickCompleteButton(@string/board_multipart_image_name)}"
android:text="@string/check_message"
android:enabled="@{vm.uiState.boardName.length() > 0 ? true : false}"
android:backgroundTint="@{vm.uiState.boardName.length() > 0 &amp;&amp; vm.uiState.boardName.length &lt;=20 ? @color/main4 : @color/gray3}"
app:editButtonEnabled="@{vm.uiState.boardName}"
android:textColor="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down
26 changes: 19 additions & 7 deletions AOS/app/src/main/res/layout/dialog_edit_profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</data>

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="250dp"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:background="@drawable/bg_round_dialog">

Expand Down Expand Up @@ -38,16 +38,28 @@
app:layout_constraintStart_toStartOf="@id/gl_edit_profile_start"
app:layout_constraintTop_toTopOf="parent" />

<EditText
android:id="@+id/et_edit_profile_nickname"
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tfl_edit_profile_nickname"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@{vm.uiState.editingNickname}"
android:onTextChanged="@{(p0, p1, p2, p3) -> vm.editNickname(p0)}"
android:padding="5dp"
app:counterEnabled="true"
app:hintEnabled="false"
app:layout_constraintBottom_toTopOf="@id/btn_edit_profile_cancel"
app:layout_constraintEnd_toEndOf="@id/gl_edit_profile_end"
app:layout_constraintStart_toStartOf="@id/gl_edit_profile_start"
app:layout_constraintTop_toBottomOf="@id/tv_edit_profile_title" />
app:layout_constraintTop_toBottomOf="@id/tv_edit_profile_title">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/et_edit_profile_nickname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{vm.uiState.editingNickname}"
android:onTextChanged="@{(p0, p1, p2, p3) -> vm.editNickname(p0)}"
android:hint="@string/profile_name_limit"
/>
</com.google.android.material.textfield.TextInputLayout>


<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_edit_profile_cancel"
Expand All @@ -65,7 +77,7 @@
android:background="@null"
android:padding="0dp"
android:text="@string/profile_modify"
android:enabled="@{vm.uiState.editingNickname.length() > 0 ? true : false}"
app:editButtonEnabled="@{vm.uiState.editingNickname}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/gl_edit_profile_end" />
</androidx.constraintlayout.widget.ConstraintLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:textAlignment="center"
android:singleLine="true"
android:text="@{vm.uiState.space.name}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down
4 changes: 3 additions & 1 deletion AOS/app/src/main/res/layout/fragment_profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,13 @@
<TextView
android:id="@+id/tv_profile_nickname"
style="@style/Typography.Title01"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:textAlignment="center"
android:text="@{vm.uiState.nickname}"
android:textColor="@color/gray4"
android:singleLine="true"
app:layout_constraintEnd_toEndOf="@id/iv_profile_image"
app:layout_constraintStart_toStartOf="@id/iv_profile_image"
app:layout_constraintTop_toBottomOf="@id/iv_profile_image"
Expand Down
3 changes: 2 additions & 1 deletion AOS/app/src/main/res/layout/item_board.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@

<TextView
android:id="@+id/tv_board_title"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:contentDescription="@string/board_list_board_name"
android:fontFamily="@font/pretendard_bold"
android:text="@{board.name}"
android:singleLine="true"
android:textAlignment="center"
app:layout_constraintEnd_toEndOf="@id/cv_board_thumbnail"
app:layout_constraintStart_toStartOf="@id/cv_board_thumbnail"
Expand Down
3 changes: 2 additions & 1 deletion AOS/app/src/main/res/layout/item_recycle_board.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@

<TextView
android:id="@+id/tv_recyclebin_board_title"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:contentDescription="@string/board_list_board_name"
android:fontFamily="@font/pretendard_bold"
android:text="@{board.name}"
android:textAlignment="center"
android:singleLine="true"
app:layout_constraintEnd_toEndOf="@id/cv_recyclebin_board_thumbnail"
app:layout_constraintStart_toStartOf="@id/cv_recyclebin_board_thumbnail"
app:layout_constraintTop_toBottomOf="@id/cv_recyclebin_board_thumbnail"
Expand Down
3 changes: 2 additions & 1 deletion AOS/app/src/main/res/layout/item_spaces.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@

<TextView
android:id="@+id/tv_space_name"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:fontFamily="@font/pretendard_bold"
android:text="@{space.name}"
android:singleLine="true"
android:textAlignment="center"
app:layout_constraintEnd_toEndOf="@id/imgbtn_space_thumbnail"
app:layout_constraintStart_toStartOf="@id/imgbtn_space_thumbnail"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,12 @@
<TextView
android:id="@+id/tv_side_bar_space_name"
style="@style/Typography.Title03"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
app:layout_constraintEnd_toStartOf="@id/imgbtn_side_bar_fold"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toStartOf="@id/view_side_bar_menu"
Expand Down
1 change: 1 addition & 0 deletions AOS/app/src/main/res/values/strings-board.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="board_list_board_name_hint">보드 이름은 20자가 최대입니다.</string>
<string name="board_list_board_name">보드 이름</string>
<string name="board_list_board_create_date">yyyy-mm-dd</string>
<string name="board_multipart_image_name">image</string>
Expand Down
1 change: 1 addition & 0 deletions AOS/app/src/main/res/values/strings-profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
<string name="profile_nickname_modify">닉네임 수정</string>
<string name="profile_modify">수정</string>
<string name="profile_image_name">image</string>
<string name="profile_name_limit">닉네임은 20자가 최대입니다.</string>
</resources>
2 changes: 1 addition & 1 deletion AOS/app/src/main/res/values/strings-space.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<string name="confirm_invite_space_fragment_title">가입하려는\n스페이스가 맞나요?</string>
<string name="confirm_invite_space_fragment_no">아니오</string>
<string name="confirm_invite_space_fragment_sign_in">가입하기</string>
<string name="space_name">스페이스 이름</string>
<string name="space_name_hint">스페이스 이름은 20자가 최대입니다</string>
<string name="space_list_title">스페이스 목록</string>
<string name="space_already_join">이미 가입한 스페이스입니다</string>
<string name="space_not_join">스페이스에 입장하지 않은 상태입니다!</string>
Expand Down