为回答详情添加评论(增加部分UI

This commit is contained in:
chenjuntao
2018-03-22 18:32:09 +08:00
parent 5d0ccb9a34
commit de08d4d32d
24 changed files with 1173 additions and 311 deletions

View File

@ -71,6 +71,13 @@ public abstract class BaseFragment<T> extends Fragment implements OnRequestCallB
@LayoutRes
protected abstract int getLayoutId();
/**
* 提供 Inflated 的 view ,可用于 data binding.
*/
protected View getInflatedLayout() {
return null;
}
/**
* 责任链谁处理了就返回true否则返回super.handleOnClick(View view)
*
@ -106,8 +113,15 @@ public abstract class BaseFragment<T> extends Fragment implements OnRequestCallB
isEverPause = false;
EventBus.getDefault().register(this);
mCachedView = View.inflate(getContext(), getLayoutId(), null);
// For data binding.
if (getInflatedLayout() != null) {
mCachedView = getInflatedLayout();
} else {
mCachedView = View.inflate(getContext(), getLayoutId(), null);
}
ButterKnife.bind(this, mCachedView);
initView(mCachedView);
}