org.chromium.components.bookmarks.BookmarkType Java Examples

The following examples show how to use org.chromium.components.bookmarks.BookmarkType. 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: BookmarkActionBar.java    From delion with Apache License 2.0 4 votes vote down vote up
@Override
public void onSelectionStateChange(List<BookmarkId> selectedBookmarks) {
    boolean wasSelectionEnabled = mIsSelectionEnabled;
    mIsSelectionEnabled = mDelegate.isSelectionEnabled();
    NumberRollView numberRollView = (NumberRollView) findViewById(R.id.selection_mode_number);
    if (mIsSelectionEnabled) {
        setOverflowIcon(TintedDrawable.constructTintedDrawable(getResources(),
                R.drawable.btn_menu, android.R.color.white));
        setNavigationButton(NAVIGATION_BUTTON_SELECTION_BACK);
        setTitle(null);

        getMenu().setGroupVisible(R.id.normal_menu_group, false);
        getMenu().setGroupVisible(R.id.selection_mode_menu_group, true);
        // Editing a bookmark action on multiple selected items doesn't make sense. So disable.
        getMenu().findItem(R.id.selection_mode_edit_menu_id).setVisible(
                selectedBookmarks.size() == 1);
        getMenu().findItem(R.id.selection_open_in_incognito_tab_id)
                .setVisible(PrefServiceBridge.getInstance().isIncognitoModeEnabled());
        // Partner bookmarks can't move, so if the selection includes a partner bookmark,
        // disable the move button.
        for (BookmarkId bookmark : selectedBookmarks) {
            if (bookmark.getType() == BookmarkType.PARTNER) {
                getMenu().findItem(R.id.selection_mode_move_menu_id).setVisible(false);
                break;
            }
        }
        setBackgroundColor(
                ApiCompatibilityUtils.getColor(getResources(), R.color.light_active_color));

        numberRollView.setVisibility(View.VISIBLE);
        if (!wasSelectionEnabled) numberRollView.setNumber(0, false);
        numberRollView.setNumber(selectedBookmarks.size(), true);
    } else {
        setOverflowIcon(TintedDrawable.constructTintedDrawable(getResources(),
                R.drawable.btn_menu));
        getMenu().setGroupVisible(R.id.normal_menu_group, true);
        getMenu().setGroupVisible(R.id.selection_mode_menu_group, false);
        setBackgroundColor(ApiCompatibilityUtils.getColor(getResources(),
                R.color.appbar_background));

        numberRollView.setVisibility(View.GONE);
        numberRollView.setNumber(0, false);

        mDelegate.notifyStateChange(this);
    }
}
 
Example #2
Source File: BookmarkBridge.java    From delion with Apache License 2.0 4 votes vote down vote up
/**@return Whether this bookmark's URL can be edited */
public boolean isUrlEditable() {
    return isEditable() && mId.getType() == BookmarkType.NORMAL;
}
 
Example #3
Source File: BookmarkBridge.java    From delion with Apache License 2.0 4 votes vote down vote up
/**@return Whether this bookmark can be moved */
public boolean isMovable() {
    return isEditable() && mId.getType() == BookmarkType.NORMAL;
}
 
Example #4
Source File: BookmarkBridge.java    From AndroidChromium with Apache License 2.0 4 votes vote down vote up
/**@return Whether this bookmark's URL can be edited */
public boolean isUrlEditable() {
    return isEditable() && mId.getType() == BookmarkType.NORMAL;
}
 
Example #5
Source File: BookmarkBridge.java    From AndroidChromium with Apache License 2.0 4 votes vote down vote up
/**@return Whether this bookmark can be moved */
public boolean isMovable() {
    return isEditable() && mId.getType() == BookmarkType.NORMAL;
}
 
Example #6
Source File: BookmarkBridge.java    From 365browser with Apache License 2.0 4 votes vote down vote up
/**@return Whether this bookmark's URL can be edited */
public boolean isUrlEditable() {
    return isEditable() && mId.getType() == BookmarkType.NORMAL;
}
 
Example #7
Source File: BookmarkBridge.java    From 365browser with Apache License 2.0 4 votes vote down vote up
/**@return Whether this bookmark can be moved */
public boolean isMovable() {
    return isEditable() && mId.getType() == BookmarkType.NORMAL;
}