Skip to content

Commit

Permalink
[FEAT] 연동관리 일러스트 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
kim0hoon committed Oct 1, 2023
1 parent 5329ce3 commit 6b35196
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,16 @@ abstract class BaseLinkManagementFragment : BaseFragment<FragmentLinkManagementB
R.string.link_management_empty_link,
targetLinkTypeStringOrEmpty
)
listOf(LinkManagementMainEmptyItem(content = content))
val imageDrawableRes = when (linkMemberType) {
LinkMemberType.KID -> R.drawable.ic_search_option_menu_kid
LinkMemberType.PROTECTOR -> R.drawable.ic_search_option_menu_parent
}
listOf(
LinkManagementMainEmptyItem(
imageDrawableRes = imageDrawableRes,
content = content
)
)
}
items.addAll(linkedUserItems)
}
Expand Down Expand Up @@ -309,7 +318,12 @@ abstract class BaseLinkManagementFragment : BaseFragment<FragmentLinkManagementB
)
}.ifEmpty {
val content = getString(R.string.link_management_empty_received)
listOf(LinkManagementMainEmptyItem(content = content))
listOf(
LinkManagementMainEmptyItem(
imageDrawableRes = R.drawable.ic_link_request_empty,
content = content
)
)
}
items.addAll(receivedRequestItems)
setTabUpdatedStatusVisibility(
Expand Down Expand Up @@ -346,7 +360,12 @@ abstract class BaseLinkManagementFragment : BaseFragment<FragmentLinkManagementB
)
}.ifEmpty {
val content = getString(R.string.link_management_empty_sent)
listOf(LinkManagementMainEmptyItem(content = content))
listOf(
LinkManagementMainEmptyItem(
imageDrawableRes = R.drawable.ic_link_request_empty,
content = content
)
)
}
items.addAll(sentRequestItems)
setTabUpdatedStatusVisibility(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
package com.polzzak_android.presentation.feature.link.management.item

import androidx.annotation.DrawableRes
import com.polzzak_android.R
import com.polzzak_android.databinding.ItemLinkManagementMainEmptyBinding
import com.polzzak_android.presentation.common.util.BindableItem

class LinkManagementMainEmptyItem(private val content: String) :
class LinkManagementMainEmptyItem(
@DrawableRes private val imageDrawableRes: Int,
val content: String
) :
BindableItem<ItemLinkManagementMainEmptyBinding>() {
override val layoutRes: Int = R.layout.item_link_management_main_empty

override fun areItemsTheSame(other: BindableItem<*>): Boolean =
other is LinkManagementMainEmptyItem

override fun areContentsTheSame(other: BindableItem<*>): Boolean =
other is LinkManagementMainEmptyItem && this.content == other.content
other is LinkManagementMainEmptyItem && this.content == other.content && this.imageDrawableRes == other.imageDrawableRes

override fun bind(binding: ItemLinkManagementMainEmptyBinding, position: Int) {
binding.tvContent.text = content
binding.ivIcon.setImageResource(imageDrawableRes)
}
}
5 changes: 2 additions & 3 deletions app/src/main/res/layout/item_link_management_main_empty.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<!-- TODO drawable 적용 -->
<ImageView
android:id="@+id/ivIcon"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="@drawable/ic_launcher_background"
app:layout_constraintBottom_toTopOf="@id/tvContent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed" />
app:layout_constraintVertical_chainStyle="packed"
tools:background="@drawable/ic_link_request_empty" />

<TextView
android:id="@+id/tvContent"
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/layout/item_link_request_loading.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<!-- TODO Loading drawable 추가 -->
<ImageView
<ProgressBar
android:id="@+id/ivProgress"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/ic_launcher_background"
android:indeterminateDrawable="@drawable/ic_loading_spinner_opacity_rotate"
android:indeterminateDuration="1000"
app:layout_constraintBottom_toTopOf="@id/tvContent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down

0 comments on commit 6b35196

Please sign in to comment.