-
-
Notifications
You must be signed in to change notification settings - Fork 759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DialogFragment 中通过继承 BasePopup 的方式使用未能显示,在 activity 中使用可以显示 #145
Comments
我这里留意到你用了延迟加载,不过应该没关系- -请问你的popup是在哪里调用的呢 |
抱歉,我未对位于 dialogFragment 之上的 popup 不能正常显示,做尽可能的测试,后经测试发现,popup 是显示的,但显示位于 activity 之上,dialogFragment 之下,以下是我进行测试的代码
}` |
我待会写个demo测试一下 |
@Yifpro96 经检查,发现popup确实是在dialogfragment之下显示,关于这方面的问题,我跟踪一下哈 |
【Candy】2.1.9-alpha已修复 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
`class SalesUnitPopup(context: Context) : BasePopupWindow(context, true) {
private val mList = arrayListOf()
private val mAdapter by lazy { SalesUnitAdapter(R.layout.item_popup_window, mList) }
private var mOnItemClickListener: ((String) -> Unit)? = null
override fun onCreateContentView(): View {
val view = createPopupById(R.layout.view_popup_content)
val recyclerView = view.findViewById(R.id.recyclerView)
recyclerView.setBackgroundResource(R.drawable.bg_popup_down)
mAdapter.setOnItemClickListener { _, _, position ->
mOnItemClickListener?.invoke(mList[position])
}
recyclerView.run {
layoutManager = LinearLayoutManager(context)
adapter = mAdapter
}
return view
}
fun setOnItemClickListener(listener: (String) -> Unit) {
mOnItemClickListener = listener
}
fun setData(data: List) {
mList.clear()
mList.addAll(data)
mAdapter.notifyDataSetChanged()
}
init {
delayInit()
}
}
SalesUnitPopup(activity).setPopupGravity(Gravity.BOTTOM or Gravity.CENTER_HORIZONTAL).showPopupWindow(tv)
`
The text was updated successfully, but these errors were encountered: