mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-07 06:39:45 +00:00
use theming from server
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
parent
3eab18472f
commit
8ca769832d
@ -52,7 +52,6 @@ import androidx.activity.result.ActivityResult
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.appcompat.view.ContextThemeWrapper
|
||||
import androidx.cardview.widget.CardView
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.FileProvider
|
||||
import androidx.core.content.PermissionChecker
|
||||
import androidx.core.content.PermissionChecker.PERMISSION_GRANTED
|
||||
@ -79,6 +78,7 @@ import coil.request.ImageRequest
|
||||
import coil.target.Target
|
||||
import coil.transform.CircleCropTransformation
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import com.nextcloud.android.common.ui.color.ColorUtil
|
||||
import com.nextcloud.android.common.ui.theme.utils.ColorRole
|
||||
import com.nextcloud.talk.BuildConfig
|
||||
import com.nextcloud.talk.R
|
||||
@ -243,6 +243,9 @@ class ChatActivity :
|
||||
@Inject
|
||||
lateinit var dateUtils: DateUtils
|
||||
|
||||
@Inject
|
||||
lateinit var colorUtil: ColorUtil
|
||||
|
||||
@Inject
|
||||
lateinit var viewModelFactory: ViewModelProvider.Factory
|
||||
|
||||
@ -1078,8 +1081,13 @@ class ChatActivity :
|
||||
}
|
||||
is ChatViewModel.OutOfOfficeUIState.Success -> {
|
||||
binding.outOfOfficeContainer.visibility = View.VISIBLE
|
||||
val backgroundColor = ContextCompat.getColor(this, R.color.colorPrimary)
|
||||
val setAlpha = ColorUtils.setAlphaComponent(backgroundColor, (0.2f * 255).toInt())
|
||||
|
||||
|
||||
val backgroundColor = colorUtil.getNullSafeColorWithFallbackRes(conversationUser!!.capabilities
|
||||
!!.themingCapability!!.color, R.color.colorPrimary)
|
||||
|
||||
binding.outOfOfficeContainer.findViewById<View>(R.id.verticalLine).setBackgroundColor(backgroundColor)
|
||||
val setAlpha = ColorUtils.setAlphaComponent(backgroundColor, (0.3f * 255).toInt())
|
||||
binding.outOfOfficeContainer.setCardBackgroundColor(setAlpha)
|
||||
|
||||
val startDateTimestamp: Long = uiState.userAbsence.startDate.toLong()
|
||||
|
@ -136,7 +136,6 @@
|
||||
android:layout_margin="8dp"
|
||||
app:cardCornerRadius="12dp">
|
||||
|
||||
|
||||
<include layout="@layout/out_of_office_view" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
|
@ -18,9 +18,9 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<View
|
||||
android:layout_width="6dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/colorPrimary"/>
|
||||
android:id="@+id/verticalLine"
|
||||
android:layout_width="6dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
Loading…
Reference in New Issue
Block a user