private fun initializeProgressView(inflater: LayoutInflater, actionArea: ViewGroup) { if (mCard.mCardProgress != null) { val progressView: View = inflater.inflate(R.layout.card_progress, actionArea, false) val progressBar = progressView.findViewById(R.id.card_progress) as ProgressBar (progressView.findViewById(R.id.card_progress_text) as TextView).setText(mCard.mCardProgress.label) progressBar.max = mCard.mCardProgress.maxValue progressBar.progress = 0 mCard.mCardProgress.progressView = progressView mCard.mCardProgress.setProgressType(mCard.getProgressType()) actionArea.addView(progressView) } }
Build the progress view into the given ViewGroup .