@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;
    }
  public void onCreateContextMenu(ContextMenu menu) {
    super.onCreateContextMenu(menu);

    menu.setHeaderTitle("MyImage Menu");
    menu.add(0, 100, 0, "이미지 회전");
    menu.add(0, 101, 0, "크기 변경");
  }
Exemple #3
0
        @Override
        public void onTick(long millisUntilFinished) {
          switch (iconCount) {
            case 0:
              drawable = getResources().getDrawable(R.drawable.loading);
              break;
            case 1:
              drawable = getResources().getDrawable(R.drawable.loading_1);
              break;
            case 2:
              drawable = getResources().getDrawable(R.drawable.loading_2);
              break;
            case 3:
              drawable = getResources().getDrawable(R.drawable.loading_3);
              break;
            case 4:
              drawable = getResources().getDrawable(R.drawable.loading_4);
              break;
            case 5:
              drawable = getResources().getDrawable(R.drawable.loading_5);
              break;
            case 6:
              drawable = getResources().getDrawable(R.drawable.loading_6);
              break;
          }
          iconCount++;

          loadingIconLayout.setImageDrawable(drawable);
        }
  private void initView() {
    context = (BaseActivity) getActivity();
    imgLeftCorner = (ImageView) ret.findViewById(R.id.img_left_corner);
    et_searchkey = (MaterialEditText) ret.findViewById(R.id.et_searchkey);
    mListView = (XListView) ret.findViewById(R.id.list_search_fans);
    mListView.setPullRefreshEnable(false);
    mListView.setPullLoadEnable(false);
    mNoContentHint = (TextView) ret.findViewById(R.id.no_content_hint);

    imgLeftCorner.setOnClickListener(this);
    mListView.setOnItemClickListener(this);
    et_searchkey.addTextChangedListener(this);

    et_searchkey.setFocusable(true);
    et_searchkey.setFocusableInTouchMode(true);
    et_searchkey.requestFocus();

    adapter = new SearchAdapter(context, R.layout.item_group_member2, cursor);
    mListView.setAdapter(adapter);
  }
 private void setImage(Bitmap photo) {
   ImageView image = (ImageView) findViewById(R.id.image);
   pictureFile = new AndroidCMFile(photo);
   image.setImageBitmap(photo);
 }