/WebVox/src/com/marvin/webvox/AddNewBookmark.java

http://eyes-free.googlecode.com/ · 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. package com.marvin.webvox;
  17. import com.marvin.webvox.R;
  18. import android.content.Context;
  19. import android.view.LayoutInflater;
  20. import android.widget.ImageView;
  21. import android.widget.LinearLayout;
  22. import android.widget.TextView;
  23. /**
  24. * Custom layout for an item representing a bookmark in the browser.
  25. */
  26. // FIXME: Remove BrowserBookmarkItem
  27. class AddNewBookmark extends LinearLayout {
  28. private TextView mTextView;
  29. private TextView mUrlText;
  30. private ImageView mImageView;
  31. /**
  32. * Instantiate a bookmark item, including a default favicon.
  33. *
  34. * @param context The application context for the item.
  35. */
  36. AddNewBookmark(Context context) {
  37. super(context);
  38. setWillNotDraw(false);
  39. LayoutInflater factory = LayoutInflater.from(context);
  40. factory.inflate(R.layout.add_new_bookmark, this);
  41. mTextView = (TextView) findViewById(R.id.title);
  42. mUrlText = (TextView) findViewById(R.id.url);
  43. mImageView = (ImageView) findViewById(R.id.favicon);
  44. }
  45. /**
  46. * Set the new url for the bookmark item.
  47. * @param url The new url for the bookmark item.
  48. */
  49. /* package */ void setUrl(String url) {
  50. mUrlText.setText(url);
  51. }
  52. }