mirror of
https://github.com/Michatec/Radio.git
synced 2026-06-14 05:49:45 +02:00
refactor: use Kotlin property syntax for Snackbar anchorView
- Replace `setAnchorView()` calls with the `anchorView` property in `PlayerFragment` and `MainActivity` for better Kotlin idiomaticity.
This commit is contained in:
@@ -66,7 +66,7 @@ class MainActivity : AppCompatActivity() {
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
snackbar.setAnchorView(findViewById(R.id.bottom_sheet))
|
||||
snackbar.anchorView = findViewById(R.id.bottom_sheet)
|
||||
snackbar.show()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ class PlayerFragment : Fragment(),
|
||||
if (imageUri == null) {
|
||||
val snackbar = Snackbar.make(requireView(), R.string.toastalert_failed_picking_media, Snackbar.LENGTH_LONG)
|
||||
if (!isAndroidTV) {
|
||||
snackbar.setAnchorView(layout.bottomSheet)
|
||||
snackbar.anchorView = layout.bottomSheet
|
||||
}
|
||||
snackbar.show()
|
||||
} else {
|
||||
@@ -872,7 +872,7 @@ class PlayerFragment : Fragment(),
|
||||
R.color.default_neutral_white))
|
||||
|
||||
if (!isAndroidTV) {
|
||||
snackbar.setAnchorView(layout.bottomSheet)
|
||||
snackbar.anchorView = layout.bottomSheet
|
||||
}
|
||||
snackbar.show()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user