Menu全部初始化放在onActivityCreated,页面间距修改
This commit is contained in:
@ -266,7 +266,6 @@ public class NewsDetailActivity extends BaseActivity implements OnClickListener,
|
||||
mDetailRv.setAdapter(adapter);
|
||||
|
||||
newsId = getIntent().getStringExtra(EntranceUtils.KEY_NEWSID);
|
||||
Utils.log("==========IDIDID::" + newsId);
|
||||
mIsCollectionNews = getIntent().getBooleanExtra(KEY_COLLECTIONNEWS, false);
|
||||
|
||||
if (newsId == null) {
|
||||
|
||||
@ -144,7 +144,6 @@ public class AnswerDetailFragment extends NormalFragment {
|
||||
mViewModel.getAnswerDetail(mAnswerId, mEntrance);
|
||||
}
|
||||
|
||||
initMenu(R.menu.menu_answer);
|
||||
mRichEditor.setInputEnabled(false);
|
||||
}
|
||||
|
||||
@ -159,6 +158,7 @@ public class AnswerDetailFragment extends NormalFragment {
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
setNavigationTitle(getString(R.string.answer_detail_title));
|
||||
initMenu(R.menu.menu_answer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -44,34 +44,25 @@ public class KaiFuWrapperFragment extends NormalFragment {
|
||||
@Override
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
createMenu();
|
||||
setNavigationTitle(R.string.title_kaifu);
|
||||
initMenu(R.menu.menu_button);
|
||||
mResetMenuItem = getItemMenu(R.id.menu_button);
|
||||
mResetMenuItem.setTitle(R.string.menu_text_reset);
|
||||
mResetMenuItem.setVisible(false);
|
||||
final TextView textView = mResetMenuItem.getActionView().findViewById(R.id.tv_menu_button);
|
||||
textView.setText(R.string.menu_text_reset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
if (mResetMenuItem == null) createMenu();
|
||||
mResetMenuItem.setTitle(R.string.menu_text_reset);
|
||||
mResetMenuItem.setVisible(false);
|
||||
final TextView textView = mResetMenuItem.getActionView().findViewById(R.id.tv_menu_button);
|
||||
textView.setText(R.string.menu_text_reset);
|
||||
|
||||
|
||||
FragmentTransaction fragmentTransaction = getChildFragmentManager().beginTransaction();
|
||||
mKaiFuFragment = new KaiFuFragment();
|
||||
fragmentTransaction.add(R.id.layout_fragment_content, mKaiFuFragment);
|
||||
fragmentTransaction.commit();
|
||||
}
|
||||
|
||||
private void createMenu() {
|
||||
if (mResetMenuItem != null) return;
|
||||
setNavigationTitle(R.string.title_kaifu);
|
||||
initMenu(R.menu.menu_button);
|
||||
mResetMenuItem = getItemMenu(R.id.menu_button);
|
||||
}
|
||||
|
||||
private void resetFragment() {
|
||||
if (mGameKaiFuFragment == null) return;
|
||||
mKaiFuFragment.setCurPage(mGameKaiFuFragment.getCurPage());
|
||||
|
||||
@ -274,9 +274,15 @@ public class MessageDetailFragment extends NormalFragment implements OnCommentCa
|
||||
});
|
||||
}
|
||||
|
||||
@OnClick(R.id.message_detail_comment_hint_rl)
|
||||
public void OnHintClikListener() {
|
||||
setSoftInput(true);
|
||||
@OnClick({R.id.message_detail_comment_hint_rl, R.id.reuse_no_connection})
|
||||
public void OnViewClick(View view) {
|
||||
if (view.getId() == R.id.message_detail_comment_hint_rl) {
|
||||
setSoftInput(true);
|
||||
} else if (view.getId() == R.id.reuse_no_connection) {
|
||||
if (newsId != null && mConcernEntity == null) {
|
||||
showNoConnection(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//软键盘控制
|
||||
|
||||
@ -325,7 +325,7 @@ public class PersonalFragment extends BaseFragment implements Observer<ApiRespon
|
||||
GameDetailActivity.startGameDetailActivity(getContext(), data.getLink(), entrance);
|
||||
break;
|
||||
case "news":
|
||||
NewsDetailActivity.getIntentById(getContext(), data.getLink(), entrance);
|
||||
startActivity(NewsDetailActivity.getIntentById(getContext(), data.getLink(), entrance));
|
||||
break;
|
||||
case "column":
|
||||
SubjectActivity.startSubjectActivity(getContext(), data.getLink(), null, false, entrance);
|
||||
|
||||
@ -44,12 +44,17 @@ public class UserInfoFragment extends NormalFragment {
|
||||
return R.layout.fragment_userinfo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
setNavigationTitle(getString(R.string.title_userinfo));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setNavigationTitle(getString(R.string.title_userinfo));
|
||||
|
||||
UserViewModel.Factory factory = new UserViewModel.Factory(getActivity().getApplication());
|
||||
UserViewModel userViewModel = ViewModelProviders.of(this, factory).get(UserViewModel.class);
|
||||
userViewModel.getLoginObsUserinfo().observe(this, new Observer<ApiResponse<UserInfoEntity>>() {
|
||||
|
||||
Reference in New Issue
Block a user