Example usage for android.widget TextView setHeight

List of usage examples for android.widget TextView setHeight

Introduction

In this page you can find the example usage for android.widget TextView setHeight.

Prototype

@android.view.RemotableViewMethod
public void setHeight(int pixels) 

Source Link

Document

Sets the height of the TextView to be exactly pixels tall.

Usage

From source file:com.cssweb.android.quote.QHSCGridActivity.java

private void AddViewItem(int paramInt1, LinearLayout paramLinearLayout, int paramInt2, int paramInt3,
        int paramInt4, boolean paramBoolean) {
    TextView localTextView = new TextView(this);
    float f = this.mFontSize;
    localTextView.setTextSize(f);/* w w w  . j ava 2 s.  c o m*/

    localTextView.setGravity(Gravity.CENTER);
    localTextView.setFocusable(paramBoolean);
    localTextView.setOnClickListener(mClickListener);
    localTextView.setOnLongClickListener(mLongClickListener);
    localTextView.setOnTouchListener(this); // touch
    localTextView.setTag(paramInt2);
    localTextView.setEnabled(paramBoolean);
    localTextView.setSingleLine(true);
    Resources localResources = getResources();
    Drawable localDrawable = null;
    if (paramInt4 == 0 && paramInt3 >= 0) {// 
        int i1 = this.residTitleCol;
        int i8 = 0;
        localTextView.setTextColor(paramInt1);
        if (paramInt3 == 0) {
            localDrawable = localResources.getDrawable(i1);
            i8 = localDrawable.getIntrinsicWidth();
        } else if (paramInt3 == 100) {
            localDrawable = localResources.getDrawable(this.residTitleScrollCol[2]);
            i8 = localDrawable.getIntrinsicWidth();
            i8 += 20;
        } else if (paramInt3 == 13) {
            localDrawable = localResources.getDrawable(this.residTitleScrollCol[0]);
            i8 = localDrawable.getIntrinsicWidth();

        } else if (paramInt3 % 2 == 0) {
            localDrawable = localResources.getDrawable(this.residTitleScrollCol[1]);
            i8 = localDrawable.getIntrinsicWidth();
        } else {
            localDrawable = localResources.getDrawable(this.residTitleScrollCol[0]);
            i8 = localDrawable.getIntrinsicWidth();
        }
        localTextView.setBackgroundDrawable(localDrawable);
        int i6 = localDrawable.getIntrinsicHeight();
        localTextView.setHeight(i6 + CssSystem.getTableTitleHeight(this));
        localTextView.setWidth(i8);
        paramLinearLayout.addView(localTextView);
        return;
    }
    if (paramInt4 != 0 && paramInt3 >= 0) {
        int i8 = 0;
        localTextView.setTextColor(paramInt1);
        if (paramInt3 == 0) {
            localDrawable = localResources.getDrawable(this.residCol);
            i8 = localDrawable.getIntrinsicWidth();
        } else if (paramInt3 == 100) {
            localDrawable = localResources.getDrawable(this.residScrollCol[2]);
            localTextView.setGravity(Gravity.RIGHT | Gravity.CENTER_VERTICAL);
            i8 = localDrawable.getIntrinsicWidth();
            i8 += 20;
        } else if (paramInt3 == 13) {
            localDrawable = localResources.getDrawable(this.residScrollCol[0]);
            localTextView.setGravity(Gravity.RIGHT | Gravity.CENTER_VERTICAL);
            i8 = localDrawable.getIntrinsicWidth();

        } else if (paramInt3 % 2 == 0) {
            localDrawable = localResources.getDrawable(this.residScrollCol[1]);
            localTextView.setGravity(Gravity.RIGHT | Gravity.CENTER_VERTICAL);
            i8 = localDrawable.getIntrinsicWidth();
        } else {
            localDrawable = localResources.getDrawable(this.residScrollCol[0]);
            localTextView.setGravity(Gravity.RIGHT | Gravity.CENTER_VERTICAL);
            i8 = localDrawable.getIntrinsicWidth();
        }
        localTextView.setBackgroundDrawable(localDrawable);
        int i6 = localDrawable.getIntrinsicHeight();
        localTextView.setHeight(i6 + rowHeight);
        localTextView.setWidth(i8);
        paramLinearLayout.addView(localTextView);
        return;
    }
}

From source file:com.httrack.android.HTTrackActivity.java

private TextView addEmptyLineToLayout(final LinearLayout layout) {
    final TextView text = new TextView(this);

    // Span to the width
    text.setWidth(LayoutParams.FILL_PARENT);
    text.setHeight(LayoutParams.WRAP_CONTENT);

    // Single line, with optional ellipsis (...) on the middle
    text.setSingleLine();//  www.j av  a2s .  co  m
    text.setEllipsize(TextUtils.TruncateAt.MIDDLE);
    layout.addView(text);

    // Return new widget
    return text;
}

From source file:com.pipit.agc.adapter.DayPickerAdapter.java

@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.dayrowlayout, parent, false);
    TextView dayOfMonthTV = (TextView) rowView.findViewById(R.id.txt);
    TextView commentTV = (TextView) rowView.findViewById(R.id.comment);
    TextView dayOfWeekTV = (TextView) rowView.findViewById(R.id.mon_to_fri);

    if (position < allPreviousDays.size()) {
        //The Past
        DayRecord d = allPreviousDays.get(position);
        String primaryText = "";
        if (d.beenToGym()) {
            primaryText = "WENT TO GYM";
        } else {/*from w  w w. j a  v a2  s.  c  o  m*/
            if (d.isGymDay()) {
                primaryText = "MISSED GYM";
            } else {
                primaryText = "NO GYM - REST DAY";
            }
        }

        Date date = allPreviousDays.get(position).getDate();
        String dayOfWeekTxt;
        String dayOfMonthTxt;
        try {
            Calendar cal = Calendar.getInstance();
            cal.setTime(date);
            int day = cal.get(Calendar.DAY_OF_MONTH);
            int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
            dayOfWeekTxt = getDayOfWeekText(dayOfWeek);
            dayOfMonthTxt = Integer.toString(day);
        } catch (Exception e) {
            dayOfWeekTxt = "?";
            dayOfMonthTxt = "?";
        }
        dayOfWeekTV.setText(dayOfWeekTxt);
        dayOfMonthTV.setText(dayOfMonthTxt);
        if (position == allPreviousDays.size() - 1) {
            primaryText += " (Today)";
        }
        if (position == allPreviousDays.size() - 2) {
            primaryText += " (Yesterday)";
        }
        commentTV.setText(primaryText);
    } else {
        int diff = position - (allPreviousDays.size() - 1);
        Calendar cal = Calendar.getInstance();
        cal.add(Calendar.DATE, diff);
        int day = cal.get(Calendar.DAY_OF_MONTH);
        int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);

        dayOfWeekTV.setText(getDayOfWeekText(dayOfWeek));
        dayOfMonthTV.setText(Integer.toString(day));

        String primaryText = getDayMessage(dayOfWeek, cal.getTime(), rowView);
        commentTV.setText(primaryText);
    }

    /*Set listview height to show 7 days*/
    if (_screenheight < 1) {
        _screenheight = Math.round(Util.getScreenHeightMinusStatusBar(getContext()));
    }

    //The weight of the day number is 3/4 of the total height
    int txtheight = (int) (.66 * (_screenheight / 7));
    dayOfMonthTV.setHeight(txtheight);
    refitText(dayOfMonthTV, txtheight);
    return rowView;
}

From source file:com.cssweb.android.base.QuoteGridActivity.java

private void AddViewItem(String paramString, int paramInt1, LinearLayout paramLinearLayout, int paramInt2,
        int paramInt3, int paramInt4, boolean paramBoolean) {
    TextView localTextView = new TextView(this);
    float f = this.mFontSize;

    localTextView.setTextSize(f);//w  w w . j a v a2  s.c  o m
    //??4?
    if (paramInt2 == paramInt4 && paramInt3 == 0 && nameOrcode) {

        if (this.mPaint.measureText(paramString) > textWeight)
            localTextView.setTextSize(13);
    }

    if (n2 == paramInt2) {
        String str = (n1 == 0) ? paramString + low : (n1 == 1) ? paramString + top : paramString;
        localTextView.setText(str);
    } else {
        localTextView.setText(paramString);
    }
    localTextView.setGravity(Gravity.LEFT | Gravity.CENTER_VERTICAL);
    localTextView.setFocusable(paramBoolean);
    localTextView.setOnClickListener(mClickListener);
    localTextView.setOnLongClickListener(mLongClickListener);
    localTextView.setOnTouchListener(this); //touch
    localTextView.setTag(paramInt2);
    localTextView.setEnabled(paramBoolean);
    localTextView.setSingleLine(false);
    if (paramInt4 == 0 && paramInt3 >= 0) {//
        localTextView.setGravity(Gravity.CENTER);
        int i1 = this.residTitleCol;
        int i8 = 0;
        localTextView.setTextColor(paramInt1);
        if (paramInt3 == 0) {
            localDrawable = getResources().getDrawable(i1);
            i8 = localDrawable.getIntrinsicWidth();
        } else if (paramInt3 == 100) {
            localDrawable = getResources().getDrawable(this.residTitleScrollCol[2]);
            i8 = localDrawable.getIntrinsicWidth();
        } else if (paramInt3 == 13) {
            localDrawable = getResources().getDrawable(this.residTitleScrollCol[0]);
            i8 = localDrawable.getIntrinsicWidth();
            i8 += 20;
        } else if (paramInt3 == 8) {
            localDrawable = getResources().getDrawable(this.residTitleScrollCol[0]);
            i8 = localDrawable.getIntrinsicWidth();
            i8 += 10;
        } else if (paramInt3 % 2 == 0) {
            localDrawable = getResources().getDrawable(this.residTitleScrollCol[1]);
            i8 = localDrawable.getIntrinsicWidth();
        } else {
            localDrawable = getResources().getDrawable(this.residTitleScrollCol[0]);
            i8 = localDrawable.getIntrinsicWidth();
        }
        localTextView.setBackgroundDrawable(localDrawable);
        int i6 = localDrawable.getIntrinsicHeight();
        localTextView.setHeight(i6 + CssSystem.getTableTitleHeight(this));
        //int i9 = (int) Math.max(i8, mPaint.measureText(paramString));
        localTextView.setWidth(i8);
        paramLinearLayout.addView(localTextView);
        return;
    }
    if (paramInt4 != 0 && paramInt3 >= 0) {
        int i8 = 0;
        localTextView.setTextColor(paramInt1);
        if (paramInt3 == 0) {
            localDrawable = getResources().getDrawable(this.residCol);
            i8 = localDrawable.getIntrinsicWidth();
        } else if (paramInt3 == 100) {
            localDrawable = getResources().getDrawable(this.residScrollCol[2]);
            localTextView.setGravity(Gravity.RIGHT | Gravity.CENTER_VERTICAL);
            i8 = localDrawable.getIntrinsicWidth();
        } else if (paramInt3 == 13) {
            localDrawable = getResources().getDrawable(this.residScrollCol[0]);
            localTextView.setGravity(Gravity.RIGHT | Gravity.CENTER_VERTICAL);
            i8 = localDrawable.getIntrinsicWidth();
            i8 += 20;
            //localTextView.setWidth(i8+20);
        } else if (paramInt3 == 8) {
            localDrawable = getResources().getDrawable(this.residScrollCol[0]);
            localTextView.setGravity(Gravity.RIGHT | Gravity.CENTER_VERTICAL);
            i8 = localDrawable.getIntrinsicWidth();
            i8 += 10;
            //localTextView.setWidth(i8+20);
        } else if (paramInt3 % 2 == 0) {
            localDrawable = getResources().getDrawable(this.residScrollCol[1]);
            localTextView.setGravity(Gravity.RIGHT | Gravity.CENTER_VERTICAL);
            i8 = localDrawable.getIntrinsicWidth();
        } else {
            localDrawable = getResources().getDrawable(this.residScrollCol[0]);
            localTextView.setGravity(Gravity.RIGHT | Gravity.CENTER_VERTICAL);
            i8 = localDrawable.getIntrinsicWidth();
        }
        localTextView.setBackgroundDrawable(localDrawable);
        int i6 = localDrawable.getIntrinsicHeight();
        localTextView.setHeight(i6 + rowHeight);
        //int i9 = (int) Math.max(i8, mPaint.measureText(paramString));
        localTextView.setWidth(i8);
        paramLinearLayout.addView(localTextView);
        return;
    }
    //      if ((paramInt3 == j) && (paramInt4 == l)) {
    //         int i13 = this.residTitleScrollCol[l];
    //         localDrawable = localResources.getDrawable(i13);
    //         localTextView.setTextColor(paramInt1);
    //         localTextView.setBackgroundDrawable(localDrawable);
    //         paramLinearLayout.addView(localTextView);
    //         return;
    //      }
}

From source file:com.nest5.businessClient.Initialactivity.java

private void makeTable(String name) {
    table.removeAllViews();//from w w  w  .j  a  v a2s  .c  o m
    Iterator<Entry<Registrable, Integer>> it = currentOrder.entrySet().iterator();
    int i = 0;
    while (it.hasNext()) {
        LinkedHashMap.Entry<Registrable, Integer> pairs = (LinkedHashMap.Entry<Registrable, Integer>) it.next();
        // System.out.println(pairs.getKey() + " = " + pairs.getValue());
        // it.remove(); // avoids a ConcurrentModificationException
        TableRow tr = (TableRow) getLayoutInflater().inflate(R.layout.table_row, null);

        TextView tItem = (TextView) tr.findViewById(R.id.cell_item);
        TextView tQty = (TextView) tr.findViewById(R.id.cell_qty);
        TextView tPrice = (TextView) tr.findViewById(R.id.cell_price);
        ImageButton rmvBtn = (ImageButton) tr.findViewById(R.id.cell_remove_button);

        tItem.setText(pairs.getKey().name);
        tQty.setText(String.valueOf(pairs.getValue()));
        tPrice.setText(String.valueOf(pairs.getKey().price));
        if (name == pairs.getKey().name) {
            tr.setBackgroundColor(Color.parseColor("#55222222"));
        }
        rmvBtn.setOnClickListener(removeClickListener);
        rmvBtn.setId(i);
        table.addView(tr);

        // Draw separator
        TextView tv = new TextView(mContext);
        tv.setBackgroundColor(Color.parseColor("#80808080"));
        tv.setHeight(2);
        table.addView(tv);
        inTableRegistrable.add(i, pairs.getKey());
        i++;

    }

}

From source file:com.nest5.businessClient.Initialactivity.java

private void makeInventoryTable(List<Ingredient> ingredients) {
    inventoryTable.removeAllViews();//w w  w.  j  a v  a  2 s .  com
    Double total = 0.0;
    DecimalFormat dec = new DecimalFormat("$###,###,###");
    TextView tv = new TextView(mContext);
    tv.setBackgroundColor(Color.parseColor("#80808080"));
    tv.setHeight(2);
    TableRow tr1 = (TableRow) getLayoutInflater().inflate(R.layout.inventory_table_row, null);
    TextView tDate1 = (TextView) tr1.findViewById(R.id.cell_date);
    TextView tItem1 = (TextView) tr1.findViewById(R.id.cell_type);
    TextView tAccount1 = (TextView) tr1.findViewById(R.id.cell_qty);
    TextView tVal1 = (TextView) tr1.findViewById(R.id.cell_unit_value);
    TextView tTot1 = (TextView) tr1.findViewById(R.id.cell_total_value);
    TextView tTotTot1 = (TextView) tr1.findViewById(R.id.cell_total_total);
    tDate1.setText("FECHA");
    tAccount1.setText("CANTIDAD");
    tItem1.setText("TIPO");
    tVal1.setText("VALOR\nUNIDAD");
    tTot1.setText("TOTAL\nITEM");
    tTotTot1.setText("TOTAL");
    tr1.setBackgroundColor(Color.CYAN);
    inventoryTable.addView(tr1);
    inventoryTable.addView(tv);

    for (Ingredient current : ingredients) {

        Calendar date = Calendar.getInstance();
        date.setTimeInMillis(current.getDate());
        String fecha = date.get(Calendar.MONTH) + "/" + date.get(Calendar.DAY_OF_MONTH) + "/"
                + date.get(Calendar.YEAR) + "\n" + date.get(Calendar.HOUR_OF_DAY) + ":"
                + date.get(Calendar.MINUTE) + ":" + date.get(Calendar.SECOND);

        Double localVal = current.getQty() * current.getCostPerUnit();
        total += localVal;

        TableRow tr = (TableRow) getLayoutInflater().inflate(R.layout.inventory_table_row, null);
        TextView tDate = (TextView) tr.findViewById(R.id.cell_date);
        TextView tType = (TextView) tr.findViewById(R.id.cell_type);
        TextView tQty = (TextView) tr.findViewById(R.id.cell_qty);
        TextView tVal = (TextView) tr.findViewById(R.id.cell_unit_value);
        TextView tTot = (TextView) tr.findViewById(R.id.cell_total_value);
        TextView tTotTot = (TextView) tr.findViewById(R.id.cell_total_total);

        tDate.setText(fecha);
        tType.setText("E");
        tQty.setText(String.valueOf(current.getQty()));
        tVal.setText(dec.format(current.getCostPerUnit()));
        tTot.setText(dec.format(localVal));
        tTotTot.setText(" ----- ");

        inventoryTable.addView(tr);

    }

    TableRow tr2 = (TableRow) getLayoutInflater().inflate(R.layout.inventory_table_row, null);
    TextView tDate2 = (TextView) tr2.findViewById(R.id.cell_date);
    TextView tType2 = (TextView) tr2.findViewById(R.id.cell_type);
    TextView tQty2 = (TextView) tr2.findViewById(R.id.cell_qty);
    TextView tVal2 = (TextView) tr2.findViewById(R.id.cell_unit_value);
    TextView tTot2 = (TextView) tr2.findViewById(R.id.cell_total_value);
    TextView tTotTot2 = (TextView) tr2.findViewById(R.id.cell_total_total);

    tDate2.setText("------");
    tType2.setText("-----");
    tQty2.setText("-----");
    tVal2.setText("-----");
    tTot2.setText("TOTAL GENERAL");
    tTotTot2.setText(dec.format(total));
    tr2.setBackgroundColor(Color.LTGRAY);
    inventoryTable.addView(tr2);

}

From source file:com.nest5.businessClient.Initialactivity.java

private void makeDailyTable(int TABLE_TYPE) {
    dailyTable.removeAllViews();/*from w  w  w. jav a2  s .co  m*/
    Double total = 0.0;
    DecimalFormat dec = new DecimalFormat("$###,###,###");
    TextView tv = new TextView(mContext);
    tv.setBackgroundColor(Color.parseColor("#80808080"));
    tv.setHeight(2);
    TableRow tr1 = (TableRow) getLayoutInflater().inflate(R.layout.daily_table_row, null);
    TextView tDate1 = (TextView) tr1.findViewById(R.id.cell_date);
    TextView tItem1 = (TextView) tr1.findViewById(R.id.cell_item);
    TextView tAccount1 = (TextView) tr1.findViewById(R.id.cell_account);
    TextView tVal1 = (TextView) tr1.findViewById(R.id.cell_value);
    TextView tTot1 = (TextView) tr1.findViewById(R.id.cell_total);
    tDate1.setText("FECHA");
    tAccount1.setText("CUENTA");
    tItem1.setText("ITEM");
    tVal1.setText("VALOR");
    tTot1.setText("TOTAL");
    tr1.setBackgroundColor(Color.CYAN);
    dailyTable.addView(tr1);
    dailyTable.addView(tv);

    //actualizar sales de hoy
    Calendar today = Calendar.getInstance();
    Calendar tomorrow = Calendar.getInstance();
    today.set(Calendar.HOUR, 0);
    today.set(Calendar.HOUR_OF_DAY, 0);
    today.set(Calendar.MINUTE, 0);
    today.set(Calendar.SECOND, 0);
    today.set(Calendar.MILLISECOND, 0);
    tomorrow.roll(Calendar.DATE, 1);
    tomorrow.set(Calendar.HOUR, 0);
    tomorrow.set(Calendar.HOUR_OF_DAY, 0);
    tomorrow.set(Calendar.MINUTE, 0);
    tomorrow.set(Calendar.SECOND, 0);
    tomorrow.set(Calendar.MILLISECOND, 0);

    init = today.getTimeInMillis();
    end = tomorrow.getTimeInMillis();
    Log.d("GUARDANDOVENTA", today.toString());
    Log.d("GUARDANDOVENTA", tomorrow.toString());
    Calendar now = Calendar.getInstance();
    now.setTimeInMillis(System.currentTimeMillis());
    Log.d(TAG, now.toString());

    Log.d(TAG, "Diferencia entre tiempos: " + String.valueOf(end - init));
    salesFromToday = saleDataSource.getAllSalesWithin(init, end);

    List<Sale> usingSales = salesFromToday;

    switch (TABLE_TYPE) {
    case TABLE_TYPE_TODAY:
        usingSales = salesFromToday;
        break;
    case TABLE_TYPE_ALL:
        usingSales = saleList;
        break;
    }

    for (Sale currentSale : usingSales) {

        double totalLocal = 0.0;
        LinkedHashMap<Combo, Double> combos = currentSale.getCombos();
        LinkedHashMap<Product, Double> products = currentSale.getProducts();
        LinkedHashMap<Ingredient, Double> ingredients = currentSale.getIngredients();
        Log.w("DAYILETABLES", " " + combos.size() + " " + products.size() + " " + ingredients.size());
        Iterator<Entry<Combo, Double>> it = combos.entrySet().iterator();
        Calendar date = Calendar.getInstance();
        date.setTimeInMillis(currentSale.getDate());
        String fecha = date.get(Calendar.MONTH) + "/" + date.get(Calendar.DAY_OF_MONTH) + "/"
                + date.get(Calendar.YEAR) + "\n" + date.get(Calendar.HOUR_OF_DAY) + ":"
                + date.get(Calendar.MINUTE) + ":" + date.get(Calendar.SECOND);
        String account = currentSale.getPaymentMethod();
        while (it.hasNext()) {
            TableRow tr = (TableRow) getLayoutInflater().inflate(R.layout.daily_table_row, null);
            TextView tDate = (TextView) tr.findViewById(R.id.cell_date);
            TextView tItem = (TextView) tr.findViewById(R.id.cell_item);
            TextView tAccount = (TextView) tr.findViewById(R.id.cell_account);
            TextView tVal = (TextView) tr.findViewById(R.id.cell_value);
            TextView tTot = (TextView) tr.findViewById(R.id.cell_total);
            Map.Entry<Combo, Double> pair = (Map.Entry<Combo, Double>) it.next();
            Double value = pair.getValue() * pair.getKey().getPrice();

            tDate.setText(fecha);
            tAccount.setText(account);
            tItem.setText(pair.getKey().getName() + " en Combo");
            tVal.setText(dec.format(value));
            tTot.setText("----");
            total += value;
            totalLocal += value;
            dailyTable.addView(tr);

            // Log.d("INGREDIENTES","INGREDIENTE: "+ingrediente.getKey().getName()+" "+ingrediente.getValue());
        }

        Iterator<Entry<Product, Double>> it2 = products.entrySet().iterator();

        while (it2.hasNext()) {
            Map.Entry<Product, Double> pair = (Map.Entry<Product, Double>) it2.next();
            TableRow tr = (TableRow) getLayoutInflater().inflate(R.layout.daily_table_row, null);
            TextView tDate = (TextView) tr.findViewById(R.id.cell_date);
            TextView tItem = (TextView) tr.findViewById(R.id.cell_item);
            TextView tAccount = (TextView) tr.findViewById(R.id.cell_account);
            TextView tVal = (TextView) tr.findViewById(R.id.cell_value);
            TextView tTot = (TextView) tr.findViewById(R.id.cell_total);

            Double value = pair.getValue() * pair.getKey().getPrice();

            tDate.setText(fecha);
            tAccount.setText(account);
            tItem.setText(pair.getKey().getName());
            tVal.setText(dec.format(value));
            tTot.setText("----");
            total += value;
            totalLocal += value;
            dailyTable.addView(tr);

            // Log.d("INGREDIENTES","INGREDIENTE: "+ingrediente.getKey().getName()+" "+ingrediente.getValue());
        }

        Iterator<Entry<Ingredient, Double>> it3 = ingredients.entrySet().iterator();

        while (it3.hasNext()) {
            Map.Entry<Ingredient, Double> pair = (Map.Entry<Ingredient, Double>) it3.next();
            TableRow tr = (TableRow) getLayoutInflater().inflate(R.layout.daily_table_row, null);
            TextView tDate = (TextView) tr.findViewById(R.id.cell_date);
            TextView tItem = (TextView) tr.findViewById(R.id.cell_item);
            TextView tAccount = (TextView) tr.findViewById(R.id.cell_account);
            TextView tVal = (TextView) tr.findViewById(R.id.cell_value);
            TextView tTot = (TextView) tr.findViewById(R.id.cell_total);

            Double value = pair.getValue() * pair.getKey().getPrice();

            tDate.setText(fecha);
            tAccount.setText(account);
            tItem.setText(pair.getKey().getName());
            tVal.setText(dec.format(value));
            tTot.setText("----");
            total += value;
            totalLocal += value;
            dailyTable.addView(tr);

            // Log.d("INGREDIENTES","INGREDIENTE: "+ingrediente.getKey().getName()+" "+ingrediente.getValue());
        }

        TableRow tr = (TableRow) getLayoutInflater().inflate(R.layout.daily_table_row, null);
        TextView tDate = (TextView) tr.findViewById(R.id.cell_date);
        TextView tItem = (TextView) tr.findViewById(R.id.cell_item);
        TextView tAccount = (TextView) tr.findViewById(R.id.cell_account);
        TextView tVal = (TextView) tr.findViewById(R.id.cell_value);
        TextView tTot = (TextView) tr.findViewById(R.id.cell_total);

        tDate.setText(fecha);
        tAccount.setText("-------");
        tItem.setText("Ingreso por Ventas");
        tVal.setText("----");
        tTot.setText(dec.format(totalLocal));
        tr.setBackgroundColor(Color.LTGRAY);
        dailyTable.addView(tr);
        TableRow tr2 = (TableRow) getLayoutInflater().inflate(R.layout.daily_table_row, null);
        TextView tDate2 = (TextView) tr2.findViewById(R.id.cell_date);
        TextView tItem2 = (TextView) tr2.findViewById(R.id.cell_item);
        TextView tAccount2 = (TextView) tr2.findViewById(R.id.cell_account);
        TextView tVal2 = (TextView) tr2.findViewById(R.id.cell_value);
        TextView tTot2 = (TextView) tr2.findViewById(R.id.cell_total);

        tDate2.setText(fecha);
        tAccount2.setText("-------");
        tItem2.setText("Acumulado por Ventas");
        tVal2.setText("----");
        tTot2.setText(dec.format(total));
        tr2.setBackgroundColor(Color.GRAY);
        dailyTable.addView(tr2);

    }

}