-
Notifications
You must be signed in to change notification settings - Fork 5
5.6. ๊ธฐ๋ก
Seulgi Kim edited this page Jan 15, 2021
·
3 revisions
(1) Layout์ Expand์ Collapse ๊ธฐ๋ฅ์ ์ํด ExpandableLayout
์ฌ์ฉ
(2) ์ด์ค RecyclerView ์ฌ์ฉ
(1) EditText์ text๊ฐ ๋ณ๊ฒฝ๋ ๋๋ง๋ค ๋ฐ์ดํธ ์๋ฅผ Displayํ๊ธฐ ์ํด EditText.addTextChangedListener
์ฌ์ฉ
(2) BubbleSeekBar
์ฌ์ฉ
(1) ์์ ์ ๊ธ์งํ๊ธฐ ์ํด EditText์ Enabled ์์ฑ์ false๋ก ์ ์ฉ
(1) Layout์ Expand์ Collapse ๊ธฐ๋ฅ์ ์ํด ExpandableLayout
์ฌ์ฉ
- item_daily_expandable.xml
<com.skydoves.expandablelayout.ExpandableLayout
android:id="@+id/expandableLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:expandable_duration="150"
app:expandable_parentLayout="@layout/layout_daily_goal_parent"
app:expandable_secondLayout="@layout/layout_daily_goal_second"
app:layout_constraintBottom_toBottomOf="@+id/line"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
-
์ฌ๋ฌ๊ฐ์ ํค์๋ ์ ์ฌ๋ฌ๊ฐ์ ๊ธฐ๋ก์ ๊ตฌํํ๊ธฐ ์ํด RecyclerView๋ฅผ ์ค์ฒฉํ์ฌ ์ฌ์ฉ
-
fragment_task.xml
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_tasks"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/line"
tools:itemCount="4"
tools:listitem="@layout/item_daily_expandable"
android:visibility="@{isKeywordExist ? View.VISIBLE : View.GONE}"/>
- layout_daily_goal_second.xml
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_weekly_goal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="80dp"
android:paddingEnd="72dp"
android:layout_marginBottom="32dp"
tools:listitem="@layout/item_daily_goal"/>
(1) EditText์ text๊ฐ ๋ณ๊ฒฝ๋ ๋๋ง๋ค ๋ฐ์ดํธ ์๋ฅผ Displayํ๊ธฐ ์ํด EditText.addTextChangedListener
์ฌ์ฉ
- TaskAddActivity.kt
binding.etTitle.addTextChangedListener {
val length = binding.etTitle.length()
isTitleEntered = length > 0
isInputChanged = true
binding.tvTitleByte.text = length.toString()
binding.btnSave.isEnabled = isSaveButtonEnabled()
}
(2) BubbleSeekBar
์ฌ์ฉ
- activity_daily_detail.xml
<com.xw.repo.BubbleSeekBar
android:id="@+id/bubbleSeekBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
app:bsb_bubble_color="@color/mainOrange"
app:bsb_bubble_text_color="@color/white"
app:bsb_max="5"
app:bsb_min="1"
app:bsb_progress="1"
app:bsb_second_track_color="@color/mainOrange"
app:bsb_second_track_size="3dp"
app:bsb_section_count="4"
app:bsb_seek_step_section="true"
app:bsb_show_section_mark="true"
app:bsb_thumb_radius="12dp"
app:bsb_thumb_radius_on_dragging="24dp"
app:bsb_track_color="@color/mainConcrete"
app:bsb_track_size="3dp"
app:layout_constraintBottom_toTopOf="@+id/btn_save"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_satisfaction_info" />
๊ธฐ๋ก Main | ๊ธฐ๋ก Add | ๊ธฐ๋ก Detail |
---|---|---|