dji-sdk / Mobile-SDK-Android

DJI Mobile SDK for Android: http://developer.dji.com/mobile-sdk/
Other
972 stars 579 forks source link

improvement to LidarView.kt #1225

Open Jai-GAY opened 1 year ago

Jai-GAY commented 1 year ago

suggestions for the following modification to support Kotlin Android Extensions is deprecated, support view binding, Java 11, higher Gradle version, compile is okay, never test it.

android { compileOptions { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 } }

LidarView.kt

import com.dji.sdk.sample.internal.utils.VideoFeedView import com.dji.sdk.sample.databinding.ViewLidarBinding import dji.lidar_map.views.PointCloudView //import kotlinx.android.synthetic.main.view_lidar.view.*

private lateinit var binding: ViewLidarBinding
private lateinit var video_view_primary_video_feed: VideoFeedView
private lateinit var point_cloud_view_surface : PointCloudView

    /*layoutInflater.inflate(R.layout.view_lidar, this, true)*/
    binding = ViewLidarBinding.inflate(layoutInflater, this)

    binding.btnSetVideoSource.setOnClickListener(this)
    binding.btnUpdateLidar.setOnClickListener(this)
    binding.btnSendCommandToRemote.setOnClickListener(this)
    binding.btnStartReadPointCloudLiveViewData.setOnClickListener(this)
    binding.btnStopReadPointCloudLiveViewData.setOnClickListener(this)
    binding.btnSetPointCloudLiveViewDisplayMode.setOnClickListener(this)
    binding.btnFreshPointCloudLiveViewDataProcessedBuffers.setOnClickListener(this)
    binding.btnClearPointCloudLiveViewDataProcessedBuffers.setOnClickListener(this)
    binding.btnSetPointCloudVisibleLightPixelBtn.setOnClickListener(this)
    binding.btnSetPointCloudColorMode.setOnClickListener(this)

        binding.lidarInfoView.text = builder.toString()
DJI-William commented 1 year ago

Thank you for you contribution, you can request a PR to our Github Sample.