mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-01-19 09:17:07 -06:00
Fix overlapping shadow in dashboard (#1494)
This commit is contained in:
parent
646a46727f
commit
16a5d88dfb
@ -170,6 +170,8 @@ class DashboardAdapter @Inject constructor() : RecyclerView.Adapter<RecyclerView
|
|||||||
val isLoading = item.isLoading
|
val isLoading = item.isLoading
|
||||||
val binding = horizontalGroupViewHolder.binding
|
val binding = horizontalGroupViewHolder.binding
|
||||||
val context = binding.root.context
|
val context = binding.root.context
|
||||||
|
val isLoadingVisible =
|
||||||
|
(isLoading && !item.isDataLoaded) || (isLoading && !item.isFullDataLoaded)
|
||||||
val attendanceColor = when {
|
val attendanceColor = when {
|
||||||
attendancePercentage == null || attendancePercentage == .0 -> {
|
attendancePercentage == null || attendancePercentage == .0 -> {
|
||||||
context.getThemeAttrColor(R.attr.colorOnSurface)
|
context.getThemeAttrColor(R.attr.colorOnSurface)
|
||||||
@ -199,13 +201,12 @@ class DashboardAdapter @Inject constructor() : RecyclerView.Adapter<RecyclerView
|
|||||||
context.getString(R.string.dashboard_horizontal_group_no_data)
|
context.getString(R.string.dashboard_horizontal_group_no_data)
|
||||||
} else luckyNumber?.toString()
|
} else luckyNumber?.toString()
|
||||||
|
|
||||||
dashboardHorizontalGroupItemInfoContainer.isVisible = error != null || isLoading
|
dashboardHorizontalGroupItemInfoContainer.isVisible = error != null || isLoadingVisible
|
||||||
dashboardHorizontalGroupItemInfoProgress.isVisible =
|
dashboardHorizontalGroupItemInfoProgress.isVisible = isLoadingVisible
|
||||||
(isLoading && !item.isDataLoaded) || (isLoading && !item.isFullDataLoaded)
|
|
||||||
dashboardHorizontalGroupItemInfoErrorText.isVisible = error != null
|
dashboardHorizontalGroupItemInfoErrorText.isVisible = error != null
|
||||||
|
|
||||||
with(dashboardHorizontalGroupItemLuckyContainer) {
|
with(dashboardHorizontalGroupItemLuckyContainer) {
|
||||||
isVisible = luckyNumber != null && luckyNumber != -1
|
isVisible = luckyNumber != null && luckyNumber != -1 && !isLoadingVisible
|
||||||
setOnClickListener { onLuckyNumberTileClickListener() }
|
setOnClickListener { onLuckyNumberTileClickListener() }
|
||||||
|
|
||||||
updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||||
@ -220,7 +221,8 @@ class DashboardAdapter @Inject constructor() : RecyclerView.Adapter<RecyclerView
|
|||||||
}
|
}
|
||||||
|
|
||||||
with(dashboardHorizontalGroupItemAttendanceContainer) {
|
with(dashboardHorizontalGroupItemAttendanceContainer) {
|
||||||
isVisible = attendancePercentage != null && attendancePercentage != -1.0
|
isVisible =
|
||||||
|
attendancePercentage != null && attendancePercentage != -1.0 && !isLoadingVisible
|
||||||
updateLayoutParams<ConstraintLayout.LayoutParams> {
|
updateLayoutParams<ConstraintLayout.LayoutParams> {
|
||||||
matchConstraintPercentWidth = when {
|
matchConstraintPercentWidth = when {
|
||||||
luckyNumber == null && unreadMessagesCount == null -> 1.0f
|
luckyNumber == null && unreadMessagesCount == null -> 1.0f
|
||||||
@ -232,7 +234,8 @@ class DashboardAdapter @Inject constructor() : RecyclerView.Adapter<RecyclerView
|
|||||||
}
|
}
|
||||||
|
|
||||||
with(dashboardHorizontalGroupItemMessageContainer) {
|
with(dashboardHorizontalGroupItemMessageContainer) {
|
||||||
isVisible = unreadMessagesCount != null && unreadMessagesCount != -1
|
isVisible =
|
||||||
|
unreadMessagesCount != null && unreadMessagesCount != -1 && !isLoadingVisible
|
||||||
setOnClickListener { onMessageTileClickListener() }
|
setOnClickListener { onMessageTileClickListener() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user