Skip to content

Commit

Permalink
[FIX/#255] 메모 오버스크롤 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
Marchbreeze committed Mar 13, 2024
1 parent 02af8ec commit dd27e4a
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.going.presentation.designsystem.edittext

import android.content.Context
import android.content.res.TypedArray
import android.text.method.ScrollingMovementMethod
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
Expand Down Expand Up @@ -91,6 +92,9 @@ class EmojiCounterEditText(context: Context, attrs: AttributeSet) :
typedArray.getString(R.styleable.EmojiCounterEditText_hint)
etEmojiCounterEtContent.minLines =
typedArray.getInt(R.styleable.EmojiCounterEditText_minLines, 1)
etEmojiCounterEtContent.maxLines =
typedArray.getInt(R.styleable.EmojiCounterEditText_minLines, 2)
etEmojiCounterEtContent.movementMethod = ScrollingMovementMethod()
tvEmojiCounterEtNameCounter.text = context.getString(R.string.counter, 0, maxLen)
}
canBlankError = typedArray.getBoolean(R.styleable.EmojiCounterEditText_canBlankError, false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.app.Activity
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.text.method.ScrollingMovementMethod
import android.view.View
import androidx.activity.result.contract.ActivityResultContracts
import androidx.activity.viewModels
Expand Down Expand Up @@ -46,6 +47,7 @@ class TodoDetailActivity :
initAllocatorListAdapter()
resetDetailData()
observeTodoDetailState()
observeMemoBinding()
observeTodoDeleteState()
}

Expand Down Expand Up @@ -137,6 +139,12 @@ class TodoDetailActivity :
}.launchIn(lifecycleScope)
}

private fun observeMemoBinding() {
viewModel.memo.observe(this) {
binding.etTodoCreateMemo.movementMethod = ScrollingMovementMethod()
}
}

private fun observeTodoDeleteState() {
viewModel.todoDeleteState.flowWithLifecycle(lifecycle).onEach { state ->
when (state) {
Expand Down
3 changes: 1 addition & 2 deletions presentation/src/main/res/layout/activity_todo_change.xml
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:imeOptions="actionDone"
android:overScrollMode="always"
android:scrollbars="vertical"
app:maxLines="6"
android:visibility="gone"
app:canBlankError="false"
app:hint="@string/my_todo_create_tv_memo_hint"
Expand Down
3 changes: 1 addition & 2 deletions presentation/src/main/res/layout/activity_todo_create.xml
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,13 @@
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:imeOptions="actionDone"
android:overScrollMode="always"
android:scrollbars="vertical"
app:canBlankError="false"
app:hint="@string/my_todo_create_tv_memo_hint"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/rv_our_todo_create_person"
app:minLines="6"
app:maxLines="6"
app:title="@string/my_todo_create_tv_memo" />

</androidx.constraintlayout.widget.ConstraintLayout>
Expand Down
6 changes: 4 additions & 2 deletions presentation/src/main/res/layout/activity_todo_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,12 @@
android:autoLink="web"
android:background="@drawable/shape_rect_4_gray700_line"
android:gravity="top"
android:maxLines="6"
android:minLines="6"
android:overScrollMode="always"
android:paddingVertical="20dp"
android:paddingStart="16dp"
android:paddingEnd="30dp"
android:paddingHorizontal="16dp"
android:scrollbars="vertical"
android:text="@={vm.memo}"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
android:includeFontPadding="false"
android:inputType="textMultiLine"
android:lineSpacingMultiplier="1.2"
android:overScrollMode="always"
android:paddingVertical="20dp"
android:paddingEnd="30dp"
android:scrollbars="vertical"
android:textAppearance="@style/TextAppearance.Doorip.Body3.Medi"
android:textColorHint="@color/gray_200"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
1 change: 1 addition & 0 deletions presentation/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<attr name="title" format="string" />
<attr name="hint" format="string" />
<attr name="minLines" format="integer" />
<attr name="maxLines" format="integer" />
<attr name="canBlankError" format="boolean" />
</declare-styleable>
</resources>

0 comments on commit dd27e4a

Please sign in to comment.