Java Code Examples for androidx.appcompat.view.ActionMode#setTitle()

The following examples show how to use androidx.appcompat.view.ActionMode#setTitle() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConversationFragment.java    From mollyim-android with GNU General Public License v3.0 7 votes vote down vote up
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
  MenuInflater inflater = mode.getMenuInflater();
  inflater.inflate(R.menu.conversation_context, menu);

  mode.setTitle("1");

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    Window window = getActivity().getWindow();
    statusBarColor = window.getStatusBarColor();
    window.setStatusBarColor(getResources().getColor(R.color.action_mode_status_bar));
  }

  setCorrectMenuVisibility(menu);
  AdaptiveActionsToolbar.adjustMenuActions(menu, 10, requireActivity().getWindow().getDecorView().getMeasuredWidth());
  listener.onMessageActionToolbarOpened();
  return true;
}
 
Example 2
Source File: ConversationListFragment.java    From mollyim-android with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
  MenuInflater inflater = getActivity().getMenuInflater();

  inflater.inflate(getActionModeMenuRes(), menu);
  inflater.inflate(R.menu.conversation_list_batch, menu);

  mode.setTitle("1");

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    getActivity().getWindow().setStatusBarColor(getResources().getColor(R.color.action_mode_status_bar));
  }

  if (Build.VERSION.SDK_INT >= 23) {
    int current = getActivity().getWindow().getDecorView().getSystemUiVisibility();
    getActivity().getWindow().getDecorView().setSystemUiVisibility(current & ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
  }

  return true;
}
 
Example 3
Source File: ConversationFragment.java    From deltachat-android with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
    MenuInflater inflater = mode.getMenuInflater();
    inflater.inflate(R.menu.conversation_context, menu);

    mode.setTitle("1");

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        Window window = getActivity().getWindow();
        statusBarColor = window.getStatusBarColor();
        window.setStatusBarColor(getResources().getColor(R.color.action_mode_status_bar));
    }

    setCorrectMenuVisibility(menu);
    return true;
}
 
Example 4
Source File: MediaOverviewPageFragment.java    From mollyim-android with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
  mode.getMenuInflater().inflate(R.menu.media_overview_context, menu);
  mode.setTitle(getActionModeTitle());

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    Window window = requireActivity().getWindow();
    originalStatusBarColor = window.getStatusBarColor();
    window.setStatusBarColor(getResources().getColor(R.color.action_mode_status_bar));
  }
  return true;
}
 
Example 5
Source File: ProfileSettingsFragment.java    From deltachat-android with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
  mode.getMenuInflater().inflate(R.menu.profile_context, menu);
  mode.setTitle("1");

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    Window window = getActivity().getWindow();
    originalStatusBarColor = window.getStatusBarColor();
    window.setStatusBarColor(getResources().getColor(R.color.action_mode_status_bar));
  }
  return true;
}
 
Example 6
Source File: ProfileGalleryFragment.java    From deltachat-android with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
  mode.getMenuInflater().inflate(R.menu.profile_context, menu);
  mode.setTitle("1");

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    Window window = getActivity().getWindow();
    originalStatusBarColor = window.getStatusBarColor();
    window.setStatusBarColor(getResources().getColor(R.color.action_mode_status_bar));
  }
  return true;
}
 
Example 7
Source File: ConversationListFragment.java    From deltachat-android with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
  if (isRelayingMessageContent(getActivity())) {
    Context context = getContext();
    if (context != null) {
      fab.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.ic_send_sms_white_24dp));
    }
    initializeFabClickListener(true);
  } else {

    MenuInflater inflater = getActivity().getMenuInflater();

    inflater.inflate(R.menu.conversation_list_batch_pin, menu);

    if (archive) inflater.inflate(R.menu.conversation_list_batch_unarchive, menu);
    else inflater.inflate(R.menu.conversation_list_batch_archive, menu);

    inflater.inflate(R.menu.conversation_list, menu);
  }

  mode.setTitle("1");

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    getActivity().getWindow().setStatusBarColor(getResources().getColor(R.color.action_mode_status_bar));
  }

  return true;
}
 
Example 8
Source File: CourseOutlineFragment.java    From edx-app-android with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
    // Inflate a menu resource providing context menu items
    final MenuInflater inflater = mode.getMenuInflater();
    inflater.inflate(R.menu.delete_contextual_menu, menu);
    menu.findItem(R.id.item_delete).setIcon(
            new IconDrawable(getContext(), FontAwesomeIcons.fa_trash_o)
                    .colorRes(getContext(), R.color.white)
                    .actionBarSize(getContext())
    );
    mode.setTitle(R.string.delete_videos_title);
    return true;
}
 
Example 9
Source File: ProfileDocumentsFragment.java    From deltachat-android with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
  mode.getMenuInflater().inflate(R.menu.profile_context, menu);
  mode.setTitle("1");

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    Window window = getActivity().getWindow();
    originalStatusBarColor = window.getStatusBarColor();
    window.setStatusBarColor(getResources().getColor(R.color.action_mode_status_bar));
  }
  return true;
}