FileDocCategorySizeDatePackage
BookmarkItem.javaAPI DocAndroid 1.5 API3318Wed May 06 22:42:42 BST 2009com.android.browser

BookmarkItem

public class BookmarkItem extends android.widget.LinearLayout
Custom layout for an item representing a bookmark in the browser.

Fields Summary
protected android.widget.TextView
mTextView
protected android.widget.TextView
mUrlText
protected android.widget.ImageView
mImageView
protected String
mUrl
Constructors Summary
BookmarkItem(android.content.Context context)
Instantiate a bookmark item, including a default favicon.

param
context The application context for the item.

        super(context);

        LayoutInflater factory = LayoutInflater.from(context);
        factory.inflate(R.layout.history_item, this);
        mTextView = (TextView) findViewById(R.id.title);
        mUrlText = (TextView) findViewById(R.id.url);
        mImageView = (ImageView) findViewById(R.id.favicon);
        View star = findViewById(R.id.star);
        star.setVisibility(View.GONE);
    
Methods Summary
voidcopyTo(com.android.browser.BookmarkItem item)
Copy this BookmarkItem to item.

param
item BookmarkItem to receive the info from this BookmarkItem.

        item.mTextView.setText(mTextView.getText());
        item.mUrlText.setText(mUrlText.getText());
        item.mImageView.setImageDrawable(mImageView.getDrawable());
    
java.lang.StringgetName()
Return the name assigned to this bookmark item.

        return mTextView.getText().toString();
    
android.widget.TextViewgetNameTextView()
Return the TextView which holds the name of this bookmark item.

        return mTextView;
    
java.lang.StringgetUrl()

        return mUrl;
    
voidsetFavicon(android.graphics.Bitmap b)
Set the favicon for this item.

param
b The new bitmap for this item. If it is null, will use the default.

        if (b != null) {
            mImageView.setImageBitmap(b);
        } else {
            mImageView.setImageResource(R.drawable.app_web_browser_sm);
        }
    
voidsetName(java.lang.String name)
Set the new name for the bookmark item.

param
name The new name for the bookmark item.

        mTextView.setText(name);
    
voidsetUrl(java.lang.String url)
Set the new url for the bookmark item.

param
url The new url for the bookmark item.

        mUrlText.setText(url);
        mUrl = url;