Skip to content

Commit

Permalink
restyle kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
joonhaengHeo committed Sep 21, 2023
1 parent 8db4f2a commit 9f66423
Show file tree
Hide file tree
Showing 3 changed files with 582 additions and 455 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import com.google.chip.chiptool.attestation.AttestationTestFragment
import com.google.chip.chiptool.clusterclient.*
import com.google.chip.chiptool.clusterclient.GroupSettingFragment
import com.google.chip.chiptool.clusterclient.clusterinteraction.ClusterInteractionFragment
import com.google.chip.chiptool.databinding.SelectActionFragmentBinding
import com.google.chip.chiptool.provisioning.ProvisionNetworkType
import com.google.chip.chiptool.provisioning.UnpairDeviceFragment
import com.google.chip.chiptool.clusterclient.GroupSettingFragment
import com.google.chip.chiptool.setuppayloadscanner.BarcodeFragment
import com.google.chip.chiptool.util.FragmentUtil

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@ class AddressUpdateFragment : Fragment() {

fun updateDeviceIdSpinner() {
val deviceIdList = DeviceIdUtil.getCommissionedNodeId(requireContext())
binding.deviceIdSpinner.adapter = ArrayAdapter(requireContext(), android.R.layout.simple_spinner_dropdown_item, deviceIdList)
binding.deviceIdSpinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
binding.deviceIdEd.setText(deviceIdList[position].toULong(16).toString())
binding.deviceIdSpinner.adapter =
ArrayAdapter(requireContext(), android.R.layout.simple_spinner_dropdown_item, deviceIdList)
binding.deviceIdSpinner.onItemSelectedListener =
object : AdapterView.OnItemSelectedListener {
override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
binding.deviceIdEd.setText(deviceIdList[position].toULong(16).toString())
}

override fun onNothingSelected(parent: AdapterView<*>?) {}
}

override fun onNothingSelected(parent: AdapterView<*>?) {}
}
}

override fun onDestroyView() {
Expand Down Expand Up @@ -90,6 +92,5 @@ class AddressUpdateFragment : Fragment() {
fun getNodeIdFromGroupId(groupId: UInt): ULong {
return groupId.toULong() or MIN_GROUP_NODE_ID
}

}
}
Loading

0 comments on commit 9f66423

Please sign in to comment.