| @@ -19,8 +19,8 @@ android { | |||
| // minSdkVersion 26 | |||
| minSdkVersion 21 | |||
| targetSdkVersion 25 | |||
| versionCode 30200 | |||
| versionName "3.2.0" | |||
| versionCode 30201 | |||
| versionName "3.2.1" | |||
| testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | |||
| ndk { | |||
| @@ -8,6 +8,7 @@ import android.os.Handler | |||
| import android.os.Looper | |||
| import android.util.Log | |||
| import android.view.KeyEvent | |||
| import android.view.LayoutInflater | |||
| import android.view.View | |||
| import android.view.ViewGroup | |||
| import android.widget.TextView | |||
| @@ -43,6 +44,8 @@ import com.yzx.escreen.presenter.MainView | |||
| import com.yzx.escreen.utils.hideNavigationBar | |||
| import com.yzx.escreen.widget.* | |||
| 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.Subscribe | |||
| import org.greenrobot.eventbus.ThreadMode | |||
| @@ -250,26 +253,46 @@ class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatus | |||
| dialogLayout.removeView(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) | |||
| dialogList.remove(view) | |||
| EventBus.getDefault().post(SureOutSchool(item)) | |||
| } | |||
| tempView.closeBtn.setOnClickListener { | |||
| sureDialog.dismiss() | |||
| } | |||
| sureDialog.hideNavigationBar() | |||
| 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) | |||
| dialogList.add(dialog) | |||
| } | |||
| fun showSureDialog() { | |||
| } | |||
| //接收异动消息 | |||
| @Subscribe(threadMode = ThreadMode.MAIN) | |||
| fun onMessageEvent(detail: StuChange) { | |||
| @@ -394,7 +417,7 @@ class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatus | |||
| override fun onClose(code: Int, reason: String?, remote: Boolean) { | |||
| LogUtils.d("initWs-WebSocketClient-onClose", code, reason, remote) | |||
| mWsHandler.postDelayed(mWsRunnable,60*1000) | |||
| mWsHandler.postDelayed(mWsRunnable, 60 * 1000) | |||
| } | |||
| override fun onMessage(message: String?) { | |||
| @@ -406,7 +429,7 @@ class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatus | |||
| override fun onError(ex: Exception?) { | |||
| LogUtils.d("initWs-WebSocketClient-onError", ex) | |||
| mWsHandler.postDelayed(mWsRunnable,60*1000) | |||
| mWsHandler.postDelayed(mWsRunnable, 60 * 1000) | |||
| } | |||
| } | |||
| @@ -0,0 +1,85 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
| <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
| xmlns:app="http://schemas.android.com/apk/res-auto" | |||
| xmlns:tools="http://schemas.android.com/tools" | |||
| android:layout_width="match_parent" | |||
| android:layout_height="match_parent" | |||
| android:orientation="vertical"> | |||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout | |||
| android:layout_width="match_parent" | |||
| android:layout_height="wrap_content" | |||
| android:minWidth="600dp" | |||
| android:orientation="vertical" | |||
| app:qmui_backgroundColor="@color/white" | |||
| app:qmui_radius="@dimen/d_15"> | |||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundFrameLayout | |||
| android:layout_width="match_parent" | |||
| android:layout_height="wrap_content" | |||
| app:qmui_backgroundColor="@color/colorPrimary" | |||
| app:qmui_radiusTopLeft="@dimen/d_15" | |||
| app:qmui_radiusTopRight="@dimen/d_15"> | |||
| <TextView | |||
| android:layout_width="match_parent" | |||
| android:layout_height="wrap_content" | |||
| android:gravity="center" | |||
| android:padding="@dimen/d_28" | |||
| android:text="温馨提示" | |||
| android:textColor="@color/white" | |||
| android:textSize="@dimen/sp20" | |||
| android:textStyle="bold" /> | |||
| </com.qmuiteam.qmui.widget.roundwidget.QMUIRoundFrameLayout> | |||
| <RelativeLayout | |||
| android:layout_width="match_parent" | |||
| android:layout_height="300dp" | |||
| android:layout_marginTop="@dimen/d_20" | |||
| android:orientation="horizontal"> | |||
| <TextView | |||
| android:layout_width="wrap_content" | |||
| android:layout_height="wrap_content" | |||
| android:layout_centerInParent="true" | |||
| android:text="是否确认已放行?" | |||
| android:textSize="30dp" /> | |||
| </RelativeLayout> | |||
| <androidx.appcompat.widget.LinearLayoutCompat | |||
| android:layout_width="wrap_content" | |||
| android:layout_gravity="center_horizontal" | |||
| android:layout_height="wrap_content"> | |||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | |||
| android:id="@+id/closeBtn" | |||
| android:layout_width="200dp" | |||
| android:layout_height="80dp" | |||
| android:layout_gravity="center_horizontal" | |||
| android:layout_marginTop="@dimen/dp_40" | |||
| android:padding="@dimen/d_10" | |||
| android:text="关闭" | |||
| android:textSize="@dimen/sp20" | |||
| android:textColor="@color/black" | |||
| app:qmui_borderColor="@color/gray" | |||
| app:qmui_radius="@dimen/d_5" /> | |||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | |||
| android:id="@+id/sureBtn" | |||
| android:layout_width="200dp" | |||
| android:layout_height="80dp" | |||
| android:layout_gravity="center_horizontal" | |||
| android:layout_marginTop="@dimen/dp_40" | |||
| android:padding="@dimen/d_10" | |||
| android:text="已放行" | |||
| android:layout_marginLeft="@dimen/d_30" | |||
| android:textSize="@dimen/sp20" | |||
| android:textColor="@color/white" | |||
| app:qmui_borderColor="@color/blue" | |||
| app:qmui_backgroundColor="@color/blue" | |||
| app:qmui_radius="@dimen/d_5" /> | |||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||
| </com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout> | |||
| </FrameLayout> | |||
| @@ -227,4 +227,10 @@ | |||
| <item name="android:textSize">@dimen/d_28</item> | |||
| <item name="android:textStyle">bold</item> | |||
| </style> | |||
| <style name="TransparentDialog" parent="Theme.AppCompat.Dialog"> | |||
| <item name="android:windowBackground">@android:color/transparent</item> | |||
| <item name="android:windowIsFloating">true</item> | |||
| <item name="android:windowNoTitle">true</item> | |||
| </style> | |||
| </resources> | |||