forked from razerdp/BasePopup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BlurSlideFromBottomPopup.java
64 lines (53 loc) · 1.7 KB
/
BlurSlideFromBottomPopup.java
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package razerdp.demo.popup;
import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.view.animation.Animation;
import razerdp.basepopup.BasePopupWindow;
import razerdp.basepopup.R;
import razerdp.demo.utils.ToastUtils;
/**
* Created by 大灯泡 on 2017/12/27.
* 从底部滑上来同时模糊的popup
*/
public class BlurSlideFromBottomPopup extends BasePopupWindow implements View.OnClickListener {
private View popupView;
public BlurSlideFromBottomPopup(Context context) {
super(context);
setPopupGravity(Gravity.BOTTOM);
bindEvent();
}
@Override
protected Animation onCreateShowAnimation() {
return getTranslateVerticalAnimation(1f, 0f, 300);
}
@Override
protected Animation onCreateDismissAnimation() {
return getTranslateVerticalAnimation(0f, 1f, 300);
}
@Override
public View onCreateContentView() {
return createPopupById(R.layout.popup_blur_slide_from_bottom);
}
private void bindEvent() {
findViewById(R.id.tx_1).setOnClickListener(this);
findViewById(R.id.tx_2).setOnClickListener(this);
findViewById(R.id.tx_3).setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.tx_1:
ToastUtils.ToastMessage(getContext(), "click tx_1");
break;
case R.id.tx_2:
ToastUtils.ToastMessage(getContext(), "click tx_2");
break;
case R.id.tx_3:
ToastUtils.ToastMessage(getContext(), "click tx_3");
break;
default:
break;
}
}
}