CircleImageSteps.java 文件源码

java
阅读 33 收藏 0 点赞 0 评论 0

项目:Steps_Android 作者:
/**
 * Function to add view to component
 *
 * @param tag              View tag usually the step number
 * @param drawableResource drawable resource of view
 */
private void addView(int tag, @DrawableRes int drawableResource, boolean isLastStep) {
    // inflate view to component
    View view = LayoutInflater.from(getContext()).inflate(R.layout.step_view_item, rootView, false);

    //set view size and margins
    LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(stepSize, stepSize);
    layoutParams.setMargins(10, 10, 10, 10);
    view.findViewById(R.id.iv_main_step_image).setLayoutParams(layoutParams);
    view.setTag(tag);

    //set view background color
    setStepColorStatus(false, view);

    //add Image icon to view and add view
    ((ImageView) view.findViewById(R.id.iv_main_step_image)).setImageResource(drawableResource);
    rootView.addView(view);

    if (!isLastStep) {
        view = LayoutInflater.from(getContext()).inflate(R.layout.split_view_item, rootView, false);
        rootView.addView(view);
    }

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号