NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

deviceSettingsConfiguredSupportedDevices adapter xml file
res:

<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:phiView="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/card_view_parent_in_device_settings_configured_supported_devices"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="@color/color_ffffff"
app:cardCornerRadius="@dimen/dp_6"
app:cardElevation="@dimen/dp_8"
app:cardMaxElevation="0dp"
app:cardPreventCornerOverlap="false"
app:cardUseCompatPadding="true">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content">

<com.google.android.material.card.MaterialCardView
android:id="@+id/card_view_actuation_state_in_device_settings_configured_supported_devices"
android:layout_width="@dimen/dp_140"
android:layout_height="@dimen/dp_140"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_14"
app:cardBackgroundColor="@color/color_f3f3f3"
app:cardCornerRadius="6dp"
app:cardMaxElevation="0dp"
app:cardPreventCornerOverlap="false"
app:cardUseCompatPadding="true">

<RelativeLayout
android:id="@+id/relative_layout_in_device_settings_configured_supported_devices"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f3f3f3">

<LinearLayout
android:id="@+id/lnr_layout_actuation_in_device_settings_configured_supported_devices"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_ff9100_10_opc"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">

<com.phynart.smarthome.customviews.progressbar.CircularProgressBar
android:id="@+id/circular_progressbar_in_device_settings_configured_supported_devices"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
app:cpv_animAutoStart="true"
app:cpv_color="@color/color_ff9100"
app:cpv_indeterminate="true"
app:cpv_thickness="@dimen/dp_3" />

<com.phynart.smarthome.customviews.phiview.PhiTextView
android:id="@+id/txt_actuation_state_progress_in_device_settings_configured_supported_devices"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_14"
android:textAllCaps="true"
android:textColor="@color/color_ff9100"
android:textSize="@dimen/sp_14"
app:fontFamily="@font/roboto_medium" />

</LinearLayout>


<ImageView
android:id="@+id/img_actuation_state_in_device_settings_configured_supported_devices"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
app:srcCompat="@drawable/ic_power_settings_24" />

<com.phynart.smarthome.customviews.phiview.PhiTextView
android:id="@+id/txt_appliance_in_device_settings_configured_supported_devices"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/img_actuation_state_in_device_settings_configured_supported_devices"
android:layout_centerInParent="true"
android:layout_marginTop="@dimen/dp_7"
android:textColor="@color/color_29b6f6"
android:textSize="@dimen/sp_14"
android:visibility="visible"
app:fontFamily="@font/roboto_regular"
tools:text="Balcony Light" />
</RelativeLayout>
</com.google.android.material.card.MaterialCardView>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_16"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_12">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<com.phynart.smarthome.customviews.phiview.PhiTextView
android:id="@+id/txt_slot_number_in_device_settings_configured_supported_devices"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAllCaps="true"
android:textColor="@color/color_888888"
android:textSize="@dimen/sp_12"
app:fontFamily="@font/roboto_medium"
app:lineHeight="@dimen/sp_14"
tools:text="@string/slot" />

<com.phynart.smarthome.customviews.phiview.PhiTextView
android:id="@+id/txt_slot_configuration_state_in_device_settings_configured_supported_devices"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8"
android:text="@string/slot_configured"
android:textColor="@color/color_6a9c00"
android:textSize="@dimen/sp_12"
app:fontFamily="@font/roboto_regular"
app:lineHeight="@dimen/sp_18" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/device_settings_configured_supported_devices_configured_capabilities_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:itemCount="1"
android:layout_marginTop="@dimen/dp_4"
tools:listitem="@layout/device_settings_configured_supported_devices_configured_capabilities_adapter">

</androidx.recyclerview.widget.RecyclerView>

</LinearLayout>
</RelativeLayout>
</TableRow>


<!--Error layout-->
<LinearLayout
android:id="@+id/lnr_layout_error_in_device_settings_configured_supported_devices"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:background="@color/color_fff6f9"
android:orientation="vertical"
android:paddingBottom="@dimen/dp_12">

<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:background="@color/color_dddddd" />

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_13"
android:orientation="horizontal">

<ImageView
android:id="@+id/img_error_icon_in_device_settings_configured_supported_devices"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
app:srcCompat="@drawable/ic_error_outline_pink_28" />

<com.phynart.smarthome.customviews.phiview.PhiTextView
android:id="@+id/txt_error_message_in_device_settings_configured_supported_devices"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_8"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_11"
android:text="@string/message_point_configured_with_appliance_which_not_support_level_control"
android:textColor="@color/color_fd4776"
android:textSize="@dimen/sp_14"
app:fontFamily="@font/roboto_regular"
app:lineHeight="@dimen/sp_21" />

</LinearLayout>

</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>


kt:

DeviceSettingsConfiguredSupportDevicesAdapter:

package com.phynart.smarthome.adapters

import android.app.Activity
import android.content.Context
import android.os.Build
import android.text.Spannable
import android.text.SpannableString
import android.text.Spanned
import android.text.style.BulletSpan
import android.text.style.ForegroundColorSpan
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.ViewTreeObserver
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.RelativeLayout
import android.widget.TextView
import androidx.cardview.widget.CardView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import com.github.florent37.viewtooltip.ViewTooltip
import com.phynart.smarthome.CustomLinearLayoutManager
import com.phynart.smarthome.R
import com.phynart.smarthome.customviews.phiview.PhiTextView
import com.phynart.smarthome.devices.configuration.DeviceSettingsConfiguredSupportedDevicesConfiguredCapabilitiesAdapter
import com.phynart.smarthome.repository.network.pojo.capabilities.ActionEnum
import com.phynart.smarthome.repository.network.pojo.capabilities.IntentController
import com.phynart.smarthome.repository.network.pojo.devices.CapabilityDto
import com.phynart.smarthome.repository.network.pojo.devices.DeviceDto
import com.phynart.smarthome.utils.Converter
import com.phynart.smarthome.utils.DrawableUtils
import com.phynart.smarthome.utils.Key

class DeviceSettingsConfiguredSupportedDevicesAdapter(
private val context: Context,
private var slotDtoList: ArrayList<DeviceDto>
/*private val listener: DeviceConfigurationListener*/
) : RecyclerView.Adapter<DeviceSettingsConfiguredSupportedDevicesAdapter.ItemViewHolder>() {
private var isDeviceStateChange = false
private val viewPool = RecyclerView.RecycledViewPool()

class ItemViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
var cardViewActuationState: CardView
var relativeLayout: RelativeLayout
var lnrLayoutActuationInProgress: LinearLayout
var txtActuationInProgress: TextView
var imgActuationState: ImageView
var txtAppliance: PhiTextView
var txtSlotNumber: TextView
var txtSlotConfigurationState: TextView
/*var txtSlotFeatureAvailable: ImageView

var txtOnOffControlSlot: TextView*/

var errorImage: ImageView
var lnrLayoutError: LinearLayout
var txtErrorMessage: TextView

var tooltipView: ViewTooltip.TooltipView? = null
var deviceSettingsConfiguredSupportedDevicesConfiguredCapabilitiesRecyclerView: RecyclerView

init {
errorImage =
itemView.findViewById(R.id.img_error_icon_in_device_settings_configured_supported_devices)

/*txtOnOffControlSlot =
itemView.findViewById(R.id.txt_on_off_control_slot_in_device_settings_configured_supported_devices)
*/
deviceSettingsConfiguredSupportedDevicesConfiguredCapabilitiesRecyclerView =
itemView.findViewById(R.id.device_settings_configured_supported_devices_configured_capabilities_recycler_view)
cardViewActuationState =
itemView.findViewById(R.id.card_view_actuation_state_in_device_settings_configured_supported_devices)
relativeLayout =
itemView.findViewById(R.id.relative_layout_in_device_settings_configured_supported_devices)
imgActuationState =
itemView.findViewById(R.id.img_actuation_state_in_device_settings_configured_supported_devices)
lnrLayoutActuationInProgress =
itemView.findViewById(R.id.lnr_layout_actuation_in_device_settings_configured_supported_devices)
txtActuationInProgress =
itemView.findViewById(R.id.txt_actuation_state_progress_in_device_settings_configured_supported_devices)
txtAppliance =
itemView.findViewById(R.id.txt_appliance_in_device_settings_configured_supported_devices)
txtSlotNumber =
itemView.findViewById(R.id.txt_slot_number_in_device_settings_configured_supported_devices)
txtSlotConfigurationState =
itemView.findViewById(R.id.txt_slot_configuration_state_in_device_settings_configured_supported_devices)
/*txtSlotFeatureAvailable =
itemView.findViewById(R.id.txt_slot_feature_available_in_device_settings_configured_supported_devices)*/
lnrLayoutError =
itemView.findViewById(R.id.lnr_layout_error_in_device_settings_configured_supported_devices)
txtErrorMessage =
itemView.findViewById(R.id.txt_error_message_in_device_settings_configured_supported_devices)
}
}

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemViewHolder {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.device_settings_configured_supported_devices, parent, false)
return ItemViewHolder(view)
}

override fun onBindViewHolder(holder: ItemViewHolder, position: Int) {
val deviceDto = getItem(position)
holder.lnrLayoutActuationInProgress.visibility = View.GONE
holder.imgActuationState.visibility = View.VISIBLE
if (deviceDto.deviceOperationType.equals(Key.ADDED)) {
holder.txtSlotConfigurationState.setText(R.string.slot_configured)
holder.txtSlotConfigurationState.setTextColor(
ContextCompat.getColor(
context,
R.color.color_6a9c00
)
)
holder.imgActuationState.visibility = View.GONE
holder.txtAppliance.visibility = View.VISIBLE
holder.txtAppliance.setCompoundDrawablesWithIntrinsicBounds(
0,
DrawableUtils.getAppliancesDrawable(
deviceDto.supportedDeviceTypeName,
deviceDto.stateDto?.powerState!!,
false
), 0, 0
)
holder.txtAppliance.text = deviceDto.supportedDeviceName
} else {
holder.txtSlotConfigurationState.setText(R.string.slot_un_configured)
holder.txtSlotConfigurationState.setTextColor(
ContextCompat.getColor(
context,
R.color.color_ff9100
)
)
// holder.txtSlotFeatureAvailable.setTextColor(
// ContextCompat.getColor(
// context,
// R.color.color_bbbbbb
// )
// )
holder.imgActuationState.visibility = View.VISIBLE
holder.txtAppliance.visibility = View.GONE
/** Show tooltip view to identify appliance on first slot */
if (holder.bindingAdapterPosition == 0 && !isDeviceStateChange) {
// TODO have to change this later, found a issue
// showToolTip(holder.txtActuationState)
}
}

//modifyCapabilitiesColor(holder, deviceDto)
visibilityOfTextColor(holder, deviceDto)
if (itemCount > 1) {
holder.txtSlotNumber.text = (context.resources.getString(R.string.slot)
+ "" + (position + 1))
} else {
holder.txtSlotNumber.text = "Slot"
}

/*holder.cardViewActuationState.setOnClickListener {
*//*listener.onClickOnActuationState(position)*//*
hideTooltipView(holder)
isDeviceStateChange = true
}*/

/*holder.txtAdd.setOnClickListener { listener.onClickOnAdd(position) }*/
/*holder.btnRemove.setOnClickListener { listener.onClickOnRemove(position) }
holder.btnReplace.setOnClickListener { listener.onClickOnReplace(position) }*/
/* holder.txtTroubleShoot.setOnClickListener { listener.onClickOnTroubleShoot(position) }
holder.btnRemove.visibility = View.GONE
holder.btnReplace.visibility = View.GONE*/

val configuredSupportedDevicesConfiguredCapabilitiesLayoutManager =
CustomLinearLayoutManager(context)
holder.deviceSettingsConfiguredSupportedDevicesConfiguredCapabilitiesRecyclerView.layoutManager =
configuredSupportedDevicesConfiguredCapabilitiesLayoutManager
holder.deviceSettingsConfiguredSupportedDevicesConfiguredCapabilitiesRecyclerView.recycledViewPool.clear()
val configuredSupportedDevicesConfiguredCapabilitiesAdapter =
DeviceSettingsConfiguredSupportedDevicesConfiguredCapabilitiesAdapter(
context, deviceDto,deviceDto.capabilitiesList
)
holder.deviceSettingsConfiguredSupportedDevicesConfiguredCapabilitiesRecyclerView.adapter =
configuredSupportedDevicesConfiguredCapabilitiesAdapter
holder.deviceSettingsConfiguredSupportedDevicesConfiguredCapabilitiesRecyclerView.setRecycledViewPool(viewPool)

}

fun updateData(list: ArrayList<DeviceDto>){
slotDtoList = list
notifyDataSetChanged()
}

override fun getItemCount(): Int {
return slotDtoList.size
}

/**Show tooltip view to identify slot appliance on tap */
private fun showToolTipView(itemViewHolder: DeviceConfigurationAdapter.ItemViewHolder) {
with(itemViewHolder) {
itemView.viewTreeObserver.addOnGlobalLayoutListener(object :
ViewTreeObserver.OnGlobalLayoutListener {
override fun onGlobalLayout() {
val popup = View.inflate(
context,
R.layout.layout_tooltip,
itemViewHolder.itemView as ViewGroup
)
tooltipView = ViewTooltip.on(context as Activity, cardViewActuationState)
.withShadow(true)
.autoHide(false, 10000)
.clickToHide(true)
.align(ViewTooltip.ALIGN.START)
.position(ViewTooltip.Position.BOTTOM)
.color(Converter.getColor(context, R.color.color_ff9100))
.corner(Converter.dp2Pixel(context, 8.0))
.arrowWidth(Converter.dp2Pixel(context, 14.0))
.arrowHeight(Converter.dp2Pixel(context, 14.0))
.distanceWithView(Converter.dp2Pixel(context, -10.0))
.animation(ViewTooltip.FadeTooltipAnimation())
// .customView(popup)
.show()
}

})
}

}

/*return item object*/
fun getItem(position: Int): DeviceDto {
return slotDtoList[position]
}

private fun hideTooltipView(itemViewHolder: RecyclerView.ViewHolder) {
if ((itemViewHolder as DeviceConfigurationAdapter.ItemViewHolder).tooltipView != null) {
itemViewHolder.tooltipView!!.close()
}
}

private fun visibilityOfTextColor(holder: ItemViewHolder, deviceDto: DeviceDto) {
if (deviceDto.stateDto?.powerState != null && deviceDto.stateDto?.powerState!!.lowercase() == ActionEnum.ON.toString()) {
if (deviceDto.stateDto!!.isPowerStateInProgress) {
if (deviceDto.deviceOperationType.equals(Key.ADDED)) {
holder.txtAppliance.visibility = View.VISIBLE
holder.txtAppliance.setCompoundDrawablesWithIntrinsicBounds(
0,
DrawableUtils.getAppliancesDrawable(
deviceDto.supportedDeviceTypeName,
deviceDto.stateDto?.powerState!!,
true
), 0, 0
)
holder.txtAppliance.setTextColor(
ContextCompat.getColor(
context,
R.color.color_ff9100
)
)
holder.txtAppliance.setDrawableTint(
ContextCompat.getColor(
context,
R.color.color_ff9100
)
)
} else {
holder.imgActuationState.visibility = View.GONE
holder.lnrLayoutActuationInProgress.visibility = View.VISIBLE
holder.txtActuationInProgress.text = context.getString(R.string.turning_off)
}
holder.relativeLayout.setBackgroundColor(
ContextCompat.getColor(
context,
R.color.color_ff9100_10_opc
)
)
// holder.cardViewActuationState.setCardBackgroundColor(ContextCompat.getColor(context, R.color.color_ff9100_10_opc))
} else {
if (deviceDto.deviceOperationType.equals(Key.ADDED)) {
holder.txtAppliance.visibility = View.VISIBLE
holder.txtAppliance.setTextColor(
ContextCompat.getColor(
context,
R.color.color_29b6f6
)
)
holder.txtAppliance.setDrawableTint(
ContextCompat.getColor(
context,
R.color.color_29b6f6
)
)
holder.relativeLayout.setBackgroundColor(
ContextCompat.getColor(
context,
R.color.color_f0faff
)
)
// holder.cardViewActuationState.setCardBackgroundColor(ContextCompat.getColor(context, R.color.color_f0faff))
} else {
holder.imgActuationState.visibility = View.VISIBLE
//holder.txtActuationState.text = context.resources.getString(R.string.turn_off)
holder.relativeLayout.setBackgroundColor(
ContextCompat.getColor(
context,
R.color.color_f3f3f3
)
)
// holder.cardViewActuationState.setCardBackgroundColor(ContextCompat.getColor(context, R.color.color_f3f3f3))
}
}
} else {
if (deviceDto.stateDto!!.isPowerStateInProgress) {
if (deviceDto.deviceOperationType.equals(Key.ADDED)) {
holder.txtAppliance.visibility = View.VISIBLE
holder.txtAppliance.setCompoundDrawablesWithIntrinsicBounds(
0,
DrawableUtils.getAppliancesDrawable(
deviceDto.supportedDeviceTypeName,
deviceDto.stateDto?.powerState!!,
true
), 0, 0
)
holder.txtAppliance.setTextColor(
ContextCompat.getColor(
context,
R.color.color_ff9100
)
)
holder.txtAppliance.setDrawableTint(
ContextCompat.getColor(
context,
R.color.color_ff9100
)
)

} else {
holder.imgActuationState.visibility = View.GONE
holder.lnrLayoutActuationInProgress.visibility = View.VISIBLE
holder.txtActuationInProgress.text = context.getString(R.string.turning_on)
}
holder.relativeLayout.setBackgroundColor(
ContextCompat.getColor(
context,
R.color.color_ff9100_10_opc
)
)
// holder.cardViewActuationState.setCardBackgroundColor(ContextCompat.getColor(context, R.color.color_ff9100_10_opc))
} else {
if (deviceDto.deviceOperationType.equals(Key.ADDED)) {
holder.txtAppliance.visibility = View.VISIBLE
if (deviceDto.stateDto?.musicSync != null) {
if (deviceDto.stateDto?.musicSync!!.lowercase() == ActionEnum.ON.toString()) {
holder.txtAppliance.setTextColor(
ContextCompat.getColor(
context,
R.color.color_29b6f6
)
)
holder.txtAppliance.setDrawableTint(
ContextCompat.getColor(
context,
R.color.color_29b6f6
)
)
holder.relativeLayout.setBackgroundColor(
ContextCompat.getColor(
context,
R.color.color_f0faff
)
)
// holder.cardViewActuationState.setCardBackgroundColor(ContextCompat.getColor(context, R.color.color_f0faff))
} else {
holder.txtAppliance.setTextColor(
ContextCompat.getColor(
context,
R.color.color_333333
)
)
holder.txtAppliance.setDrawableTint(
ContextCompat.getColor(
context,
R.color.color_333333
)
)
holder.relativeLayout.setBackgroundColor(
ContextCompat.getColor(
context,
R.color.color_f0faff
)
)
// holder.cardViewActuationState.setCardBackgroundColor(ContextCompat.getColor(context, R.color.color_f0faff))
}
} else {
holder.txtAppliance.setTextColor(
ContextCompat.getColor(
context,
R.color.color_333333
)
)
holder.txtAppliance.setDrawableTint(
ContextCompat.getColor(
context,
R.color.color_333333
)
)
holder.relativeLayout.setBackgroundColor(
ContextCompat.getColor(
context,
R.color.color_f0faff
)
)
// holder.cardViewActuationState.setCardBackgroundColor(ContextCompat.getColor(context, R.color.color_f0faff))
}

} else {
holder.imgActuationState.visibility = View.VISIBLE
//holder.txtActuationState.text = context.resources.getString(R.string.turn_on)
holder.relativeLayout.setBackgroundColor(
ContextCompat.getColor(
context,
R.color.color_f3f3f3
)
)
// holder.cardViewActuationState.setCardBackgroundColor(ContextCompat.getColor(context, R.color.color_f3f3f3))
}
}
}
}

private fun modifyCapabilitiesColor(itemViewHolder: ItemViewHolder, deviceDto: DeviceDto) {
var capabilities = ""
val startIndex = IntArray(deviceDto.capabilitiesList!!.size)
val endIndex = IntArray(deviceDto.capabilitiesList!!.size)
for (i in deviceDto.capabilitiesList!!.indices) {
val capability = deviceDto.capabilitiesList!![i]
startIndex[i] = capabilities.length
capabilities = "$capabilities${capability.displayName} n"
endIndex[i] = capabilities.length
}
if (deviceDto.deviceOperationType.equals(Key.ADDED)) {
val spannable = SpannableString(capabilities)
val color = Converter.getColor(context, R.color.color_6a9c00)
for (i in deviceDto.capabilitiesList!!.indices) {
val capability = deviceDto.capabilitiesList!![i]
for (j in deviceDto.configuredCapabilitiesList!!.indices) {
val configureCapability = deviceDto.configuredCapabilitiesList!![j]
if (configureCapability.displayName.equals(capability.displayName)) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
spannable.setSpan(
BulletSpan(30, color, 10),
startIndex[i], endIndex[i], Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
} else {
spannable.setSpan(
BulletSpan(),
startIndex[i], endIndex[i], Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
}
spannable.setSpan(
ForegroundColorSpan(color),
startIndex[i], endIndex[i], Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
)
break
}
}
}
//itemViewHolder.txtSlotFeatureAvailable.text = spannable

if (deviceDto.capabilitiesList != null && deviceDto.configuredCapabilitiesList != null) {
val difference: MutableList<CapabilityDto> =
deviceDto.capabilitiesList!!.minus(deviceDto.configuredCapabilitiesList!!.toHashSet()) as MutableList<CapabilityDto>
var listWithoutEnergyMonitoringObject =
difference.filter { dto -> dto.capabilityName != IntentController.ENERGY_CALIBRATION_CONTROL.toString() }
if (listWithoutEnergyMonitoringObject.size > 1) {
itemViewHolder.lnrLayoutError.visibility = View.VISIBLE
} else {
itemViewHolder.lnrLayoutError.visibility = View.GONE
}
}

} else {
//itemViewHolder.txtSlotFeatureAvailable.text = capabilities
}
}
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.