mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 09:25:49 +03:00
Fix missing recycle call and ensure this mistake will not happen again
This commit is contained in:
parent
bc9493d5b9
commit
a1466e299b
3 changed files with 4 additions and 3 deletions
|
@ -30,6 +30,7 @@
|
||||||
<issue id="SetTextI18n" severity="error" />
|
<issue id="SetTextI18n" severity="error" />
|
||||||
<issue id="ViewConstructor" severity="error" />
|
<issue id="ViewConstructor" severity="error" />
|
||||||
<issue id="UseValueOf" severity="error" />
|
<issue id="UseValueOf" severity="error" />
|
||||||
|
<issue id="Recycle" severity="error" />
|
||||||
|
|
||||||
<!-- Ignore error from HtmlCompressor lib -->
|
<!-- Ignore error from HtmlCompressor lib -->
|
||||||
<issue id="InvalidPackage">
|
<issue id="InvalidPackage">
|
||||||
|
|
|
@ -129,7 +129,7 @@ class BadgeFloatingActionButton @JvmOverloads constructor(
|
||||||
attrs?.let { initAttrs(attrs) }
|
attrs?.let { initAttrs(attrs) }
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("ResourceType", "Recycle")
|
@SuppressWarnings("Recycle")
|
||||||
private fun initAttrs(attrs: AttributeSet) {
|
private fun initAttrs(attrs: AttributeSet) {
|
||||||
context.obtainStyledAttributes(attrs, R.styleable.BadgeFloatingActionButton).use {
|
context.obtainStyledAttributes(attrs, R.styleable.BadgeFloatingActionButton).use {
|
||||||
counterBackgroundColor = it.getColor(R.styleable.BadgeFloatingActionButton_badgeBackgroundColor, 0)
|
counterBackgroundColor = it.getColor(R.styleable.BadgeFloatingActionButton_badgeBackgroundColor, 0)
|
||||||
|
|
|
@ -73,11 +73,11 @@ class PollResultLineView @JvmOverloads constructor(
|
||||||
orientation = HORIZONTAL
|
orientation = HORIZONTAL
|
||||||
ButterKnife.bind(this)
|
ButterKnife.bind(this)
|
||||||
|
|
||||||
val typedArray = context.obtainStyledAttributes(attrs,
|
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.PollResultLineView, 0, 0)
|
||||||
R.styleable.PollResultLineView, 0, 0)
|
|
||||||
label = typedArray.getString(R.styleable.PollResultLineView_optionName) ?: ""
|
label = typedArray.getString(R.styleable.PollResultLineView_optionName) ?: ""
|
||||||
percent = typedArray.getString(R.styleable.PollResultLineView_optionCount) ?: ""
|
percent = typedArray.getString(R.styleable.PollResultLineView_optionCount) ?: ""
|
||||||
optionSelected = typedArray.getBoolean(R.styleable.PollResultLineView_optionSelected, false)
|
optionSelected = typedArray.getBoolean(R.styleable.PollResultLineView_optionSelected, false)
|
||||||
isWinner = typedArray.getBoolean(R.styleable.PollResultLineView_optionIsWinner, false)
|
isWinner = typedArray.getBoolean(R.styleable.PollResultLineView_optionIsWinner, false)
|
||||||
|
typedArray.recycle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue