package ai.pai.client.views;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.Animation;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.android.common.utils.DeviceUtils;
import com.android.views.popup.BasePopupWindow;

import ai.pai.client.R;
import ai.pai.client.qrcode.QRCreateUtils;
import ai.pai.client.utils.GroupCreateUtils;

/**
 * Created by chengzhenyu on 2016/3/4.
 */
public class PhotoSharePopup extends BasePopupWindow {

    private View popupView;
    private View.OnClickListener listener;

    public PhotoSharePopup(Activity context, View.OnClickListener listener) {
        super(context);
        this.listener = listener;
        bindEvent();
    }

    @Override
    protected Animation getShowAnimation() {
        return getDefaultScaleAnimation();
    }

    @Override
    protected View getClickToDismissView() {
        return popupView.findViewById(R.id.click_to_dismiss);
    }

    @Override
    public View getPopupView() {
        popupView = LayoutInflater.from(mContext).inflate(R.layout.pop_share, null);
        return popupView;
    }

    @Override
    public View getAnimaView() {
        return popupView.findViewById(R.id.popup_anima);
    }

    private void bindEvent() {
        if (popupView!=null){
            popupView.findViewById(R.id.layout_share_friend_circle).setOnClickListener(listener);
            popupView.findViewById(R.id.layout_share_qq).setOnClickListener(listener);
            popupView.findViewById(R.id.layout_share_wechat).setOnClickListener(listener);
            popupView.findViewById(R.id.layout_share_weibo).setOnClickListener(listener);
        }

    }
}
