package com.android.chmo.ui.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.Gravity;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.android.chmo.R;


public class StarView extends LinearLayout {
    public StarView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }
    private void init() {
        setOrientation(LinearLayout.HORIZONTAL);
        setGravity(Gravity.CENTER_VERTICAL);
    }

    public void setStar(int star) {
        removeAllViews();
        for(int i=0; i<star; i++) {
            ImageView image = new ImageView(getContext());
            image.setImageResource(R.mipmap.star);
            addView(image);
        }
    }
}
