Skip to content

Commit

Permalink
nickbutcher#722 - remove SystemChromeFader from Dagger in Dribbble Sh…
Browse files Browse the repository at this point in the history
…otActivity
  • Loading branch information
limdale authored and florina-muntenescu committed Jul 3, 2019
1 parent 885a002 commit e88d43a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import dagger.Module
import dagger.Provides
import io.plaidapp.core.data.CoroutinesDispatcherProvider
import io.plaidapp.core.dribbble.data.ShotsRepository
import io.plaidapp.core.ui.widget.ElasticDragDismissFrameLayout
import io.plaidapp.core.util.FileAuthority
import io.plaidapp.core.util.HtmlParser
import io.plaidapp.dribbble.BuildConfig
Expand All @@ -46,15 +45,6 @@ class DribbbleModule(private val activity: ShotActivity, private val shotId: Lon
return ViewModelProviders.of(activity, factory).get(ShotViewModel::class.java)
}

@Provides
fun chromeFader(): ElasticDragDismissFrameLayout.SystemChromeFader {
return object : ElasticDragDismissFrameLayout.SystemChromeFader(activity) {
override fun onDragDismissed() {
activity.setResultAndFinish()
}
}
}

@Provides
fun htmlParser() = HtmlParser()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ShotActivity : AppCompatActivity() {

@Inject
internal lateinit var viewModel: ShotViewModel
@Inject

internal lateinit var chromeFader: ElasticDragDismissFrameLayout.SystemChromeFader

private val binding by contentView<ShotActivity, ActivityDribbbleShotBinding>(
Expand Down Expand Up @@ -133,6 +133,12 @@ class ShotActivity : AppCompatActivity() {
}
back.setOnClickListener { setResultAndFinish() }
}

chromeFader = object : ElasticDragDismissFrameLayout.SystemChromeFader(this) {
override fun onDragDismissed() {
setResultAndFinish()
}
}
}

override fun onResume() {
Expand Down

0 comments on commit e88d43a

Please sign in to comment.