Newer
Older
MonCalc / app / src / main / kotlin / jackall / moncalc / activity / TestActivity.kt
KeijuMatsumoto on 5 Nov 2017 946 bytes [add] update ui
package jackall.moncalc.activity

import android.databinding.DataBindingUtil
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import jackall.moncalc.R
import jackall.moncalc.common.PreferenceNames
import jackall.moncalc.databinding.ActivityTestBinding
import jackall.moncalc.db.MonstDataRealmHelper
import jackall.moncalc.utils.MySharedPref
import jackall.moncalc.viewmodel.TestViewModel


class TestActivity : AppCompatActivity() {

    val mySharedPref by lazy { MySharedPref(this, PreferenceNames.CONFIG) }
    val monstDataRealmHelper = MonstDataRealmHelper()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val binding = DataBindingUtil.setContentView<ActivityTestBinding>(this, R.layout.activity_test)
        binding.viewModel = TestViewModel()
    }

    override fun onDestroy() {
        super.onDestroy()
        monstDataRealmHelper.close()
    }
}