Beispiel #1
0
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
      final View view =
          (convertView != null)
              ? convertView
              : LayoutInflater.from(parent.getContext())
                  .inflate(R.layout.bookmark_item, parent, false);
      final ImageView imageView = ViewUtil.findImageView(view, R.id.bookmark_item_icon);
      final TextView textView = ViewUtil.findTextView(view, R.id.bookmark_item_text);
      final TextView bookTitleView = ViewUtil.findTextView(view, R.id.bookmark_item_booktitle);

      final Bookmark bookmark = getItem(position);
      if (bookmark == null) {
        imageView.setVisibility(View.VISIBLE);
        imageView.setImageResource(R.drawable.ic_list_plus);
        textView.setText(myResource.getResource("new").getValue());
        bookTitleView.setVisibility(View.GONE);
      } else {
        imageView.setVisibility(View.GONE);
        textView.setText(bookmark.getText());
        if (myShowAddBookmarkItem) {
          bookTitleView.setVisibility(View.GONE);
        } else {
          bookTitleView.setVisibility(View.VISIBLE);
          bookTitleView.setText(bookmark.getBookTitle());
        }
      }
      return view;
    }
Beispiel #2
0
  @Override
  public void onCreate(Bundle bundle) {
    super.onCreate(bundle);

    Thread.setDefaultUncaughtExceptionHandler(
        new org.geometerplus.zlibrary.ui.android.library.UncaughtExceptionHandler(this));
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);

    final SearchManager manager = (SearchManager) getSystemService(SEARCH_SERVICE);
    manager.setOnCancelListener(null);

    final TabHost host = getTabHost();
    LayoutInflater.from(this).inflate(R.layout.bookmarks, host.getTabContentView(), true);

    myBook = SerializerUtil.deserializeBook(getIntent().getStringExtra(FBReader.BOOK_KEY));
  }
    public View getView(int position, View convertView, ViewGroup parent) {
      RelativeLayout rowLayout;
      ServiceAcctInfo acct = acctList[position];
      if (convertView == null) {
        rowLayout =
            (RelativeLayout)
                LayoutInflater.from(context).inflate(R.layout.realm_login_row, parent, false);
      } else {
        rowLayout = (RelativeLayout) convertView;
      }

      String acctType = msgsetNames[acct.type.ordinal()];
      if (acct.name.acctType != null) acctType = acctType + " (" + acct.name.acctType + ')';
      if (acct.name.acctId != null) acctType = acctType + "\nAccount: " + acct.name.acctId;
      ((TextView) rowLayout.findViewById(R.id.Name)).setText(acct.desc);
      ((TextView) rowLayout.findViewById(R.id.TaskList)).setText(acctType);

      return rowLayout;
    }