Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonLiuZhuoCheng committed Nov 4, 2021
1 parent ce554f8 commit d419b40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 28 deletions.
17 changes: 0 additions & 17 deletions src/android/CHIPTool/.idea/deploymentTargetDropDown.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ class ClusterDetailFragment : Fragment() {
savedInstanceState: Bundle?
): View {
clusterMap = ClusterInfoMapping().clusterMap
devicePtr = checkNotNull(requireArguments().getLong(DEVICE_PTR))
endpointId = checkNotNull(requireArguments().getInt(ENDPOINT_ID))
devicePtr = checkNotNull(requireArguments().getLong(DEVICE_PTR_KEY))
endpointId = checkNotNull(requireArguments().getInt(ENDPOINT_ID_KEY))
return inflater.inflate(R.layout.cluster_detail_fragment, container, false).apply {
deviceController.setCompletionListener(GenericChipDeviceListener())
commandAutoCompleteTv.visibility = View.GONE
Expand Down Expand Up @@ -189,11 +189,7 @@ class ClusterDetailFragment : Fragment() {
}

private fun constructHint(clusterMap: Map<String, *>): Array<String> {
val clusterName = mutableListOf<String>()
for ((name, info) in clusterMap) {
clusterName.add(name)
}
return clusterName.toTypedArray()
return clusterMap.keys.toTypedArray()
}

override fun onStop() {
Expand All @@ -203,16 +199,17 @@ class ClusterDetailFragment : Fragment() {

companion object {
private const val TAG = "ClusterDetailFragment"
private const val ENDPOINT_ID = "endpoint_id"
private const val DEVICE_PTR = "device_ptr"
private const val ENDPOINT_ID_KEY = "endpoint_id"
private const val DEVICE_PTR_KEY = "device_ptr"

fun newInstance(
deviceId: Long,
endpointId: Int
): ClusterDetailFragment {
return ClusterDetailFragment().apply {
arguments = Bundle(2).apply {
putLong(DEVICE_PTR, deviceId)
putInt(ENDPOINT_ID, endpointId)
putLong(DEVICE_PTR_KEY, deviceId)
putInt(ENDPOINT_ID_KEY, endpointId)
}
}
}
Expand Down

0 comments on commit d419b40

Please sign in to comment.