徐勤民 e01aa4f05c 部分问题修复 | 2 months ago | |
---|---|---|
.. | ||
src | 2 months ago | |
.gitattributes | 2 months ago | |
.gitignore | 2 months ago | |
README.md | 2 months ago | |
build.gradle | 2 months ago | |
consumer-rules.pro | 2 months ago | |
proguard-rules.pro | 2 months ago |
[TOC]
WebSocketHandler.getInstance("ws://192.168.3.20:8765")
runOnUiThread { "提示信息".showMessage() }
App.getInstance().runOnUiThread() {}
App.getInstance().runOnUiThreadDelay({},1100)
"连接完成".showMessage()
ToolsHelper.showMessage("")
"".loge()
"".log()
LogHelper.d("")
private var oldTime = 0L
override fun onBackPressed() {
val newTime = System.currentTimeMillis()
if (newTime - oldTime < 1500 && oldTime != 0L)
AppManager.getInstance().exit()
else {
oldTime = newTime
ToolsHelper.showMessage("双击退出")
}
}
所有界面继承
BaseFragment
,BaseActivity
,BaseListActivity
等页面
layout
跟节点必须为layout
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
</layout>
BaseListActivity
BaseListFormLayoutActivity
布局列表部分必须使用下面的方法和id
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/baseRefreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.xuqm.base.view.EmptyView
android:id="@+id/baseEmptyView"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/baseRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never" />
</com.xuqm.base.view.EmptyView>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
binding.btn1.setOnClickListener {
}
使用base自带导航栏的情况下,可以操控对应控件
baseBinding.baseToolbar.backBtn.setOnClickListener {}