Search in sources :

Example 6 with BookmarkItem

use of org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem in project AndroidChromium by JackyAndroid.

the class BookmarkItemRow method setBookmarkId.

@Override
BookmarkItem setBookmarkId(BookmarkId bookmarkId) {
    BookmarkItem item = super.setBookmarkId(bookmarkId);
    mUrl = item.getUrl();
    mIconImageView.setImageDrawable(null);
    mTitleView.setText(item.getTitle());
    mDelegate.getLargeIconBridge().getLargeIconForUrl(mUrl, mMinIconSize, this);
    return item;
}
Also used : BookmarkItem(org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem)

Example 7 with BookmarkItem

use of org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem in project AndroidChromium by JackyAndroid.

the class BookmarkRow method setBookmarkId.

/**
     * Updates this row for the given {@link BookmarkId}.
     * @return The {@link BookmarkItem} corresponding the given {@link BookmarkId}.
     */
BookmarkItem setBookmarkId(BookmarkId bookmarkId) {
    mBookmarkId = bookmarkId;
    BookmarkItem bookmarkItem = mDelegate.getModel().getBookmarkById(bookmarkId);
    clearPopup();
    if (isSelectable()) {
        mMoreIcon.setVisibility(bookmarkItem.isEditable() ? VISIBLE : GONE);
        setChecked(mDelegate.getSelectionDelegate().isItemSelected(bookmarkId));
    }
    super.setItem(bookmarkId);
    return bookmarkItem;
}
Also used : BookmarkItem(org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem)

Example 8 with BookmarkItem

use of org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem in project AndroidChromium by JackyAndroid.

the class BookmarkEditActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mModel = new BookmarkModel();
    mBookmarkId = BookmarkId.getBookmarkIdFromString(getIntent().getStringExtra(INTENT_BOOKMARK_ID));
    mModel.addObserver(mBookmarkModelObserver);
    BookmarkItem item = mModel.getBookmarkById(mBookmarkId);
    if (!mModel.doesBookmarkExist(mBookmarkId) || item == null) {
        finish();
        return;
    }
    setContentView(R.layout.bookmark_edit);
    mTitleEditText = (EmptyAlertEditText) findViewById(R.id.title_text);
    mFolderTextView = (TextView) findViewById(R.id.folder_text);
    mUrlEditText = (EmptyAlertEditText) findViewById(R.id.url_text);
    mFolderTextView.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            BookmarkFolderSelectActivity.startFolderSelectActivity(BookmarkEditActivity.this, mBookmarkId);
        }
    });
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    updateViewContent(false);
}
Also used : BookmarkItem(org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem) TextView(android.widget.TextView) View(android.view.View) Toolbar(android.support.v7.widget.Toolbar)

Example 9 with BookmarkItem

use of org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem in project AndroidChromium by JackyAndroid.

the class BookmarkFolderRow method setBookmarkId.

@Override
BookmarkItem setBookmarkId(BookmarkId bookmarkId) {
    BookmarkItem item = super.setBookmarkId(bookmarkId);
    mTitleView.setText(item.getTitle());
    return item;
}
Also used : BookmarkItem(org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem)

Aggregations

BookmarkItem (org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem)9 Toolbar (android.support.v7.widget.Toolbar)2 View (android.view.View)2 TextView (android.widget.TextView)2 BookmarkId (org.chromium.components.bookmarks.BookmarkId)2 ViewGroup (android.view.ViewGroup)1 AdapterView (android.widget.AdapterView)1 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)1 ImageView (android.widget.ImageView)1 ListPopupWindow (android.widget.ListPopupWindow)1 List (java.util.List)1 TabDelegate (org.chromium.chrome.browser.tabmodel.document.TabDelegate)1 SelectableItemView (org.chromium.chrome.browser.widget.selection.SelectableItemView)1