package com.weikou.wpc.superad.widget;
|
|
import android.content.Context;
|
import android.util.AttributeSet;
|
import android.view.LayoutInflater;
|
import android.view.View;
|
import android.widget.FrameLayout;
|
import android.widget.ImageView;
|
import android.widget.LinearLayout;
|
import android.widget.TextView;
|
|
import com.weikou.myselfsuperad.R;
|
|
public class BannerLayout extends FrameLayout {
|
|
private View view;
|
public ImageView iv_img;
|
public TextView tv_title;
|
public TextView tv_description;
|
public ImageView iv_banner_close;
|
public ImageView iv_banner_download;
|
public ImageView iv_banner_full_img;
|
|
public LinearLayout ll_img_and_text;
|
public RatioLayout rl_only_img;
|
|
private boolean isInit = false;
|
|
public BannerLayout(Context context, AttributeSet attrs, int defStyle) {
|
super(context, attrs, defStyle);
|
if (!isInit) {
|
init(context);
|
}
|
}
|
|
public BannerLayout(Context context, AttributeSet attrs) {
|
super(context, attrs);
|
if (!isInit) {
|
init(context);
|
}
|
}
|
|
public BannerLayout(Context context) {
|
super(context);
|
if (!isInit) {
|
init(context);
|
}
|
}
|
|
private void init(Context context) {
|
isInit = true;
|
view = LayoutInflater.from(context).inflate(R.layout.banner_layout,
|
this, true);
|
ll_img_and_text=(LinearLayout) view.findViewById(R.id.ll_img_and_text);
|
rl_only_img = (RatioLayout) view.findViewById(R.id.rl_only_img);
|
iv_img = (ImageView) view.findViewById(R.id.iv_img);
|
tv_title = (TextView) view.findViewById(R.id.tv_banner_title);
|
tv_description = (TextView) view.findViewById(R.id.tv_banner_descrip);
|
iv_banner_full_img = (ImageView) view.findViewById(R.id.iv_ad_full_img);
|
iv_banner_close = (ImageView) view.findViewById(R.id.iv_banner_close);
|
iv_banner_download = (ImageView) view.findViewById(R.id.iv_download);
|
}
|
}
|