Merlin (they)
10/02/2023, 3:33 PMif (typedArray.hasValue(R.styleable.SomeView_some_attribute)) {
this.someAttribute = typedArray.getString(R.styleable.SomeView_some_attribute).toString()
}
if (typedArray.hasValue(R.styleable.SomeView_some_other_attribute)) {
this.someOtherAttribute = typedArray.getIntOrThrow(R.styleable.SomeView_some_other_attribute).toString()
}
Is there a cleaner way to do all this? Some kind of loop or something?