leosan
09/21/2018, 9:15 AMinline fun <reified T : ViewDataBinding> FragmentActivity.contentView(@LayoutRes layoutRes: Int) = lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
DataBindingUtil.setContentView<T>(this, layoutRes)
}
kingsley
09/22/2018, 10:48 AMLazyThreadSafetyMode.NONE
, since this will always run on the UI thread anyway
Using SYNCHRONIZED
might be a little less performant due to extra (unnecessary) concurrency synchronization mechanism