package com.cygnusa.hyperm.droppy.views;

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

import com.cygnusa.hyperm.R;


/**
 * Created by shehabic on 3/7/15.
 */
@SuppressLint("AppCompatCustomView")
public class DroppyMenuItemIconView extends ImageView {

    public DroppyMenuItemIconView(Context context) {
        this(context, null);
    }

    public DroppyMenuItemIconView(Context context, AttributeSet attrs) {
        this(context, attrs, R.attr.droppyMenuItemIconStyle);
    }

    public DroppyMenuItemIconView(Context context, AttributeSet attrs,
                                  int defStyleAttr) {
        super(context, attrs, defStyleAttr);

        final int defaultLayoutGravity = Gravity.RIGHT
                | Gravity.CENTER_VERTICAL;
        LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(60, 60);
        lp.rightMargin = 5;
        lp.leftMargin = 5;
        lp.gravity = defaultLayoutGravity;
        setLayoutParams(lp);
        setScaleType(ScaleType.FIT_CENTER);
    }
}
