Java Code Examples for org.chromium.chrome.browser.tab.Tab#INVALID_BOOKMARK_ID
The following examples show how to use
org.chromium.chrome.browser.tab.Tab#INVALID_BOOKMARK_ID .
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: AppMenuPropertiesDelegate.java From delion with Apache License 2.0 | 5 votes |
/** * Updates the bookmark item's visibility. * * @param bookmarkMenuItem {@link MenuItem} for adding/editing the bookmark. * @param currentTab Current tab being displayed. */ protected void updateBookmarkMenuItem(MenuItem bookmarkMenuItem, Tab currentTab) { bookmarkMenuItem.setEnabled(mBookmarkBridge.isEditBookmarksEnabled()); if (currentTab.getBookmarkId() != Tab.INVALID_BOOKMARK_ID) { bookmarkMenuItem.setIcon(R.drawable.btn_star_filled); bookmarkMenuItem.setChecked(true); bookmarkMenuItem.setTitleCondensed(mActivity.getString(R.string.edit_bookmark)); } else { bookmarkMenuItem.setIcon(R.drawable.btn_star); bookmarkMenuItem.setChecked(false); bookmarkMenuItem.setTitleCondensed(null); } }
Example 2
Source File: ToolbarManager.java From delion with Apache License 2.0 | 5 votes |
private void updateBookmarkButtonStatus() { Tab currentTab = mToolbarModel.getTab(); boolean isBookmarked = currentTab != null && currentTab.getBookmarkId() != Tab.INVALID_BOOKMARK_ID; boolean editingAllowed = currentTab == null || mBookmarkBridge == null || mBookmarkBridge.isEditBookmarksEnabled(); mToolbar.updateBookmarkButton(isBookmarked, editingAllowed); }
Example 3
Source File: AppMenuPropertiesDelegate.java From AndroidChromium with Apache License 2.0 | 5 votes |
/** * Updates the bookmark item's visibility. * * @param bookmarkMenuItem {@link MenuItem} for adding/editing the bookmark. * @param currentTab Current tab being displayed. */ protected void updateBookmarkMenuItem(MenuItem bookmarkMenuItem, Tab currentTab) { bookmarkMenuItem.setEnabled(mBookmarkBridge.isEditBookmarksEnabled()); if (currentTab.getBookmarkId() != Tab.INVALID_BOOKMARK_ID) { bookmarkMenuItem.setIcon(R.drawable.btn_star_filled); bookmarkMenuItem.setChecked(true); bookmarkMenuItem.setTitleCondensed(mActivity.getString(R.string.edit_bookmark)); } else { bookmarkMenuItem.setIcon(R.drawable.btn_star); bookmarkMenuItem.setChecked(false); bookmarkMenuItem.setTitleCondensed(null); } }
Example 4
Source File: ToolbarManager.java From AndroidChromium with Apache License 2.0 | 5 votes |
private void updateBookmarkButtonStatus() { Tab currentTab = mToolbarModel.getTab(); boolean isBookmarked = currentTab != null && currentTab.getBookmarkId() != Tab.INVALID_BOOKMARK_ID; boolean editingAllowed = currentTab == null || mBookmarkBridge == null || mBookmarkBridge.isEditBookmarksEnabled(); mToolbar.updateBookmarkButton(isBookmarked, editingAllowed); }
Example 5
Source File: AppMenuIconRowFooter.java From 365browser with Apache License 2.0 | 5 votes |
private void updateBookmarkMenuItem(BookmarkBridge bookmarkBridge, Tab currentTab) { mBookmarkButton.setEnabled(bookmarkBridge.isEditBookmarksEnabled()); if (currentTab.getBookmarkId() != Tab.INVALID_BOOKMARK_ID) { mBookmarkButton.setImageResource(R.drawable.btn_star_filled); mBookmarkButton.setContentDescription(mActivity.getString(R.string.edit_bookmark)); mBookmarkButton.setTint(ApiCompatibilityUtils.getColorStateList( getResources(), R.color.blue_mode_tint)); } else { mBookmarkButton.setImageResource(R.drawable.btn_star); mBookmarkButton.setContentDescription( mActivity.getString(R.string.accessibility_menu_bookmark)); } }
Example 6
Source File: AppMenuPropertiesDelegate.java From 365browser with Apache License 2.0 | 5 votes |
/** * Updates the bookmark item's visibility. * * @param bookmarkMenuItem {@link MenuItem} for adding/editing the bookmark. * @param currentTab Current tab being displayed. */ protected void updateBookmarkMenuItem(MenuItem bookmarkMenuItem, Tab currentTab) { bookmarkMenuItem.setEnabled(mBookmarkBridge.isEditBookmarksEnabled()); if (currentTab.getBookmarkId() != Tab.INVALID_BOOKMARK_ID) { bookmarkMenuItem.setIcon(R.drawable.btn_star_filled); bookmarkMenuItem.setChecked(true); bookmarkMenuItem.setTitleCondensed(mActivity.getString(R.string.edit_bookmark)); } else { bookmarkMenuItem.setIcon(R.drawable.btn_star); bookmarkMenuItem.setChecked(false); bookmarkMenuItem.setTitleCondensed(null); } }
Example 7
Source File: ToolbarManager.java From 365browser with Apache License 2.0 | 5 votes |
private void updateBookmarkButtonStatus() { Tab currentTab = mToolbarModel.getTab(); boolean isBookmarked = currentTab != null && currentTab.getBookmarkId() != Tab.INVALID_BOOKMARK_ID; boolean editingAllowed = currentTab == null || mBookmarkBridge == null || mBookmarkBridge.isEditBookmarksEnabled(); mToolbar.updateBookmarkButton(isBookmarked, editingAllowed); }