private fun init(context: Context, attrs: AttributeSet, theme: RuqusTheme) { inflate(context, R.layout.rqv_card, this) outlineView = findViewById(R.id.outline) as FrameLayout outlineTextView = findViewById(R.id.outline_text) as TextView cardView = findViewById(R.id.card) as CardView cardTextView = findViewById(R.id.card_text) as TextView setTheme(theme)
val typedArray: TypedArray = context.obtainStyledAttributes(attrs, R.styleable.RQVCard) mode = if (typedArray.getInt( R.styleable.RQVCard_rqv_card_mode, 0 ) == 0 ) Mode.OUTLINE else Mode.CARD outlineTextView.setText(typedArray.getString(R.styleable.RQVCard_rqv_outline_text)) cardTextView.setText(typedArray.getString(R.styleable.RQVCard_rqv_card_text)) typedArray.recycle()}
Initialize our view .