|
|
@@ -8,6 +8,7 @@ import android.os.Handler |
|
|
import android.os.Looper |
|
|
import android.os.Looper |
|
|
import android.util.Log |
|
|
import android.util.Log |
|
|
import android.view.KeyEvent |
|
|
import android.view.KeyEvent |
|
|
|
|
|
import android.view.LayoutInflater |
|
|
import android.view.View |
|
|
import android.view.View |
|
|
import android.view.ViewGroup |
|
|
import android.view.ViewGroup |
|
|
import android.widget.TextView |
|
|
import android.widget.TextView |
|
|
@@ -43,6 +44,8 @@ import com.yzx.escreen.presenter.MainView |
|
|
import com.yzx.escreen.utils.hideNavigationBar |
|
|
import com.yzx.escreen.utils.hideNavigationBar |
|
|
import com.yzx.escreen.widget.* |
|
|
import com.yzx.escreen.widget.* |
|
|
import kotlinx.android.synthetic.main.activity_main.* |
|
|
import kotlinx.android.synthetic.main.activity_main.* |
|
|
|
|
|
import kotlinx.android.synthetic.main.dialog_leave.view.sureBtn |
|
|
|
|
|
import kotlinx.android.synthetic.main.dialog_sure.view.closeBtn |
|
|
import org.greenrobot.eventbus.EventBus |
|
|
import org.greenrobot.eventbus.EventBus |
|
|
import org.greenrobot.eventbus.Subscribe |
|
|
import org.greenrobot.eventbus.Subscribe |
|
|
import org.greenrobot.eventbus.ThreadMode |
|
|
import org.greenrobot.eventbus.ThreadMode |
|
|
@@ -250,26 +253,46 @@ class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatus |
|
|
dialogLayout.removeView(it) |
|
|
dialogLayout.removeView(it) |
|
|
dialogList.remove(it) |
|
|
dialogList.remove(it) |
|
|
} |
|
|
} |
|
|
dialog.onSureClick= {view, item -> |
|
|
|
|
|
|
|
|
dialog.onSureClick = { view, item -> |
|
|
|
|
|
|
|
|
val sureDialog = QMUIDialog.MessageDialogBuilder(this) |
|
|
|
|
|
sureDialog.setMessage("是否确认已放行?") |
|
|
|
|
|
sureDialog.setTitle("温馨提示") |
|
|
|
|
|
sureDialog.addAction("取消"){ _dialog, index -> |
|
|
|
|
|
_dialog?.dismiss() |
|
|
|
|
|
} |
|
|
|
|
|
sureDialog.addAction("确认"){ _dialog, index -> |
|
|
|
|
|
_dialog?.dismiss() |
|
|
|
|
|
|
|
|
val sureDialog = Dialog(this,R.style.TransparentDialog) |
|
|
|
|
|
val tempView = LayoutInflater.from(this).inflate(R.layout.dialog_sure, null, false) |
|
|
|
|
|
sureDialog.setContentView(tempView) |
|
|
|
|
|
tempView.sureBtn.setOnClickListener { |
|
|
|
|
|
sureDialog.dismiss() |
|
|
dialogLayout.removeView(view) |
|
|
dialogLayout.removeView(view) |
|
|
dialogList.remove(view) |
|
|
dialogList.remove(view) |
|
|
EventBus.getDefault().post(SureOutSchool(item)) |
|
|
EventBus.getDefault().post(SureOutSchool(item)) |
|
|
} |
|
|
} |
|
|
|
|
|
tempView.closeBtn.setOnClickListener { |
|
|
|
|
|
sureDialog.dismiss() |
|
|
|
|
|
} |
|
|
|
|
|
sureDialog.hideNavigationBar() |
|
|
sureDialog.show() |
|
|
sureDialog.show() |
|
|
|
|
|
|
|
|
|
|
|
// val sureDialog = QMUIDialog.MessageDialogBuilder(this) |
|
|
|
|
|
// sureDialog.setMessage("是否确认已放行?") |
|
|
|
|
|
// sureDialog.setTitle("温馨提示") |
|
|
|
|
|
// sureDialog.addAction("取消"){ _dialog, index -> |
|
|
|
|
|
// _dialog?.dismiss() |
|
|
|
|
|
// } |
|
|
|
|
|
// sureDialog.addAction("确认"){ _dialog, index -> |
|
|
|
|
|
// _dialog?.dismiss() |
|
|
|
|
|
// dialogLayout.removeView(view) |
|
|
|
|
|
// dialogList.remove(view) |
|
|
|
|
|
// EventBus.getDefault().post(SureOutSchool(item)) |
|
|
|
|
|
// } |
|
|
|
|
|
// sureDialog.show() |
|
|
|
|
|
showSureDialog() |
|
|
} |
|
|
} |
|
|
dialogLayout.addView(dialog) |
|
|
dialogLayout.addView(dialog) |
|
|
dialogList.add(dialog) |
|
|
dialogList.add(dialog) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun showSureDialog() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//接收异动消息 |
|
|
//接收异动消息 |
|
|
@Subscribe(threadMode = ThreadMode.MAIN) |
|
|
@Subscribe(threadMode = ThreadMode.MAIN) |
|
|
fun onMessageEvent(detail: StuChange) { |
|
|
fun onMessageEvent(detail: StuChange) { |
|
|
@@ -394,7 +417,7 @@ class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatus |
|
|
|
|
|
|
|
|
override fun onClose(code: Int, reason: String?, remote: Boolean) { |
|
|
override fun onClose(code: Int, reason: String?, remote: Boolean) { |
|
|
LogUtils.d("initWs-WebSocketClient-onClose", code, reason, remote) |
|
|
LogUtils.d("initWs-WebSocketClient-onClose", code, reason, remote) |
|
|
mWsHandler.postDelayed(mWsRunnable,60*1000) |
|
|
|
|
|
|
|
|
mWsHandler.postDelayed(mWsRunnable, 60 * 1000) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
override fun onMessage(message: String?) { |
|
|
override fun onMessage(message: String?) { |
|
|
@@ -406,7 +429,7 @@ class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatus |
|
|
|
|
|
|
|
|
override fun onError(ex: Exception?) { |
|
|
override fun onError(ex: Exception?) { |
|
|
LogUtils.d("initWs-WebSocketClient-onError", ex) |
|
|
LogUtils.d("initWs-WebSocketClient-onError", ex) |
|
|
mWsHandler.postDelayed(mWsRunnable,60*1000) |
|
|
|
|
|
|
|
|
mWsHandler.postDelayed(mWsRunnable, 60 * 1000) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|