Skip to content

Commit

Permalink
Merge pull request #68 from Wolox/view-binding-nullability-fix
Browse files Browse the repository at this point in the history
Changes in nullabilities
  • Loading branch information
lmiotti authored Jan 11, 2021
2 parents f47bb5b + ffb82db commit f754318
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ abstract class WolmoActivity<V : ViewDataBinding> : DaggerAppCompatActivity() {
@Inject
lateinit var permissionManager: PermissionManager

var binding: V? = null
private var _binding: V? = null

val binding: V
get() = _binding!!

/**
* Handles the custom lifecycle of Wolmo's Activity. It provides a set of callbacks to structure
Expand All @@ -55,7 +58,7 @@ abstract class WolmoActivity<V : ViewDataBinding> : DaggerAppCompatActivity() {
@CallSuper
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = DataBindingUtil.setContentView(this, layout())
_binding = DataBindingUtil.setContentView(this, layout())
if (handleArguments(intent.extras) == true) {
init()
populate()
Expand All @@ -68,7 +71,7 @@ abstract class WolmoActivity<V : ViewDataBinding> : DaggerAppCompatActivity() {

override fun onDestroy() {
super.onDestroy()
binding = null
_binding = null
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ abstract class WolmoFragment<V : ViewDataBinding, P : BasePresenter<*>> : Dagger
val presenter: P
get() = fragmentHandler.presenter

val binding: V?
val binding: V
get() = fragmentHandler.binding

@CallSuper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public T getPresenter() {
return mPresenter;
}

@Nullable
@NonNull
public V getBinding() {
return mBinding;
}
Expand Down

0 comments on commit f754318

Please sign in to comment.