blob: 5d6a1662d9c88535c9b9b2408168269b96cbd775 [file] [log] [blame]
The Android Open Source Project0c908882009-03-03 19:32:16 -08001/*
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.android.browser;
18
19import android.content.Context;
20import android.view.LayoutInflater;
The Android Open Source Project0c908882009-03-03 19:32:16 -080021import android.widget.LinearLayout;
22import android.widget.TextView;
23
24/**
25 * Custom layout for an item representing a bookmark in the browser.
26 */
27 // FIXME: Remove BrowserBookmarkItem
28class AddNewBookmark extends LinearLayout {
29
The Android Open Source Project0c908882009-03-03 19:32:16 -080030 private TextView mUrlText;
The Android Open Source Project0c908882009-03-03 19:32:16 -080031
32 /**
33 * Instantiate a bookmark item, including a default favicon.
34 *
35 * @param context The application context for the item.
36 */
37 AddNewBookmark(Context context) {
38 super(context);
39
40 setWillNotDraw(false);
41 LayoutInflater factory = LayoutInflater.from(context);
42 factory.inflate(R.layout.add_new_bookmark, this);
The Android Open Source Project0c908882009-03-03 19:32:16 -080043 mUrlText = (TextView) findViewById(R.id.url);
The Android Open Source Project0c908882009-03-03 19:32:16 -080044 }
Leon Scroggins892df312009-07-14 14:48:02 -040045
The Android Open Source Project0c908882009-03-03 19:32:16 -080046 /**
47 * Set the new url for the bookmark item.
48 * @param url The new url for the bookmark item.
49 */
50 /* package */ void setUrl(String url) {
51 mUrlText.setText(url);
52 }
53}