提交 63703ee7 编写于 作者: 杜庆泉's avatar 杜庆泉

waiting view 增加 topPageView参数

上级 1bd91505
......@@ -63,10 +63,12 @@ export class WaitingView{
private currentHandler: Handler
private hostView:View | null = null
//{"back":"transmit","height":"112px","loading":{"display":"block","height":"55px","icon":"__uniapperror.png","jSONArray":false},"padding":"10px","size":"16px","width":"140px"}
constructor(context?: Activity, style: UTSJSONObject) {
constructor(context?: Activity, style: UTSJSONObject,view:View) {
this.context = context;
this.style = style.toJSONObject() as JSONObject
......@@ -79,6 +81,7 @@ export class WaitingView{
this.textView = this.waitingView.findViewById<TextView>(R.id.dcloud_tv_loading)
this.seaparatorView = this.waitingView.findViewById<View>(R.id.dcloud_view_seaparator)
this.mImageView = this.waitingView.findViewById<ImageView>(R.id.dcloud_iv_loading)
this.hostView = view
this.textView.setMaxLines(2)
......@@ -179,7 +182,7 @@ export class WaitingView{
}
let mpop = new PopupWindow(this.waitingView, width.toInt(), height.toInt(), this.mask)
this.mpopWindow = mpop
mpop.showAtLocation((this.context?.findViewById<ViewGroup>(android.R.id.content))?.getChildAt(0), Gravity.CENTER, 0, 0)
mpop.showAtLocation(hostView, Gravity.CENTER, 0, 0)
mpop.setOutsideTouchable(true)
mpop.setOnDismissListener(new WaitingDismissListener())
mpop.setTouchInterceptor(new TouchInterceptorListener(this.mask))
......
......@@ -114,7 +114,7 @@ function makeLoading(style : ShowLoadingOptions, type : string, errMsg : string)
/**
* uni-app
*/
const alert = new WaitingView(UTSAndroid.getTopPageActivity(), options)
const alert = new WaitingView(UTSAndroid.getTopPageActivity(), options,UTSAndroid.getTopPageView())
toast = alert
alert?.showWaiting();
......@@ -134,7 +134,7 @@ function makeLoading(style : ShowLoadingOptions, type : string, errMsg : string)
const page = pages[pages.length - 1].vm!
const instance = page.$
if (page.$isReady) {
const alert = new WaitingView(UTSAndroid.getTopPageActivity(), options)
const alert = new WaitingView(UTSAndroid.getTopPageActivity(), options,UTSAndroid.getTopPageView())
toast = alert
alert?.showWaiting();
} else {
......@@ -143,7 +143,7 @@ function makeLoading(style : ShowLoadingOptions, type : string, errMsg : string)
if(onReadyToast.containsKey(page)){
options = onReadyToast.get(page) as UTSJSONObject;
const alert = new WaitingView(UTSAndroid.getTopPageActivity(), options)
const alert = new WaitingView(UTSAndroid.getTopPageActivity(), options,UTSAndroid.getTopPageView())
toast = alert
alert?.showWaiting();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册