Search in sources :

Example 1 with QuestionCard

use of com.mindorks.framework.mvvm.ui.main.QuestionCard in project android-mvvm-architecture by MindorksOpenSource.

the class BindingUtils method addQuestionItems.

@BindingAdapter({ "adapter", "action" })
public static void addQuestionItems(SwipePlaceHolderView mCardsContainerView, List<QuestionCardData> mQuestionList, int mAction) {
    if (mAction == MainViewModel.ACTION_ADD_ALL) {
        if (mQuestionList != null) {
            mCardsContainerView.removeAllViews();
            for (QuestionCardData question : mQuestionList) {
                if (question != null && question.options != null && question.options.size() == 3) {
                    mCardsContainerView.addView(new QuestionCard(question));
                }
            }
            ViewAnimationUtils.scaleAnimateView(mCardsContainerView);
        }
    }
}
Also used : QuestionCard(com.mindorks.framework.mvvm.ui.main.QuestionCard) QuestionCardData(com.mindorks.framework.mvvm.data.model.others.QuestionCardData) BindingAdapter(android.databinding.BindingAdapter)

Aggregations

BindingAdapter (android.databinding.BindingAdapter)1 QuestionCardData (com.mindorks.framework.mvvm.data.model.others.QuestionCardData)1 QuestionCard (com.mindorks.framework.mvvm.ui.main.QuestionCard)1