fun getStyleFromAttribute()

in core/src/main/kotlin/com/uber/sdk2/core/ui/UberStyle.kt [51:66]


    fun getStyleFromAttribute(
      context: Context,
      attributeSet: AttributeSet?,
      @StyleRes defStyleRes: Int,
      @StyleableRes styleableMain: IntArray?,
      @StyleableRes styleable: Int,
    ): UberStyle {
      val typedArray =
        context.theme.obtainStyledAttributes(attributeSet, styleableMain!!, 0, defStyleRes)
      try {
        val style = typedArray.getInt(styleable, DEFAULT.value)
        return fromInt(style)
      } finally {
        typedArray.recycle()
      }
    }