mirror of
https://github.com/cmclark00/RetroMusicPlayer.git
synced 2025-05-20 00:55:20 +01:00
Code Cleanup
This commit is contained in:
parent
c8ce98b1df
commit
ea4a54d404
10 changed files with 23 additions and 24 deletions
|
@ -21,11 +21,9 @@ class HomeImageLayout @JvmOverloads constructor(
|
|||
|
||||
init {
|
||||
if (PreferenceUtil.isHomeBanner) {
|
||||
bannerImageBinding = BannerImageLayoutBinding.inflate(LayoutInflater.from(context))
|
||||
addView(bannerImageBinding!!.root)
|
||||
bannerImageBinding = BannerImageLayoutBinding.inflate(LayoutInflater.from(context), this, true)
|
||||
} else {
|
||||
userImageBinding = UserImageLayoutBinding.inflate(LayoutInflater.from(context))
|
||||
addView(userImageBinding!!.root)
|
||||
userImageBinding = UserImageLayoutBinding.inflate(LayoutInflater.from(context), this, true)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -47,8 +47,7 @@ class ListItemView : FrameLayout {
|
|||
}
|
||||
|
||||
private fun init(context: Context, attrs: AttributeSet?) {
|
||||
binding = ListItemViewNoCardBinding.inflate(LayoutInflater.from(context))
|
||||
addView(binding.root)
|
||||
binding = ListItemViewNoCardBinding.inflate(LayoutInflater.from(context), this, true)
|
||||
|
||||
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.ListItemView)
|
||||
if (typedArray.hasValue(R.styleable.ListItemView_listItemIcon)) {
|
||||
|
|
|
@ -22,8 +22,7 @@ class PermissionItem @JvmOverloads constructor(
|
|||
|
||||
init {
|
||||
val attributes = context.obtainStyledAttributes(attrs, R.styleable.PermissionItem, 0, 0)
|
||||
binding = ItemPermissionBinding.inflate(LayoutInflater.from(context))
|
||||
addView(binding.root)
|
||||
binding = ItemPermissionBinding.inflate(LayoutInflater.from(context), this, true)
|
||||
|
||||
binding.title.text = attributes.getText(R.styleable.PermissionItem_permissionTitle)
|
||||
binding.summary.text =
|
||||
|
|
|
@ -30,11 +30,9 @@ class SettingListItemView @JvmOverloads constructor(
|
|||
defStyleAttr: Int = -1,
|
||||
defStyleRes: Int = -1
|
||||
) : FrameLayout(context, attrs, defStyleAttr, defStyleRes) {
|
||||
private var binding: ListSettingItemViewBinding =
|
||||
ListSettingItemViewBinding.inflate(LayoutInflater.from(context))
|
||||
|
||||
init {
|
||||
addView(binding.root)
|
||||
val binding: ListSettingItemViewBinding =
|
||||
ListSettingItemViewBinding.inflate(LayoutInflater.from(context), this, true)
|
||||
val typedArray =
|
||||
context.obtainStyledAttributes(attrs, R.styleable.SettingListItemView)
|
||||
binding.icon
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue