Timmy-zzh / TDialog

DialogFragment封装,高效实现各种弹窗效果

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

在某些机型上显示不全

TianYu1022 opened this issue · comments

private fun showProtocolDialog(protocolTitle: String, protocolContent: String, url: String, name: String, idCard: String, companyName: String): TDialog {
        return TDialog
                .Builder(this.supportFragmentManager)
                .setLayoutRes(R.layout.dialog_protocol)
                .setCancelableOutside(false)
                .setScreenWidthAspect(this, CommonConstants.Dialog.WIDTH_ASPECT)
                .setOnBindViewListener { viewHolder ->
                    viewHolder.setText(R.id.tvProtocolTitleTop, protocolTitle)
                    viewHolder.setText(R.id.tvProtocolTitleBottom, protocolTitle)
                    if (protocolTitle.equals(getString(R.string.protocol_cooperation_agreement))) {
                        viewHolder.setText(R.id.tvProtocolContent, setProtocolCooperationAgreementContent(protocolContent, name, idCard, companyName))
                    } else {
                        viewHolder.setText(R.id.tvProtocolContent, protocolContent)
                    }
                }
                .setOnKeyListener(DialogInterface.OnKeyListener { _, keyCode, event ->
                    if (keyCode == KeyEvent.KEYCODE_BACK) {
                        return@OnKeyListener true //返回键无效
                    }
                    false
                })
                .addOnClickListener(R.id.btnCloseApp, R.id.btnShowProtocol)
                .setOnViewClickListener { _, view, tDialog ->
                    when (view.id) {
                        R.id.btnCloseApp -> {
                            HeartBeatService.stopHeartbeat()
                            MusicService.stopMusicService()
                            AppManager.getAppManager().AppExit(this, true)
                        }

                        R.id.btnShowProtocol -> {
                            if (ClickHelper.isFastDoubleClick) {
                                return@setOnViewClickListener
                            }
                            BrowserActivity.goWithTitle(this, protocolTitle, url)
                        }
                    }
                }.create().show()
    }

这一块代码有什么问题吗

commented

显示不全是什么情况呢?

commented

代码没问题,看下R.layout.dialog_protocol 文件内容