Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wsj1024 committed Jul 31, 2021
1 parent eb4952b commit 38d8005
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ class AddCityActivity : BaseVmActivity<ActivityAddCityBinding, SearchViewModel>(

override fun bindView() = inflate(layoutInflater)

override fun prepareData(intent: Intent) {
fromSplash = intent.getBooleanExtra("fromSplash", false)
override fun prepareData(intent: Intent?) {
intent?.let {
fromSplash = it.getBooleanExtra("fromSplash", false)
}
}

override fun initView() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class HomeActivity : BaseVmActivity<ActivityMainBinding, MainViewModel>() {

override fun bindView() = ActivityMainBinding.inflate(layoutInflater)

override fun prepareData(intent: Intent) {}
override fun prepareData(intent: Intent?) {}

override fun initView() {
hideTitleBar()
Expand Down
36 changes: 0 additions & 36 deletions app/src/main/java/me/wsj/fengyun/ui/base/CreateInit.java

This file was deleted.

32 changes: 32 additions & 0 deletions app/src/main/java/me/wsj/fengyun/ui/base/CreateInit.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package me.wsj.fengyun.ui.base

import android.content.Intent
import androidx.viewbinding.ViewBinding

/**
* Created by shiju.wang on 2018/2/10.
*/
interface CreateInit<T : ViewBinding?> {
fun bindView(): T

/**
* 接收数据
* @param intent
*/
fun prepareData(intent: Intent?)

/**
* 初始化布局组件
*/
fun initView()

/**
* 处理事件
*/
fun initEvent()

/**
* 初始化数据
*/
fun initData()
}

0 comments on commit 38d8005

Please sign in to comment.