@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); mType = getArguments().getInt(DIALOG_TYPE_KEY); mCurrentTags = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); mCurrentTags.addAll(getArguments().getStringArrayList(CHECKED_TAGS_KEY)); mAllTags = new ArrayList<>(); mAllTags.addAll(getArguments().getStringArrayList(ALL_TAGS_KEY)); for (String tag : mCurrentTags) { if (!mAllTags.contains(tag)) { mAllTags.add(tag); } } setCancelable(true); }
private void setupSystemUI() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { getActivity().getWindow().setStatusBarColor(getResources().getColor(R.color.teal_200)); } else { getActivity().getWindow().setStatusBarColor(getResources().getColor(R.color.white, null)); getActivity().getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); } }
public Window getWindow() { if (activity != null) { return activity.getWindow(); } else { if (fragment instanceof DialogFragment) { return ((DialogFragment) fragment).getDialog().getWindow(); } return fragment.getActivity().getWindow(); } } }
private void setupSystemUI() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { getActivity().getWindow().setStatusBarColor(getResources().getColor(R.color.teal_200)); } else { getActivity().getWindow().setStatusBarColor(getResources().getColor(R.color.white, null)); getActivity().getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); } SystemUIUtils.hideKeyBoard(getActivity()); }
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.menu_edit_options: openOptionsMenu(); //noinspection ConstantConditions AndroidHelper.hideSoftKeyboard(getContext(), getActivity().getWindow()); break; } return false; }
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.menu_diff_options: openOptionsMenu(); //noinspection ConstantConditions AndroidHelper.hideSoftKeyboard(getContext(), getActivity().getWindow()); break; } return false; }
@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); setHasOptionsMenu(true); mScrollableHelper = new KeyDelegate.NestedScrollViewHelper(mScrollView); mSystemUiHelper = new AppUtils.SystemUiHelper(getActivity().getWindow()); mSystemUiHelper.setEnabled(!getResources().getBoolean(R.bool.multi_pane)); if (mFullscreen) { setFullscreen(true); } }
@Override public void onNext(Pair<ReviewInput, ReviewInfo> review) { setProcessing(false); mReviewLoader.clear(); // CleanUp attachment list ArrayList<Attachment> attachments = new ArrayList<>(mAttachments); mAttachments.clear(); mBinding.reviewInfo.setAttachmentsSupport(mAttachmentsSupport); // Clean the message box mBinding.reviewInfo.reviewComment.setText(null); //noinspection ConstantConditions AndroidHelper.hideSoftKeyboard(getContext(), getActivity().getWindow()); // Update the messages (since it was update at server side, we can temporary // update the message list until a full refresh happens) ModelHelper.updateChangeMessageInfo(mAccount, mResponse.mChange, review.first); mMessageAdapter.update(mModel.msgListModel, mResponse.mChange, mResponse.mMessagesWithComments, null); // Fetch the whole change forceRefresh(); // Upload the content of the attachments (skip url shortcuts) if (!attachments.isEmpty()) { AttachmentsContentUploadService.enqueueWork(getActivity(), attachments); } }