@@ -207,32 +207,32 @@ abstract class DeviceListFragment : BaseFragment() {
207
207
LOGGER .debug(" updateWith - update dummyConnectionNotification, time=${stopWatch.time} " )
208
208
}
209
209
210
+ private fun firstChildOf (layout : CardView ) = when (layout.childCount) {
211
+ 0 -> null
212
+ else -> layout.getChildAt(0 )
213
+ }
214
+
210
215
private fun createDeviceView (device : FhemDevice , view : View ) {
211
- GlobalScope .launch(Dispatchers .Main ) {
212
- fun firstChildOf (layout : CardView ) = when (layout.childCount) {
213
- 0 -> null
214
- else -> layout.getChildAt(0 )
215
- }
216
+ LOGGER .info(" createDeviceView(name=${device.name} )" )
216
217
217
- val stopWatch = StopWatch ()
218
- stopWatch.start()
218
+ val stopWatch = StopWatch ()
219
+ stopWatch.start()
219
220
220
- LOGGER .debug(" bind - getAdapterFor device=${device.name} , time=${stopWatch.time} " )
221
+ LOGGER .debug(" bind - getAdapterFor device=${device.name} , time=${stopWatch.time} " )
221
222
222
- val contentView = genericOverviewDetailDeviceAdapter.createOverviewView(firstChildOf(view.card), device, view.context)
223
+ val contentView = genericOverviewDetailDeviceAdapter.createOverviewView(firstChildOf(view.card), device, view.context)
223
224
224
- LOGGER .debug(" bind - creating view for device=${device.name} , time=${stopWatch.time} " )
225
+ LOGGER .debug(" bind - creating view for device=${device.name} , time=${stopWatch.time} " )
225
226
226
- view.card.removeAllViews()
227
- view.card.addView(contentView)
227
+ view.card.removeAllViews()
228
+ view.card.addView(contentView)
228
229
229
- LOGGER .debug(" bind - adding content view device=${device.name} , time=${stopWatch.time} " )
230
+ LOGGER .debug(" bind - adding content view device=${device.name} , time=${stopWatch.time} " )
230
231
231
- view.setOnClickListener { onClick(device) }
232
- view.setOnLongClickListener { onLongClick(device) }
232
+ view.setOnClickListener { onClick(device) }
233
+ view.setOnLongClickListener { onLongClick(device) }
233
234
234
- LOGGER .debug(" bind - finished device=${device.name} , time=${stopWatch.time} " )
235
- }
235
+ LOGGER .debug(" bind - finished device=${device.name} , time=${stopWatch.time} " )
236
236
}
237
237
238
238
private fun onClick (device : FhemDevice ) {
@@ -257,6 +257,6 @@ abstract class DeviceListFragment : BaseFragment() {
257
257
258
258
companion object {
259
259
private val LOGGER = LoggerFactory .getLogger(DeviceListFragment ::class .java)
260
- val DEFAULT_COLUMN_WIDTH = 350
260
+ const val DEFAULT_COLUMN_WIDTH = 350
261
261
}
262
262
}
0 commit comments