Java Code Examples for android.widget.ImageView.setImageResource()

The following are Jave code examples for showing how to use setImageResource() of the android.widget.ImageView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: JavaIsFun   File: OQueEJava6.java   Source Code and License Vote up 8 votes
public void imageDialog2(View view){
    AlertDialog.Builder builder;

    builder = new AlertDialog.Builder(this);

    ImageView imageView = new ImageView(this);

    imageView.setImageResource(R.drawable.step2);
    builder.setTitle("Clique em 'Novo projeto'...")
            .setView(imageView)
            .setNegativeButton("Voltar", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                    dialog.cancel();
                }
            })
            .show();
}
 
Example 2
Project: hands-on-api-proxy   File: PhotoDetailFragment.java   Source Code and License Vote up 8 votes
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.fragment_photo_detail, container, false);

    mTitleView = (TextView) v.findViewById(R.id.photo_title);
    mTitleView.setText(getPhotoTitle(mPhoto));

    mImageView = (ImageView) v.findViewById(R.id.photo_image);
    if (mPhoto.getUrl() != null) {
        mApp.getImageDownloader(/*mImageView.getContext()*/)
                .load(mPhoto.getUrl())
                //.error(R.drawable.no_image)
                .into(mImageView);
    } else {
        mImageView.setImageResource(R.drawable.no_image);
    }

    mCaptionView = (TextView) v.findViewById(R.id.photo_caption);
    mCaptionView.setText(getPhotoCaption(mPhoto));

    return v;
}
 
Example 3
Project: ZhaZhaShop   File: ExpandTextView.java   Source Code and License Vote up 7 votes
private void init() {
    setOrientation(VERTICAL); //设置垂直布局
    setGravity(Gravity.CENTER); //中间对齐
    //初始化textView并添加
    contentView = new TextView(getContext());
    //添加行距
    contentView.setLineSpacing(1f, 1.3f);
    addView(contentView, LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
    //初始化ImageView并添加
    expandView = new ImageView(getContext());
    int padding = UIUtils.dp2px(getContext(), 5);
    expandView.setPadding(padding, padding, padding, padding);
    expandView.setImageResource(R.drawable.ic_arrow_down);
    LayoutParams llp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
    addView(expandView, llp);
}
 
Example 4
Project: ChatKeyboard-master   File: EmoticonsToolBarView.java   Source Code and License Vote up 7 votes
public void addData(int rec) {
    if (ly_tool != null) {
        View toolBtnView = inflate(mContext, R.layout.emoticonstoolbar_item, null);
        ImageView iv_icon = (ImageView) toolBtnView.findViewById(R.id.iv_icon);
        iv_icon.setImageResource(rec);
        LinearLayout.LayoutParams imgParams = new LinearLayout.LayoutParams(Utils.dip2px(mContext, mBtnWidth), LayoutParams.MATCH_PARENT);
        iv_icon.setLayoutParams(imgParams);
        ly_tool.addView(toolBtnView);
        final int position = mToolBtnList.size();
        mToolBtnList.add(iv_icon);
        iv_icon.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                if (mItemClickListeners != null && !mItemClickListeners.isEmpty()) {
                    for (OnToolBarItemClickListener listener : mItemClickListeners) {
                        listener.onToolBarItemClick(position);
                    }
                }
            }
        });
    }
}
 
Example 5
Project: airgram   File: ChatUnreadCell.java   Source Code and License Vote up 7 votes
public ChatUnreadCell(Context context) {
    super(context);

    FrameLayout frameLayout = new FrameLayout(context);
    //frameLayout.setBackgroundResource(R.drawable.newmsg_divider);
    addView(frameLayout, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 27, Gravity.LEFT | Gravity.TOP, 0, 7, 0, 0));

    ImageView imageView = new ImageView(context);
    imageView.setImageResource(R.drawable.ic_ab_new);
    imageView.setPadding(0, AndroidUtilities.dp(2), 0, 0);
    frameLayout.addView(imageView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.RIGHT | Gravity.CENTER_VERTICAL, 0, 0, 10, 0));

    textView = new TextView(context);
    textView.setTypeface(FontManager.instance().getTypeface());
    textView.setPadding(0, 0, 0, AndroidUtilities.dp(1));
    textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
    textView.setTextColor(Theme.CHAT_UNREAD_TEXT_COLOR);
    textView.setTypeface(FontManager.instance().getTypeface());
    addView(textView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER));

    ColorUtils.ColorPresenter c= ChitSettings.currentColorPresenter();
    try {
        c.modifyUnreadBg(frameLayout, textView);
    }catch (Exception e){}

}
 
Example 6
Project: FanChat   File: EaseEmojiconScrollTabBar.java   Source Code and License Vote up 7 votes
/**
 * add tab
 * @param icon
 */
public void addTab(int icon){
    View tabView = View.inflate(context, R.layout.ease_scroll_tab_item, null);
    ImageView imageView = (ImageView) tabView.findViewById(R.id.iv_icon);
    imageView.setImageResource(icon);
    int tabWidth = 60;
    LinearLayout.LayoutParams imgParams = new LinearLayout.LayoutParams(DensityUtil.dip2px(context, tabWidth), LayoutParams.MATCH_PARENT);
    imageView.setLayoutParams(imgParams);
    tabContainer.addView(tabView);
    tabList.add(imageView);
    final int position = tabList.size() -1;
    imageView.setOnClickListener(new OnClickListener() {
        
        @Override
        public void onClick(View v) {
            if(itemClickListener != null){
                itemClickListener.onItemClick(position);
            }
        }
    });
}
 
Example 7
Project: MultiItem   File: DataBindUtil.java   Source Code and License Vote up 6 votes
/**
 * 通过android:imageUrl可以在xml布局中直接为ImageView设置url地址,这样方便业务中使用第三方库加载网络图片
 *
 * @param imageView xml中ImageView实例
 * @param imgUrl    网络图片地址
 */
@BindingAdapter({"android:imageUrl"})
public static void setImageViewResource(ImageView imageView, String imgUrl) {
    Context context = imageView.getContext();
    //此处通过imgUrl字符串获取资源ID,具体使用根据业务需要
    int resId = context.getResources().getIdentifier(imgUrl, "drawable", context.getPackageName());
    imageView.setImageResource(resId);
}
 
Example 8
Project: boohee_v5.6   File: TodayAnalysisActivity.java   Source Code and License Vote up 6 votes
private void initTodayOverview(TodayOverview todayOverview) {
    int i = R.drawable.a1j;
    if (todayOverview != null) {
        this.mIvCaloryStatus.setImageResource(todayOverview.calory_status ? R.drawable.a1j :
                R.drawable.a1p);
        this.mIvDietStatus.setImageResource(todayOverview.diet_status ? R.drawable.a1j : R
                .drawable.a1p);
        ImageView imageView = this.mIvNuturitionStatus;
        if (!todayOverview.nuturition_status) {
            i = R.drawable.a1p;
        }
        imageView.setImageResource(i);
    }
}
 
Example 9
Project: CSipSimple   File: SlidingTab.java   Source Code and License Vote up 6 votes
/**
 * Constructor
 * 
 * @param parent
 *            the container view of this one
 * @param tabId
 *            drawable for the tab
 * @param barId
 *            drawable for the bar
 * @param targetId
 *            drawable for the target
 */
Slider(ViewGroup parent, int iconId, int targetId, int barId, int tabId) {
	// Create tab
	tab = new ImageView(parent.getContext());
	tab.setBackgroundResource(tabId);
	tab.setImageResource(iconId);
	tab.setScaleType(ScaleType.CENTER);
	tab.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));

	// Create hint TextView
	text = new TextView(parent.getContext());
	text.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
	text.setBackgroundResource(barId);
	if(!parent.isInEditMode()) {
	    text.setTextAppearance(parent.getContext(), R.style.TextAppearance_SlidingTabNormal);
	}
	
	// Create target
	target = new ImageView(parent.getContext());
	target.setImageResource(targetId);
	target.setScaleType(ScaleType.CENTER);
	target.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
	target.setVisibility(View.INVISIBLE);
	
	
	// this needs to be first - relies on painter's algorithm
	parent.addView(target); 
	parent.addView(tab);
	parent.addView(text);
}
 
Example 10
Project: MyRepository   File: PageIndicator.java   Source Code and License Vote up 6 votes
public PageIndicator(Context context, AttributeSet attrs) {
    super(context, attrs);
    this.context = context;

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.PageIndicator);
    normalIndicator = a.getResourceId(R.styleable.PageIndicator_normal_indicator,
            R.drawable.shape_point_white_alpha);
    selectedIndicator = a.getResourceId(R.styleable.PageIndicator_selected_indicator,
            R.drawable.shape_point_black);
    a.recycle();

    FrameLayout.LayoutParams params = new FrameLayout.LayoutParams
            (LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
    llIndicators = new LinearLayout(context);
    llIndicators.setLayoutParams(params);
    llIndicators.setOrientation(LinearLayout.HORIZONTAL);

    indicator = new ImageView(context);
    FrameLayout.LayoutParams params1 = new FrameLayout.LayoutParams
            (LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
    indicator.setLayoutParams(params1);
    indicator.setImageResource(selectedIndicator);//默认使用白色实心点

    this.addView(llIndicators);
    this.addView(indicator);


}
 
Example 11
Project: GitHub   File: HeaderAndFooterUseActivity.java   Source Code and License Vote up 6 votes
private View getHeaderView(int type, View.OnClickListener listener) {
    View view = getLayoutInflater().inflate(R.layout.head_view, (ViewGroup) mRecyclerView.getParent(), false);
    if (type == 1) {
        ImageView imageView = (ImageView) view.findViewById(R.id.iv);
        imageView.setImageResource(R.mipmap.rm_icon);
    }
    view.setOnClickListener(listener);
    return view;
}
 
Example 12
Project: Artist   File: TutorialAdapter.java   Source Code and License Vote up 6 votes
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.view_tutorial, container, false);
    ImageView imageView = view.findViewById(R.id.imageView);
    TextView textView = view.findViewById(R.id.textView);
    imageView.setImageResource(imageID);
    textView.setText(content);
    return view;
}
 
Example 13
Project: SciChart.Android.Examples   File: SeparatorWidget.java   Source Code and License Vote up 6 votes
@Override
public View createView(Context context) {
    LayoutInflater inflater = LayoutInflater.from(context);

    RelativeLayout layout = (RelativeLayout) inflater.inflate(R.layout.example_toolbar_item, null, false);

    ImageView imageView = new ImageView(context);
    imageView.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT));
    imageView.setImageResource(R.drawable.example_toolbar_separator);

    layout.addView(imageView);

    return layout;
}
 
Example 14
Project: code-scanner   File: CodeScannerView.java   Source Code and License Vote up 5 votes
private void initialize(@NonNull Context context, @Nullable AttributeSet attrs, @AttrRes int defStyleAttr,
        @StyleRes int defStyleRes) {
    mPreviewView = new SurfaceView(context);
    mPreviewView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
    mViewFinderView = new ViewFinderView(context);
    mViewFinderView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
    DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
    mButtonSize = Math.round(displayMetrics.density * BUTTON_SIZE_DP);
    mAutoFocusButton = new ImageView(context);
    mAutoFocusButton.setLayoutParams(new LayoutParams(mButtonSize, mButtonSize));
    mAutoFocusButton.setScaleType(ImageView.ScaleType.CENTER);
    mAutoFocusButton.setImageResource(R.drawable.ic_code_scanner_auto_focus_on);
    mAutoFocusButton.setOnClickListener(new AutoFocusClickListener());
    mFlashButton = new ImageView(context);
    mFlashButton.setLayoutParams(new LayoutParams(mButtonSize, mButtonSize));
    mFlashButton.setScaleType(ImageView.ScaleType.CENTER);
    mFlashButton.setImageResource(R.drawable.ic_code_scanner_flash_on);
    mFlashButton.setOnClickListener(new FlashClickListener());
    if (attrs == null) {
        mViewFinderView.setSquareFrame(DEFAULT_SQUARE_FRAME);
        mViewFinderView.setMaskColor(DEFAULT_MASK_COLOR);
        mViewFinderView.setFrameColor(DEFAULT_FRAME_COLOR);
        mViewFinderView.setFrameThickness(Math.round(DEFAULT_FRAME_THICKNESS_DP * displayMetrics.density));
        mViewFinderView.setFrameCornersSize(Math.round(DEFAULT_FRAME_CORNER_SIZE_DP * displayMetrics.density));
        mAutoFocusButton.setColorFilter(DEFAULT_AUTO_FOCUS_BUTTON_COLOR);
        mFlashButton.setColorFilter(DEFAULT_FLASH_BUTTON_COLOR);
        mAutoFocusButton.setVisibility(DEFAULT_AUTO_FOCUS_BUTTON_VISIBILITY);
        mFlashButton.setVisibility(DEFAULT_FLASH_BUTTON_VISIBILITY);
    } else {
        TypedArray attributes = null;
        try {
            attributes = context.getTheme()
                    .obtainStyledAttributes(attrs, R.styleable.CodeScannerView, defStyleAttr, defStyleRes);
            mViewFinderView.setSquareFrame(
                    attributes.getBoolean(R.styleable.CodeScannerView_squareFrame, DEFAULT_SQUARE_FRAME));
            mViewFinderView
                    .setMaskColor(attributes.getColor(R.styleable.CodeScannerView_maskColor, DEFAULT_MASK_COLOR));
            mViewFinderView.setFrameColor(
                    attributes.getColor(R.styleable.CodeScannerView_frameColor, DEFAULT_FRAME_COLOR));
            mViewFinderView.setFrameThickness(attributes
                    .getDimensionPixelSize(R.styleable.CodeScannerView_frameThickness,
                            Math.round(DEFAULT_FRAME_THICKNESS_DP * displayMetrics.density)));
            mViewFinderView.setFrameCornersSize(attributes
                    .getDimensionPixelSize(R.styleable.CodeScannerView_frameCornersSize,
                            Math.round(DEFAULT_FRAME_CORNER_SIZE_DP * displayMetrics.density)));
            mAutoFocusButton.setColorFilter(attributes
                    .getColor(R.styleable.CodeScannerView_autoFocusButtonColor, DEFAULT_AUTO_FOCUS_BUTTON_COLOR));
            mFlashButton.setColorFilter(
                    attributes.getColor(R.styleable.CodeScannerView_flashButtonColor, DEFAULT_FLASH_BUTTON_COLOR));
            mAutoFocusButton.setVisibility(attributes.getBoolean(R.styleable.CodeScannerView_autoFocusButtonVisible,
                    DEFAULT_AUTO_FOCUS_BUTTON_VISIBLE) ? VISIBLE : INVISIBLE);
            mFlashButton.setVisibility(attributes
                    .getBoolean(R.styleable.CodeScannerView_flashButtonVisible, DEFAULT_FLASH_BUTTON_VISIBLE) ?
                    VISIBLE : INVISIBLE);
        } finally {
            if (attributes != null) {
                attributes.recycle();
            }
        }
    }
    addView(mPreviewView);
    addView(mViewFinderView);
    addView(mAutoFocusButton);
    addView(mFlashButton);
}
 
Example 15
Project: OSchina_resources_android   File: ListBaseAdapter.java   Source Code and License Vote up 5 votes
protected void setImageRes(ImageView imageRes, @DrawableRes int resId) {
    imageRes.setImageResource(resId);
}
 
Example 16
Project: FindX   File: Bus_Fetch.java   Source Code and License Vote up 5 votes
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public boolean onOptionsItemSelected(MenuItem item) {

    int id = item.getItemId();

    //noinspection SimplifiableIfStatement
    if (id == R.id.info) {
        AlertDialog.Builder alertadd = new AlertDialog.Builder(
                Bus_Fetch.this);
        LayoutInflater factory = LayoutInflater.from(Bus_Fetch.this);

        final View view = factory.inflate(R.layout.dialog_main, null);

        ImageView image = (ImageView) view.findViewById(R.id.imageView);
        image.setImageResource(R.drawable.friendlocation_help);

        alertadd.setView(view);


        alertadd.setPositiveButton("ok", new DialogInterface.OnClickListener() {

            public void onClick(DialogInterface dlg, int sumthin) {

            }
        });
        alertDialog = alertadd.create();
        alertDialog.show();
    }

    if (id == R.id.action_search) {

        searchByNumber();
        InputMethodManager inputManager =
                (InputMethodManager) context.
                        getSystemService(Context.INPUT_METHOD_SERVICE);
        inputManager.hideSoftInputFromWindow(
                Bus_Fetch.this.getCurrentFocus().getWindowToken(),
                InputMethodManager.HIDE_NOT_ALWAYS);

    }


    return super.onOptionsItemSelected(item);
}
 
Example 17
Project: YViewPagerDemo   File: BannerActivity.java   Source Code and License Vote up 5 votes
private void initImgs() {
    mImageViews = new ArrayList<>();
    mStringList=new ArrayList<>();

    ViewPager.LayoutParams lp = new ViewPager.LayoutParams();
    lp.gravity = Gravity.LEFT;

    ImageView imageView1 = new ImageView(this);
    imageView1.setImageResource(R.drawable.jay_fantexi);
    imageView1.setScaleType(ImageView.ScaleType.CENTER_CROP);

    ImageView imageView2 = new ImageView(this);
    imageView2.setImageResource(R.drawable.jay_jay);
    imageView2.setScaleType(ImageView.ScaleType.CENTER_CROP);

    ImageView imageView3 = new ImageView(this);
    imageView3.setImageResource(R.drawable.logo);
    imageView3.setScaleType(ImageView.ScaleType.CENTER_CROP);

    ImageView imageView4 = new ImageView(this);
    imageView4.setImageResource(R.drawable.image2);
    imageView4.setScaleType(ImageView.ScaleType.CENTER_CROP);

    ImageView imageView5 = new ImageView(this);
    imageView5.setImageResource(R.drawable.jay_jay);
    imageView5.setScaleType(ImageView.ScaleType.CENTER_CROP);

    ImageView imageView6 = new ImageView(this);
    imageView6.setImageResource(R.drawable.logo);
    imageView6.setScaleType(ImageView.ScaleType.CENTER_CROP);

    imageView1.setLayoutParams(lp);
    imageView2.setLayoutParams(lp);
    imageView3.setLayoutParams(lp);
    imageView4.setLayoutParams(lp);
    imageView5.setLayoutParams(lp);
    imageView6.setLayoutParams(lp);

    mImageViews.add(imageView1);
    mImageViews.add(imageView2);
    mImageViews.add(imageView3);
    mImageViews.add(imageView4);
    mImageViews.add(imageView5);
    mImageViews.add(imageView6);
    mStringList.add("youngkaaa test 1");
    mStringList.add("hahahahha");
    mStringList.add("yyyyyyyyyyyyyyy");
    mStringList.add("aaaaaaaaaaaaaa");
    mStringList.add("pipipipipipipipipi");
    mStringList.add("kkkkkkkkkkkkkkkkk");

}
 
Example 18
Project: 2017.1-Trezentos   File: AboutAdapter.java   Source Code and License Vote up 5 votes
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    // Get the data item for this position
    About about = (About) getItem(position);

    // Check if an existing view is being reused, otherwise inflate the view
    ViewHolder viewHolder;

    // view lookup cache stored in tag
    final View result;

    if (convertView == null) {

        viewHolder = new ViewHolder();

        LayoutInflater inflater = LayoutInflater.from(getContext());
        convertView = inflater.inflate(R.layout.about_item, parent, false);

        viewHolder.title = (TextView) convertView.findViewById(R.id.title_about);
        viewHolder.subTitle = (TextView) convertView.findViewById(R.id.description);

        result=convertView;

        convertView.setTag(viewHolder);
    } else {
        viewHolder = (ViewHolder) convertView.getTag();
        result=convertView;
    }

    Animation animation = AnimationUtils.loadAnimation(mContext,
            (position > lastPosition) ? R.anim.down_from_top : R.anim.down_from_top);
    result.startAnimation(animation);
    lastPosition = position;

    viewHolder.title.setText(about.getTitle());
    viewHolder.subTitle.setText(about.getSubTitle());

    ImageView item_about = (ImageView) convertView.findViewById(R.id.item_about);
    item_about.setImageResource(about.getAboutImage(position));
    // Return the completed view to render on screen
    return convertView;
}
 
Example 19
Project: GongXianSheng   File: UserUtils.java   Source Code and License Vote up 5 votes
public static void setOrderStatus(String status, TextView label, ImageView icon, boolean normalOrder) {
        //待确认
        if("draft".equals(status)) {
            label.setText("待确认");
            icon.setImageResource(R.drawable.state_restaurant_1_tocertain);
        }
        //已确认
        else if("sale".equals(status)) {
            label.setText("已确认");
            icon.setImageResource(R.drawable.state_restaurant_2_certain);
        }
        //已发货
        else if("peisong".equals(status)) {
            label.setText("已发货");
            icon.setImageResource(R.drawable.state_restaurant_3_delivering);
        }
        //已收货
        //退货returnOrders

        //已评价
        else if("rated".equals(status)) {
            label.setText("已评价");
            icon.setImageResource(R.drawable.state_restaurant_5_rated);
        }
        //退货中
        if("process".equals(status)) {
            label.setText("退货中");
            icon.setImageResource(R.drawable.state_delivery_7_return);
        }
        //已退货
        else if(!normalOrder &&"done".equals(status)) {
            label.setText("已退货");
            icon.setImageResource(R.drawable.state_delivery_7_return);
        }
        //已收货
        else if(normalOrder && "done".equals(status)) {
            label.setText("已收货");
            icon.setImageResource(R.drawable.state_restaurant_2_certain);
        }
        //已取消cancel
        else if("cancel".equals(status)){
            label.setText("订单关闭");
            icon.setImageResource(R.drawable.state_restaurant_6_closed);
        }
//        else {
//            label.setText("订单关闭");
//            icon.setImageResource(R.drawable.state_restaurant_6_closed);
//        }
    }
 
Example 20
Project: dapay   File: BillsListAdapter.java   Source Code and License Vote up 5 votes
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    LayoutInflater inflater = (LayoutInflater) context
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View rowView = inflater.inflate(R.layout.layout_row_bill, parent, false);

    ArrayList<Bill> values = DBHelper.getInstance(context).getAllBills();
    synchronized (values) {
        if (position >= values.size())
            return rowView;
        Bill bill = values.get(position);
        Date date = new Date(bill.getTimestamp());
        SimpleDateFormat datetime_format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        ImageView icon = (ImageView) rowView.findViewById(R.id.bill_icon);
        TextView fiat_view = (TextView) rowView.findViewById(R.id.fiat_view);
        TextView crypto_view = (TextView) rowView.findViewById(R.id.crypto_view);
        TextView timestamp_view = (TextView) rowView.findViewById(R.id.timestamp_view);
        TextView label_view = (TextView) rowView.findViewById(R.id.bill_label);
        TextView paid_view = (TextView) rowView.findViewById(R.id.paid_amount);

        if (ExchangeAPI.GetCurrentAPI() != null) {
            fiat_view.setText(String.format(ExchangeAPI.GetCurrentAPI().GetCurrencyActualSymbol() + "  %.2f", bill.getFiatAmount()));
        } else {
            fiat_view.setText(String.format("$  %.2f", bill.getFiatAmount()));
        }
        crypto_view.setText(String.format(context.getString(R.string.cry)+" %.8f", bill.getCryptoAmount()));
        timestamp_view.setText(datetime_format.format(date));
        label_view.setText(bill.getLabel());

        if (bill.getAmountDepositedAndToBeDeposited() == bill.getAmountDeposited()) {
            paid_view.setText(String.format(context.getString(R.string.label_bill_received)+" %.8f", bill.getAmountDeposited()));
            if (bill.getAmountDeposited() > 0 && bill.getAmountDeposited() < bill.getCryptoAmount()-0.00000010)
                paid_view.setTextColor(Color.RED);
        } else {
            paid_view.setText(String.format(context.getString(R.string.label_bill_receiving)+" %.8f", bill.getAmountDepositedAndToBeDeposited()));
            if (bill.getAmountDepositedAndToBeDeposited() > 0 && bill.getAmountDepositedAndToBeDeposited() < bill.getCryptoAmount()-0.00000010)
                paid_view.setTextColor(Color.RED);
        }

        switch (bill.getStatus()) {
            case STATUS_UNCONFIRMED:
                icon.setImageResource(presence_invisible);
                break;
            case STATUS_CONFIRMED:
                icon.setImageResource(presence_online);
                break;
            default:
                icon.setImageResource(ic_notification_overlay);
                break;
        }

        if ( ! displayedBills.contains(bill.getWalletID())) {
            // TODO: Animate
            displayedBills.add(bill.getWalletID());
        }
        rowView.setTag(bill);
    }
    return rowView;
}