Deal with null and better naming
This commit is contained in:
parent
57631eb18e
commit
ddbaff13dc
1 changed files with 10 additions and 4 deletions
|
@ -15,13 +15,19 @@ class TouchImageActivity : AppCompatActivity() {
|
|||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
val webView = TouchImageView(this)
|
||||
val touchImageView = TouchImageView(this)
|
||||
|
||||
setContentView(webView)
|
||||
setContentView(touchImageView)
|
||||
|
||||
webView.setImageBitmap(passStore.currentPass!!.getBitmap(passStore, intent.getStringExtra("IMAGE")))
|
||||
val bitmap = passStore.currentPass?.getBitmap(passStore, intent.getStringExtra("IMAGE"))
|
||||
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
if (bitmap == null) {
|
||||
finish()
|
||||
} else {
|
||||
touchImageView.setImageBitmap(bitmap)
|
||||
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem) = when (item.itemId) {
|
||||
|
|
Loading…
Reference in a new issue