diff --git a/core/src/main/java/ar/com/wolox/wolmo/core/activity/WolmoActivity.kt b/core/src/main/java/ar/com/wolox/wolmo/core/activity/WolmoActivity.kt index 9fde5be..7c103fe 100644 --- a/core/src/main/java/ar/com/wolox/wolmo/core/activity/WolmoActivity.kt +++ b/core/src/main/java/ar/com/wolox/wolmo/core/activity/WolmoActivity.kt @@ -46,7 +46,10 @@ abstract class WolmoActivity : 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 @@ -55,7 +58,7 @@ abstract class WolmoActivity : 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() @@ -68,7 +71,7 @@ abstract class WolmoActivity : DaggerAppCompatActivity() { override fun onDestroy() { super.onDestroy() - binding = null + _binding = null } /** diff --git a/core/src/main/java/ar/com/wolox/wolmo/core/fragment/WolmoFragment.kt b/core/src/main/java/ar/com/wolox/wolmo/core/fragment/WolmoFragment.kt index 1a4b7f3..d3d7639 100644 --- a/core/src/main/java/ar/com/wolox/wolmo/core/fragment/WolmoFragment.kt +++ b/core/src/main/java/ar/com/wolox/wolmo/core/fragment/WolmoFragment.kt @@ -52,7 +52,7 @@ abstract class WolmoFragment> : Dagger val presenter: P get() = fragmentHandler.presenter - val binding: V? + val binding: V get() = fragmentHandler.binding @CallSuper diff --git a/core/src/main/java/ar/com/wolox/wolmo/core/fragment/WolmoFragmentHandler.java b/core/src/main/java/ar/com/wolox/wolmo/core/fragment/WolmoFragmentHandler.java index ccf29ee..dbaa4f0 100644 --- a/core/src/main/java/ar/com/wolox/wolmo/core/fragment/WolmoFragmentHandler.java +++ b/core/src/main/java/ar/com/wolox/wolmo/core/fragment/WolmoFragmentHandler.java @@ -136,7 +136,7 @@ public T getPresenter() { return mPresenter; } - @Nullable + @NonNull public V getBinding() { return mBinding; }