Commit 894325ec authored by fengruiyu's avatar fengruiyu

修改问题首次推荐的问题

parent 4fb3c46b
...@@ -19,6 +19,7 @@ import com.mints.street.webview.MintsWebViewActivity ...@@ -19,6 +19,7 @@ import com.mints.street.webview.MintsWebViewActivity
import me.goldze.mvvmhabit.base.AppManager import me.goldze.mvvmhabit.base.AppManager
import me.goldze.mvvmhabit.base.BaseViewModel import me.goldze.mvvmhabit.base.BaseViewModel
import me.goldze.mvvmhabit.utils.KLog import me.goldze.mvvmhabit.utils.KLog
import me.goldze.mvvmhabit.utils.SPUtils
import me.tatarka.bindingcollectionadapter2.ItemBinding import me.tatarka.bindingcollectionadapter2.ItemBinding
import java.io.BufferedReader import java.io.BufferedReader
import java.io.InputStreamReader import java.io.InputStreamReader
...@@ -116,8 +117,11 @@ class HomeViewModel(application: Application) : BaseViewModel(application) { ...@@ -116,8 +117,11 @@ class HomeViewModel(application: Application) : BaseViewModel(application) {
while (bf.readLine().also { line = it } != null) { while (bf.readLine().also { line = it } != null) {
stringBuilder.append(line) stringBuilder.append(line)
} }
if ( SPUtils.getInstance().decodeBoolean(HomeFragment.IS_FIRST_OPEN,true)){
mapbeanData.value = Gson().fromJson(stringBuilder.toString(), MapBean::class.java) mapbeanData.value = Gson().fromJson(stringBuilder.toString(), MapBean::class.java)
mapBean = Gson().fromJson(stringBuilder.toString(), MapBean::class.java) SPUtils.getInstance().encode(HomeFragment.IS_FIRST_OPEN,false)
}
} catch (e: Exception) { } catch (e: Exception) {
KLog.e("读取assets文件下的json出问题") KLog.e("读取assets文件下的json出问题")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment