| |
---|
| | import jackall.moncalc.R |
---|
| | import jackall.moncalc.common.PreferenceKeys |
---|
| | import jackall.moncalc.common.PreferenceNames |
---|
| | import jackall.moncalc.db.FruitRealmHelper |
---|
| | import jackall.moncalc.db.GradeRealmHelper |
---|
| | import jackall.moncalc.db.TempleRealmHelper |
---|
| | import jackall.moncalc.service.MainService |
---|
| | import jackall.moncalc.utils.MySharedPref |
---|
| | import jackall.moncalc.vo.MonstData |
---|
| |
---|
| | |
---|
| | val mySharedPref by lazy { MySharedPref(this, PreferenceNames.CONFIG) } |
---|
| | val fruitRealmHelper by lazy { FruitRealmHelper() } |
---|
| | val templeRealmHelper by lazy { TempleRealmHelper() } |
---|
| | val gradeRealmHelper by lazy { GradeRealmHelper() } |
---|
| | |
---|
| | override fun onCreate(savedInstanceState: Bundle?) { |
---|
| | super.onCreate(savedInstanceState) |
---|
| | setContentView(R.layout.activity_main) |
---|
| |
---|
| | val monstData = Gson().fromJson<MonstData>(jsonReader, MonstData::class.java) |
---|
| | |
---|
| | fruitRealmHelper.update(monstData.fruit) |
---|
| | templeRealmHelper.update(monstData.temple) |
---|
| | gradeRealmHelper.update(monstData.grade) |
---|
| | |
---|
| | mySharedPref.putValue(PreferenceKeys.QUESTDATAVERSION, Int::class.java, Const.questDataVersion) |
---|
| | |
---|
| | println("db update") |
---|
| |
---|
| | |