LiveShowInfoPopWindow.java
1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.cnlive.goldenline.ui.widget;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.PopupWindow;
import android.widget.TextView;
import com.cnlive.goldenline.R;
/**
* Description:
* Created on 2017/3/4
* Author : 萧
*/
public class LiveShowInfoPopWindow extends PopupWindow {
public LiveShowInfoPopWindow(final Context mContext, String title, String info, int height) {
final View view = LayoutInflater.from(mContext).inflate(R.layout.layout_theater_info_expanded, null);
view.setAnimation(AnimationUtils.loadAnimation(mContext, R.anim.pop_enter_anim_slow));
this.setWidth(ViewGroup.LayoutParams.MATCH_PARENT);
ColorDrawable cd = new ColorDrawable(Color.WHITE);
this.setBackgroundDrawable(cd);
this.setHeight(height > 0 ? height : ViewGroup.LayoutParams.WRAP_CONTENT);
this.setFocusable(true);
this.setContentView(view);
this.setOutsideTouchable(false);
this.setAnimationStyle(R.style.popup_anim_slow);
TextView tv_title = (TextView) view.findViewById(R.id.theaterinfo_expanded_tv_title);
ImageView img_close = (ImageView) view.findViewById(R.id.img_close);
TextView tv_info = (TextView) view.findViewById(R.id.theaterinfo_expanded_tv_info);
tv_title.setText(title);
tv_info.setText(info);
img_close.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dismiss();
}
});
}
}