title: How to access constructor argument that's not member variable in init function?
body: <p>I have a custom layout as below</p>
  
  <pre><code>class CustomComponent : FrameLayout {
  
      constructor(context: Context?) : super(context)
      constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) {
          initAttrs(attrs)
      }
  
      constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
          initAttrs(attrs)
      }
  
      constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
          initAttrs(attrs)
      }
  
      init {
          LayoutInflater.from(context).inflate(R.layout.view_custom_component, this, true)
      }
  
      fun initAttrs(attrs: AttributeSet?) {
          val typedArray = context.obtainStyledAttributes(attrs, R.styleable.custom_component_attributes, 0, 0)
          my_title.text = resources.getText(typedArray
                  .getResourceId(R.styleable.custom_component_attributes_custom_component_title, R.string.component_one))
          typedArray.recycle()
      }
  }
  </code></pre>
  
  <p>Now for each constructor, I have to explicitly call <code>initAttrs(attrs)</code> as I can't find  way to access <code>attrs</code> in my <code>init</code> function.</p>
  
  <p>Is there a way I could access <code>attrs</code> in <code>init</code> function, so I could call <code>initAttrs(attrs)</code> from <code>init</code> instead of having to explicitly call it in each of the constructor?</p>