use binding extension to inflate activities

This commit is contained in:
fatih ergin 2023-08-25 22:59:30 +03:00
parent cafbd0bdac
commit ebf0bbd656
2 changed files with 3 additions and 2 deletions

View File

@ -53,6 +53,8 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
private const val TIMER_2_SECONDS = 2001
}
private val binding by viewBinding(ActivityMainBinding::inflate)
private lateinit var defaultScene: Scene
private lateinit var flashModeScene: Scene
private lateinit var timerScene: Scene
@ -66,7 +68,6 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
private var mLastHandledOrientation = 0
private var countDownTimer: CountDownTimer? = null
private val binding by lazy(LazyThreadSafetyMode.NONE) { ActivityMainBinding.inflate(layoutInflater) }
private val tabSelectedListener = object : TabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab) {
handlePermission(PERMISSION_RECORD_AUDIO) {

View File

@ -17,7 +17,7 @@ import java.util.*
import kotlin.system.exitProcess
class SettingsActivity : SimpleActivity() {
private val binding by lazy(LazyThreadSafetyMode.NONE) { ActivitySettingsBinding.inflate(layoutInflater) }
private val binding by viewBinding(ActivitySettingsBinding::inflate)
override fun onCreate(savedInstanceState: Bundle?) {
isMaterialActivity = true