Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ open class LayoutPreviewBaseActivity : AppCompatActivity() {

setContentView(layoutResourceId)

viewModel = ViewModelProvider(this, viewModelFactory)
.get(LayoutInfoViewModel::class.java)
viewModel = ViewModelProvider(this, viewModelFactory).get(LayoutInfoViewModel::class.java)
viewModel.init(layoutResourceId)

supportActionBar?.setDisplayHomeAsUpEnabled(true)
Expand All @@ -92,6 +91,12 @@ open class LayoutPreviewBaseActivity : AppCompatActivity() {
})
}

override fun onStop() {
super.onStop()
flashbar?.dismiss()
flashbar = null
}

private fun updateActionBar(layoutInformation: LayoutInformation) {
supportActionBar?.title = layoutInformation.title
}
Expand Down Expand Up @@ -144,7 +149,7 @@ open class LayoutPreviewBaseActivity : AppCompatActivity() {
builder.setShowTitle(false)
.addDefaultShareMenuItem()
val customTabsIntent = builder.build()
customTabsIntent.launchUrl(this, Uri.parse(viewModel.layoutUrl))
customTabsIntent.launchUrl(applicationContext, Uri.parse(viewModel.layoutUrl))
}


Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ ext {
daggerVersion = '2.15' // https://github.com/google/dagger
timberLibraryVersion = '4.7.1' // https://github.com/JakeWharton/timber
leakcanaryLibraryVersion = '1.6.3' // https://github.com/square/leakcanary/releases
flashBarVersion = '1.0.2' // https://github.com/aritraroy/Flashbar/releases
flashBarVersion = '1.0.3' // https://github.com/aritraroy/Flashbar/releases
}

//
Expand Down