Revision control

Copy as Markdown

/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package mozilla.lockbox.view
import android.os.Bundle
import android.view.WindowManager
import androidx.appcompat.app.AppCompatActivity
import kotlinx.coroutines.ExperimentalCoroutinesApi
import mozilla.lockbox.R
import mozilla.lockbox.presenter.AppRoutePresenter
import mozilla.lockbox.support.isDebug
@ExperimentalCoroutinesApi
class RootActivity : AppCompatActivity() {
private var presenter: AppRoutePresenter = AppRoutePresenter(this)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_root)
if (!isDebug()) window.addFlags(WindowManager.LayoutParams.FLAG_SECURE)
presenter.onViewReady()
}
override fun onDestroy() {
super.onDestroy()
presenter.onDestroy()
}
override fun onPause() {
super.onPause()
presenter.onPause()
}
override fun onResume() {
super.onResume()
presenter.onResume()
}
override fun onStop() {
super.onStop()
presenter.onStop()
}
override fun onBackPressed() {
if (!presenter.onBackPressed()) {
super.onBackPressed()
}
}
}