allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.huangxiaoguo1:hxgpopupwindow:1.0.2'
}
HxgPopupUtils.getInstance()
.setContentView(this, R.layout.popup_item)
.setLayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, -2)
.setFocusable(true)
.dismissPopWindow(R.id.view)
.showAsDropDown(mTvAddress)
View popupView = HxgPopupUtils.getInstance()
.setContentView(this, R.layout.popup_item)
.setLayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, -2)
.setFocusable(true)
.dismissPopWindow(R.id.view)
// .showAsDropDown(mTvAddress)
.setBackgroundDrawable()
.showAtLocation(mTvAddress, Gravity.TOP, 100, 300)
.setAnimation(as)
.getView();
((TextView) popupView.findViewById(R.id.textview))
.setText("我是更改的PopupWindow");
setContentView(Context context, int layoutId)
setLayoutParams(int width, int height)
setBackgroundDrawable()
setFocusable(boolean isFocusable)
showAsDropDown(View view)
showAtLocation(View view, int gravity, int x, int y)
setAnimation(Animation animation)
setAnimation(AnimationSet animation)
getView()
dismissPopWindow(int viewId)
dismissPopWindow()
setOnDismissListener(OnDismissListener listener)