/WebVox/src/com/marvin/webvox/AddNewBookmark.java
Java | 60 lines | 24 code | 8 blank | 28 comment | 0 complexity | 75eb781219b026538c47a5ab5458d27e MD5 | raw file
1/* 2 * Copyright (C) 2008 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package com.marvin.webvox; 18 19import com.marvin.webvox.R; 20 21import android.content.Context; 22import android.view.LayoutInflater; 23import android.widget.ImageView; 24import android.widget.LinearLayout; 25import android.widget.TextView; 26 27/** 28 * Custom layout for an item representing a bookmark in the browser. 29 */ 30 // FIXME: Remove BrowserBookmarkItem 31class AddNewBookmark extends LinearLayout { 32 33 private TextView mTextView; 34 private TextView mUrlText; 35 private ImageView mImageView; 36 37 /** 38 * Instantiate a bookmark item, including a default favicon. 39 * 40 * @param context The application context for the item. 41 */ 42 AddNewBookmark(Context context) { 43 super(context); 44 45 setWillNotDraw(false); 46 LayoutInflater factory = LayoutInflater.from(context); 47 factory.inflate(R.layout.add_new_bookmark, this); 48 mTextView = (TextView) findViewById(R.id.title); 49 mUrlText = (TextView) findViewById(R.id.url); 50 mImageView = (ImageView) findViewById(R.id.favicon); 51 } 52 53 /** 54 * Set the new url for the bookmark item. 55 * @param url The new url for the bookmark item. 56 */ 57 /* package */ void setUrl(String url) { 58 mUrlText.setText(url); 59 } 60}