This repository was archived by the owner on Aug 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
app/src/main/java/com/hossainkhan/android/demo/layoutpreview Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -78,8 +78,7 @@ open class LayoutPreviewBaseActivity : AppCompatActivity() {
7878
7979 setContentView(layoutResourceId)
8080
81- viewModel = ViewModelProvider (this , viewModelFactory)
82- .get(LayoutInfoViewModel ::class .java)
81+ viewModel = ViewModelProvider (this , viewModelFactory).get(LayoutInfoViewModel ::class .java)
8382 viewModel.init (layoutResourceId)
8483
8584 supportActionBar?.setDisplayHomeAsUpEnabled(true )
@@ -92,6 +91,12 @@ open class LayoutPreviewBaseActivity : AppCompatActivity() {
9291 })
9392 }
9493
94+ override fun onStop () {
95+ super .onStop()
96+ flashbar?.dismiss()
97+ flashbar = null
98+ }
99+
95100 private fun updateActionBar (layoutInformation : LayoutInformation ) {
96101 supportActionBar?.title = layoutInformation.title
97102 }
@@ -144,7 +149,7 @@ open class LayoutPreviewBaseActivity : AppCompatActivity() {
144149 builder.setShowTitle(false )
145150 .addDefaultShareMenuItem()
146151 val customTabsIntent = builder.build()
147- customTabsIntent.launchUrl(this , Uri .parse(viewModel.layoutUrl))
152+ customTabsIntent.launchUrl(applicationContext , Uri .parse(viewModel.layoutUrl))
148153 }
149154
150155
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ ext {
107107 daggerVersion = ' 2.15' // https://github.com/google/dagger
108108 timberLibraryVersion = ' 4.7.1' // https://github.com/JakeWharton/timber
109109 leakcanaryLibraryVersion = ' 1.6.3' // https://github.com/square/leakcanary/releases
110- flashBarVersion = ' 1.0.2 ' // https://github.com/aritraroy/Flashbar/releases
110+ flashBarVersion = ' 1.0.3 ' // https://github.com/aritraroy/Flashbar/releases
111111}
112112
113113//
You can’t perform that action at this time.
0 commit comments