blob: 5decb6551a86eb0c4964cc1015ff7ed95e8c2d17 [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
Bijan Amirzada41242f22014-03-21 12:12:18 -070017package com.android.browser;
The Android Open Source Project0c908882009-03-03 19:32:16 -080018
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
Bijan Amirzada41242f22014-03-21 12:12:18 -070024import com.android.browser.R;
Bijan Amirzada9b1e9882014-02-26 17:15:46 -080025
The Android Open Source Project0c908882009-03-03 19:32:16 -080026/**
27 * Custom layout for an item representing a bookmark in the browser.
28 */
29 // FIXME: Remove BrowserBookmarkItem
30class AddNewBookmark extends LinearLayout {
31
The Android Open Source Project0c908882009-03-03 19:32:16 -080032 private TextView mUrlText;
The Android Open Source Project0c908882009-03-03 19:32:16 -080033
34 /**
35 * Instantiate a bookmark item, including a default favicon.
36 *
37 * @param context The application context for the item.
38 */
39 AddNewBookmark(Context context) {
40 super(context);
41
42 setWillNotDraw(false);
43 LayoutInflater factory = LayoutInflater.from(context);
44 factory.inflate(R.layout.add_new_bookmark, this);
The Android Open Source Project0c908882009-03-03 19:32:16 -080045 mUrlText = (TextView) findViewById(R.id.url);
The Android Open Source Project0c908882009-03-03 19:32:16 -080046 }
Leon Scroggins892df312009-07-14 14:48:02 -040047
The Android Open Source Project0c908882009-03-03 19:32:16 -080048 /**
49 * Set the new url for the bookmark item.
50 * @param url The new url for the bookmark item.
51 */
52 /* package */ void setUrl(String url) {
53 mUrlText.setText(url);
54 }
55}