Skip to content

Commit

Permalink
Added support to enable/disable background blur in BaseCardFragment
Browse files Browse the repository at this point in the history
  • Loading branch information
Prem Suman committed Dec 27, 2018
1 parent 9f71db8 commit 4b61649
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,23 @@ import org.jetbrains.anko.support.v4.find

abstract class BaseCardFragment : BaseFragment(), CardContainer {

protected var isBlurEnabled = true
var isInForeGround: Boolean = false

@CallSuper
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
view.isClickable = true
getRootView()?.run {
setMargin(top = context.getDp(if (parentActivity().index > 0) 20f else 0f).toInt())
isClickable = true
}
activity?.let { setupSwipeDownGesture(it) }
(getBackgroundBlurLayout() as? BlurLayout)?.beginBlur()
if (isBlurEnabled) {
getBackgroundBlurLayout()?.isClickable = true
(getBackgroundBlurLayout() as? BlurLayout)?.beginBlur()
} else {
getBackgroundBlurLayout()?.makeGone()
}
isInForeGround = true
}

Expand Down

0 comments on commit 4b61649

Please sign in to comment.