| | |
| | | import android.widget.TextView |
| | | import cn.flightfeather.thirdapp.R |
| | | import cn.flightfeather.thirdapp.module.base.BaseActivity |
| | | import cn.flightfeather.thirdapp.view.PopupWindowWithMask |
| | | |
| | | /** |
| | | * @author riku |
| | |
| | | ) { |
| | | val view = LayoutInflater.from(activity).inflate(R.layout.dialog_bottom_sheet, null) |
| | | activity?.let { |
| | | PopupWindow(it).apply popupWindow@{ |
| | | PopupWindowWithMask(it).apply popupWindow@{ |
| | | isFocusable = true |
| | | isOutsideTouchable = true |
| | | contentView = view |
| | |
| | | width = ViewGroup.LayoutParams.MATCH_PARENT |
| | | animationStyle = R.style.PopWin_bottom_anim_style |
| | | background.alpha = 0 |
| | | setOnDismissListener { |
| | | val wl = activity.window.attributes |
| | | wl.alpha = 1f |
| | | activity.window.attributes = wl |
| | | } |
| | | }.run { |
| | | val wl = activity.window.attributes |
| | | wl.alpha = 0.9f |
| | | activity.window.attributes = wl |
| | | showAtLocation(anchorView, Gravity.BOTTOM, 0, 0) |
| | | |
| | | } |
| | | } |
| | | } |