Merge pull request #439 from fatihergin/feature/use-binding-extensions-to-inflate-activies

use binding extension to inflate activities
This commit is contained in:
Tibor Kaputa 2023-08-25 22:40:27 +02:00 committed by GitHub
commit b8643a4024
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 const val TIMER_2_SECONDS = 2001
} }
private val binding by viewBinding(ActivityMainBinding::inflate)
private lateinit var defaultScene: Scene private lateinit var defaultScene: Scene
private lateinit var flashModeScene: Scene private lateinit var flashModeScene: Scene
private lateinit var timerScene: Scene private lateinit var timerScene: Scene
@ -66,7 +68,6 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
private var mLastHandledOrientation = 0 private var mLastHandledOrientation = 0
private var countDownTimer: CountDownTimer? = null private var countDownTimer: CountDownTimer? = null
private val binding by lazy(LazyThreadSafetyMode.NONE) { ActivityMainBinding.inflate(layoutInflater) }
private val tabSelectedListener = object : TabSelectedListener { private val tabSelectedListener = object : TabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab) { override fun onTabSelected(tab: TabLayout.Tab) {
handlePermission(PERMISSION_RECORD_AUDIO) { handlePermission(PERMISSION_RECORD_AUDIO) {

View File

@ -17,7 +17,7 @@ import java.util.*
import kotlin.system.exitProcess import kotlin.system.exitProcess
class SettingsActivity : SimpleActivity() { 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?) { override fun onCreate(savedInstanceState: Bundle?) {
isMaterialActivity = true isMaterialActivity = true