Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mvvmdemo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LouisWang
mvvmdemo
Commits
601c8960
Commit
601c8960
authored
Jun 29, 2020
by
TaylorZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(项目):更新ViewModel字段规范
parent
e73b0196
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletions
+5
-1
mvvm-demo/src/main/java/com/autocareai/mvvmdemo/demo/enity/UserEntity.kt
+1
-1
mvvm-demo/src/main/java/com/autocareai/mvvmdemo/demo/list/PopularWebsitesViewModel.kt
+4
-0
No files found.
mvvm-demo/src/main/java/com/autocareai/mvvmdemo/demo/enity/UserEntity.kt
View file @
601c8960
...
...
@@ -15,7 +15,7 @@ import kotlinx.android.parcel.Parcelize
class
UserEntity
:
Parcelable
{
// TODO: 2020/6/24 这里不用使用 data class,普通的 class 即可
// TODO: 2020/6/24 每一个字段都需要写注释,对于多状态字段,或者布尔字段,要写明各种情况下的含义
// TODO: 2020/6/24 字段必须赋初值,使用简写即可,比如 var email = "",而不是 var email = ""
// TODO: 2020/6/24 字段必须赋初值,使用简写即可,比如 var email = "",而不是 var email
: String
= ""
// xx
var
admin
=
false
...
...
mvvm-demo/src/main/java/com/autocareai/mvvmdemo/demo/list/PopularWebsitesViewModel.kt
View file @
601c8960
...
...
@@ -21,6 +21,10 @@ class PopularWebsitesViewModel : BaseViewModel() {
* 常用网站数据
*/
var
listDataEvent
=
SingleLiveEvent
<
ArrayList
<
PopularWebsitesEntity
>>()
// val popularWebsites = MutableLiveData<ArrayList<ListEntity>>()
// TODO: 2020/6/29 事件用SingleLiveEvent,比如:toast,显示弹窗,跳转界面,UI显示用MutableLiveData。
// TODO: 2020/6/29 事件字段命名有Event后缀,UI显示没有后缀,比如 userName,而不是 userNameEvent
/**
* 获取常用网站
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment