ktlint: Rename binding variable to be a sane variable name

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2026-01-01 11:08:07 +08:00
parent 6af3aa2152
commit c6ff0ffd9b

View File

@@ -52,7 +52,7 @@ class MainActivity : AppCompatActivity() {
private val viewModel: MainViewModel by viewModels() private val viewModel: MainViewModel by viewModels()
private lateinit var B: ActivityMainBinding private lateinit var binding: ActivityMainBinding
// TopLevelFragments // TopLevelFragments
private val topLevelFrags = listOf( private val topLevelFrags = listOf(
@@ -69,11 +69,11 @@ class MainActivity : AppCompatActivity() {
enableEdgeToEdge() enableEdgeToEdge()
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
B = ActivityMainBinding.inflate(layoutInflater) binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(B.root) setContentView(binding.root)
// Adjust root view's paddings for edgeToEdge display // Adjust root view's paddings for edgeToEdge display
ViewCompat.setOnApplyWindowInsetsListener(B.root) { root, windowInsets -> ViewCompat.setOnApplyWindowInsetsListener(binding.root) { root, windowInsets ->
val insets = windowInsets.getInsets(systemBars() or displayCutout() or ime()) val insets = windowInsets.getInsets(systemBars() or displayCutout() or ime())
root.setPadding(insets.left, insets.top, insets.right, 0) root.setPadding(insets.left, insets.top, insets.right, 0)
windowInsets windowInsets
@@ -110,7 +110,7 @@ class MainActivity : AppCompatActivity() {
}.launchIn(AuroraApp.scope) }.launchIn(AuroraApp.scope)
} }
B.navView.setupWithNavController(navController) binding.navView.setupWithNavController(navController)
// Handle quick exit from back actions // Handle quick exit from back actions
val defaultTab = when (Preferences.getInteger(this, PREFERENCE_DEFAULT_SELECTED_TAB)) { val defaultTab = when (Preferences.getInteger(this, PREFERENCE_DEFAULT_SELECTED_TAB)) {
@@ -137,8 +137,8 @@ class MainActivity : AppCompatActivity() {
navController.addOnDestinationChangedListener { _, navDestination, _ -> navController.addOnDestinationChangedListener { _, navDestination, _ ->
if (navDestination !is FloatingWindow) { if (navDestination !is FloatingWindow) {
when (navDestination.id) { when (navDestination.id) {
in topLevelFrags -> B.navView.visibility = View.VISIBLE in topLevelFrags -> binding.navView.visibility = View.VISIBLE
else -> B.navView.visibility = View.GONE else -> binding.navView.visibility = View.GONE
} }
} }
} }
@@ -146,7 +146,7 @@ class MainActivity : AppCompatActivity() {
// Updates // Updates
lifecycleScope.launch { lifecycleScope.launch {
viewModel.updateHelper.updates.collectLatest { list -> viewModel.updateHelper.updates.collectLatest { list ->
B.navView.getOrCreateBadge(R.id.updatesFragment).apply { binding.navView.getOrCreateBadge(R.id.updatesFragment).apply {
isVisible = !list.isNullOrEmpty() isVisible = !list.isNullOrEmpty()
number = list?.size ?: 0 number = list?.size ?: 0
} }