Example usage for android.graphics Paint STRIKE_THRU_TEXT_FLAG

List of usage examples for android.graphics Paint STRIKE_THRU_TEXT_FLAG

Introduction

In this page you can find the example usage for android.graphics Paint STRIKE_THRU_TEXT_FLAG.

Prototype

int STRIKE_THRU_TEXT_FLAG

To view the source code for android.graphics Paint STRIKE_THRU_TEXT_FLAG.

Click Source Link

Document

Paint flag that applies a strike-through decoration to drawn text.

Usage

From source file:cn.longchou.wholesale.activity.VehicleDetailActivity.java

@Override
 public void initData() {
     mTitle.setText("");
     ///*from   w  w w. j  a  va2  s . c om*/
     mOldMoney.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);

     cars = (Cars) getIntent().getExtras().getSerializable("cars");

     //??
     setAttention();

     //??
     setCartCat();

     mTvCarId.setText("ID:" + cars.carID);

     mCarDescrip.setText(cars.carName);
     boolean isCertified = PreferUtils.getBoolean(getApplicationContext(), "isCertified", false);
     if (isCertified) {
         if ("".equals(cars.carPrice)) {
             mMoney.setTextColor(Color.GRAY);
             mMoney.setTextSize(12);
             mMoney_Wan.setVisibility(View.GONE);
         } else {

             mMoney_Wan.setVisibility(View.VISIBLE);
         }
         //?
         mMoney.setText(cars.carPrice + "");
         //?
         mEarnestText.setVisibility(View.VISIBLE);
         mEarnest.setText(cars.carSubscription + "");
     } else {
         //??????
         mMoney.setText("??");
         mMoney.setTextSize(14);
         mMoney_Wan.setVisibility(View.GONE);

         //??
         mEarnestText.setVisibility(View.INVISIBLE);

     }

     mMark.setImageResource(R.drawable.miao);

     //
     getSerVerCarVisitData();

     getServerData(cars);

     mScrollView.fullScroll(ScrollView.FOCUS_UP);
     handler.sendEmptyMessage(1);

     getCarMaintenanceData();
 }

From source file:io.realm.realmtasks.list.ItemViewHolder.java

public void setStrikeThroughRatio(float strikeThroughRatio) {
    final CharSequence text = this.text.getText();
    final int textLength = text.length();
    int firstLength = (int) (textLength * strikeThroughRatio);
    if (firstLength > textLength) {
        firstLength = textLength;/*from  ww w.  ja v a2s. c  om*/
    } else if (firstLength == textLength - 1) {
        firstLength = textLength;
    }
    if (firstLength == previousFirstLength) {
        return;
    }
    previousFirstLength = firstLength;
    final int appendedLength = textLength - firstLength;
    final SpannableStringBuilder stringBuilder = new SpannableStringBuilder(text, 0, textLength);
    stringBuilder.clearSpans();
    this.text.setPaintFlags(this.text.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG);
    final CharacterStyle firstCharStyle, secondCharStyle;
    if (completed) {
        firstCharStyle = new ForegroundColorSpan(cellCompletedColor);
        secondCharStyle = new StrikethroughSpan();
    } else {
        firstCharStyle = new StrikethroughSpan();
        secondCharStyle = new ForegroundColorSpan(cellDefaultColor);
    }
    stringBuilder.setSpan(firstCharStyle, 0, firstLength, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
    stringBuilder.setSpan(secondCharStyle, textLength - appendedLength, textLength,
            Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
    this.text.setText(stringBuilder);
}

From source file:com.ultramegasoft.flavordex2.fragment.EditCatFragment.java

/**
 * Add a row to the provided TableLayout. The row contains an EditText for the field name with a
 * delete button. The delete button becomes an undo button if the provided listener allows undo.
 * If undo is not allowed, the delete button will remove the row.
 *
 * @param tableLayout The TableLayout to add a row to
 * @param text        The text to fill the text field
 * @param maxLength   The maximum allowed length of the text field
 * @param hint        The hint for the EditText
 * @param deleteHint  The contentDescription for the delete Button
 * @param deleted     The initial deleted status of the field
 * @param listener    The event listener for the field
 *//*from  w w w  . j a v  a  2  s  . c  o m*/
private void addTableRow(@NonNull final TableLayout tableLayout, @Nullable String text, int maxLength, int hint,
        final int deleteHint, final boolean deleted, @NonNull final CatFieldListener listener) {
    final LayoutInflater inflater = LayoutInflater.from(getContext());
    final View root = inflater.inflate(R.layout.edit_cat_field, tableLayout, false);

    final InputFilter[] filters = new InputFilter[] { new InputFilter.LengthFilter(maxLength) };
    final EditText editText = root.findViewById(R.id.field_name);
    editText.setFilters(filters);
    editText.setHint(hint);
    editText.setText(text);
    editText.addTextChangedListener(new TextWatcher() {
        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {
        }

        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
        }

        @Override
        public void afterTextChanged(Editable s) {
            listener.onNameChange(s.toString());
        }
    });

    final ImageButton deleteButton = root.findViewById(R.id.button_delete);
    deleteButton.setContentDescription(getString(deleteHint));
    deleteButton.setOnClickListener(new View.OnClickListener() {
        private boolean mDeleted = deleted;

        @Override
        public void onClick(View v) {
            if (mDeleted) {
                setDeleted(false);
                listener.onUndoDelete();
            } else {
                if (!listener.allowUndo()) {
                    tableLayout.removeView(root);
                } else {
                    setDeleted(true);
                }
                listener.onDelete();
            }
        }

        private void setDeleted(boolean deleted) {
            mDeleted = deleted;
            editText.setEnabled(!deleted);
            if (deleted) {
                deleteButton.setImageResource(R.drawable.ic_undo);
                deleteButton.setContentDescription(getString(R.string.button_undo));
                editText.setPaintFlags(editText.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
            } else {
                deleteButton.setImageResource(R.drawable.ic_clear);
                deleteButton.setContentDescription(getString(deleteHint));
                editText.setPaintFlags(editText.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG);
            }
        }
    });

    if (deleted) {
        editText.setEnabled(false);
        deleteButton.setImageResource(R.drawable.ic_undo);
        deleteButton.setContentDescription(getString(R.string.button_undo));
        editText.setPaintFlags(editText.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
    }

    tableLayout.addView(root);
    if (TextUtils.isEmpty(text)) {
        editText.requestFocus();
    }
}

From source file:com.todoroo.astrid.adapter.TaskAdapter.java

/** Helper method to adjust a tasks' appearance if the task is completed or
 * uncompleted.//from  w  w  w  .j a va2s  . com
 */
private void setTaskAppearance(ViewHolder viewHolder, Task task) {
    boolean completed = task.isCompleted();

    TextView name = viewHolder.nameView;
    if (completed) {
        name.setEnabled(false);
        name.setPaintFlags(name.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
    } else {
        name.setEnabled(true);
        name.setPaintFlags(name.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG);
    }
    name.setTextSize(fontSize);

    setupDueDateAndTags(viewHolder, task);

    float detailTextSize = Math.max(10, fontSize * 14 / 20);
    if (viewHolder.dueDate != null) {
        viewHolder.dueDate.setTextSize(detailTextSize);
        viewHolder.dueDate.setTypeface(null, 0);
    }

    setupCompleteBox(viewHolder);
}

From source file:com.example.android.todolist.AddTaskActivity.java

public void setCalender() {
    Calendar curunt_calender = Calendar.getInstance();
    curunt_calender.setTimeInMillis(System.currentTimeMillis());

    final Calendar cal = new GregorianCalendar();
    cal.set(Calendar.YEAR, year);
    cal.set(Calendar.MONTH, monthOfYear);
    cal.set(Calendar.DAY_OF_MONTH, dayOfMonth);
    cal.set(Calendar.HOUR_OF_DAY, this.hourOfDay);
    cal.set(Calendar.MINUTE, this.minute);
    cal.set(Calendar.SECOND, this.second);

    time = cal.getTimeInMillis();// w  w w .  ja v  a  2s . c o m
    SimpleDateFormat format1 = new SimpleDateFormat("E h:mm  a");
    formated_time.setText(format1.format(cal.getTime()));
    if (cal.getTimeInMillis() + 5000 < System.currentTimeMillis()) {
        formated_time.setPaintFlags(formated_time.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
    } else {
        formated_time.setPaintFlags(formated_time.getPaintFlags() & (~Paint.STRIKE_THRU_TEXT_FLAG));
    }

}

From source file:com.hypodiabetic.happ.MainActivity.java

public void displayCurrentInfo() {
    final TextView currentBgValueText = (TextView) findViewById(R.id.currentBgValueRealTime);
    final TextView notificationText = (TextView) findViewById(R.id.notices);
    final TextView deltaText = (TextView) findViewById(R.id.bgDelta);
    if ((currentBgValueText.getPaintFlags() & Paint.STRIKE_THRU_TEXT_FLAG) > 0) {
        currentBgValueText.setPaintFlags(currentBgValueText.getPaintFlags() & (~Paint.STRIKE_THRU_TEXT_FLAG));
    }/*from  w w w.  ja  va2  s.  c o  m*/
    Bg lastBgreading = Bg.last();

    if (lastBgreading != null) {
        notificationText.setText(lastBgreading.readingAge());
        String bgDelta = tools.unitizedBG(lastBgreading.bgdelta, MainApp.instance().getApplicationContext());
        if (lastBgreading.bgdelta >= 0)
            bgDelta = "+" + bgDelta;
        deltaText.setText(bgDelta);
        currentBgValueText.setText(extendedGraphBuilder.unitized_string(lastBgreading.sgv_double()) + " "
                + lastBgreading.slopeArrow());

        if ((new Date().getTime()) - (60000 * 16) - lastBgreading.datetime > 0) {
            notificationText.setTextColor(Color.parseColor("#C30909"));
            currentBgValueText.setPaintFlags(currentBgValueText.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
        } else {
            notificationText.setTextColor(Color.WHITE);
        }
        double estimate = lastBgreading.sgv_double();
        if (extendedGraphBuilder.unitized(estimate) <= extendedGraphBuilder.lowMark) {
            currentBgValueText.setTextColor(Color.parseColor("#C30909"));
        } else if (extendedGraphBuilder.unitized(estimate) >= extendedGraphBuilder.highMark) {
            currentBgValueText.setTextColor(Color.parseColor("#FFBB33"));
        } else {
            currentBgValueText.setTextColor(Color.WHITE);
        }
    }

    //Stats UI update
    updateStats(null);

    //OpenAPS UI update
    updateOpenAPSDetails(null);

    //Temp Basal running update
    updateRunningTemp();
}

From source file:com.shopify.buy.ui.ProductDetailsFragmentView.java

/**
 * Fills in the views with all the {@link Product} details.
 *//*from   www.  j av a 2s .  c  o  m*/
private void updateProductDetails() {
    Resources res = getResources();

    findViewById(R.id.product_details_container).setBackgroundColor(theme.getBackgroundColor(res));

    // Product title
    TextView textViewTitle = (TextView) findViewById(R.id.product_title);
    textViewTitle.setText(product.getTitle());
    textViewTitle.setTextColor(theme.getProductTitleColor(res));

    // Product price
    TextView textViewPrice = (TextView) findViewById(R.id.product_price);
    String priceWithCurrency = currencyFormat.format(Double.parseDouble(variant.getPrice()));
    textViewPrice.setText(priceWithCurrency);
    textViewPrice.setTextColor(theme.getAccentColor());

    // Product "compare at" price (appears below the actual price with a strikethrough style)
    TextView textViewCompareAtPrice = (TextView) findViewById(R.id.product_compare_at_price);
    if (!variant.isAvailable()) {
        textViewCompareAtPrice.setVisibility(View.VISIBLE);
        textViewCompareAtPrice.setText(getResources().getString(R.string.sold_out));
        textViewCompareAtPrice.setTextColor(getResources().getColor(R.color.error_background));
        textViewCompareAtPrice.setPaintFlags(0);
    } else if (!TextUtils.isEmpty(variant.getCompareAtPrice())) {
        textViewCompareAtPrice.setVisibility(View.VISIBLE);
        String compareAtPriceWithCurrency = currencyFormat
                .format(Double.parseDouble(variant.getCompareAtPrice()));
        textViewCompareAtPrice.setText(compareAtPriceWithCurrency);
        textViewCompareAtPrice.setTextColor(theme.getCompareAtPriceColor(res));
        textViewCompareAtPrice
                .setPaintFlags(textViewCompareAtPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
    } else {
        textViewCompareAtPrice.setVisibility(View.GONE);
    }

    // Set the correct values on the ProductDetailsVariantOptionViews
    List<OptionValue> optionValues = variant.getOptionValues();
    for (OptionValue optionValue : optionValues) {
        ProductDetailsVariantOptionView optionView = visibleOptionViews
                .get(Long.valueOf(optionValue.getOptionId()));
        if (optionView != null) {
            optionView.setOptionValue(optionValue);
        }
    }

    // Product description
    TextView textViewDescription = (TextView) findViewById(R.id.product_description);
    textViewDescription.setText(Html.fromHtml(product.getBodyHtml()), TextView.BufferType.SPANNABLE);
    textViewDescription.setTextColor(theme.getProductDescriptionColor(res));

    // Make the links clickable in the description
    // http://stackoverflow.com/questions/2734270/how-do-i-make-links-in-a-textview-clickable
    textViewDescription.setMovementMethod(LinkMovementMethod.getInstance());
}

From source file:com.songcode.materialnotes.ui.NoteEditActivity.java

private View getListItem(String item, int index) {
    View view = LayoutInflater.from(this).inflate(R.layout.note_edit_list_item, null);
    final NoteEditText edit = (NoteEditText) view.findViewById(R.id.et_edit_text);
    edit.setTextAppearance(this, TextAppearanceResources.getTexAppearanceResource(mFontSizeId));
    CheckBox cb = ((CheckBox) view.findViewById(R.id.cb_edit_item));
    cb.setOnCheckedChangeListener(new OnCheckedChangeListener() {
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if (isChecked) {
                edit.setPaintFlags(edit.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
            } else {
                edit.setPaintFlags(Paint.ANTI_ALIAS_FLAG | Paint.DEV_KERN_TEXT_FLAG);
            }/*from   w  ww .j  av a 2s .c  o  m*/
        }
    });

    if (item.startsWith(TAG_CHECKED)) {
        cb.setChecked(true);
        edit.setPaintFlags(edit.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
        item = item.substring(TAG_CHECKED.length(), item.length()).trim();
    } else if (item.startsWith(TAG_UNCHECKED)) {
        cb.setChecked(false);
        edit.setPaintFlags(Paint.ANTI_ALIAS_FLAG | Paint.DEV_KERN_TEXT_FLAG);
        item = item.substring(TAG_UNCHECKED.length(), item.length()).trim();
    }

    edit.setOnTextViewChangeListener(this);
    edit.setIndex(index);
    edit.setText(getHighlightQueryResult(item, mUserQuery));
    return view;
}

From source file:com.eveningoutpost.dexdrip.Home.java

private void displayCurrentInfo() {
    DecimalFormat df = new DecimalFormat("#");
    df.setMaximumFractionDigits(0);// w  w  w .j  av  a2  s  . c  o  m

    final boolean isDexbridge = CollectionServiceStarter.isDexBridgeOrWifiandDexBridge();
    final boolean hasBtWixel = DexCollectionType.hasBtWixel();
    final boolean isLimitter = CollectionServiceStarter.isLimitter();
    //boolean isWifiWixel = CollectionServiceStarter.isWifiandBTWixel(getApplicationContext()) | CollectionServiceStarter.isWifiWixel(getApplicationContext());
    //  if (isDexbridge||isLimitter||hasBtWixel||is_follower) {
    if (DexCollectionType.hasBattery()) {
        final int bridgeBattery = prefs.getInt("bridge_battery", 0);

        if (bridgeBattery < 1) {
            //dexbridgeBattery.setText(R.string.waiting_for_packet);
            dexbridgeBattery.setVisibility(View.INVISIBLE);
        } else {
            if (isDexbridge) {
                dexbridgeBattery.setText(getString(R.string.xbridge_battery) + ": " + bridgeBattery + "%");
            } else if (isLimitter) {
                dexbridgeBattery.setText(getString(R.string.limitter_battery) + ": " + bridgeBattery + "%");
            } else {
                dexbridgeBattery.setText(
                        "Bridge battery" + ": " + bridgeBattery + ((bridgeBattery < 200) ? "%" : "mV"));
            }
        }
        if (bridgeBattery < 50)
            dexbridgeBattery.setTextColor(Color.YELLOW);
        if (bridgeBattery < 25)
            dexbridgeBattery.setTextColor(Color.RED);
        else
            dexbridgeBattery.setTextColor(Color.GREEN);
        dexbridgeBattery.setVisibility(View.VISIBLE);

    } else {
        dexbridgeBattery.setVisibility(View.INVISIBLE);
    }
    if (DexCollectionType.hasWifi()) {
        final int bridgeBattery = prefs.getInt("parakeet_battery", 0);
        if (bridgeBattery > 0) {
            if (bridgeBattery < 50) {
                parakeetBattery.setText(getString(R.string.parakeet_battery) + ": " + bridgeBattery + "%");

                if (bridgeBattery < 40) {
                    parakeetBattery.setTextColor(Color.RED);
                } else {
                    parakeetBattery.setTextColor(Color.YELLOW);
                }
                parakeetBattery.setVisibility(View.VISIBLE);
            } else {
                parakeetBattery.setVisibility(View.INVISIBLE);
            }
        }
    } else {
        parakeetBattery.setVisibility(View.INVISIBLE);
    }
    if (!prefs.getBoolean("display_bridge_battery", true)) {
        dexbridgeBattery.setVisibility(View.INVISIBLE);
        parakeetBattery.setVisibility(View.INVISIBLE);
    }

    final int sensor_age = prefs.getInt("nfc_sensor_age", 0);
    if ((sensor_age > 0) && (DexCollectionType.hasLibre())) {
        sensorAge.setText("Age: " + JoH.qs(((double) sensor_age) / 1440, 1) + "d"
                + (Home.getPreferencesBooleanDefaultFalse("nfc_age_problem") ? " \u26A0\u26A0\u26A0" : ""));
        sensorAge.setVisibility(View.VISIBLE);
        if (sensor_age < 1440) {
            sensorAge.setTextColor(Color.YELLOW);
        } else if (sensor_age < (1440 * 12)) {
            sensorAge.setTextColor(Color.GREEN);
        } else {
            sensorAge.setTextColor(Color.RED);
        }
    } else {
        sensorAge.setVisibility(View.GONE);
    }
    if (blockTouches) {
        sensorAge.setText("SCANNING.. DISPLAY LOCKED!");
        sensorAge.setVisibility(View.VISIBLE);
        sensorAge.setTextColor(Color.GREEN);
    }

    if ((currentBgValueText.getPaintFlags() & Paint.STRIKE_THRU_TEXT_FLAG) > 0) {
        currentBgValueText.setPaintFlags(currentBgValueText.getPaintFlags() & (~Paint.STRIKE_THRU_TEXT_FLAG));
        dexbridgeBattery.setPaintFlags(dexbridgeBattery.getPaintFlags() & (~Paint.STRIKE_THRU_TEXT_FLAG));
        if (get_follower()) {
            GcmActivity.requestPing();
        }
    }
    BgReading lastBgReading = BgReading.lastNoSenssor();
    boolean predictive = PreferenceManager.getDefaultSharedPreferences(getApplicationContext())
            .getBoolean("predictive_bg", false);
    if (isBTShare) {
        predictive = false;
    }
    if (lastBgReading != null) {
        displayCurrentInfoFromReading(lastBgReading, predictive);
    } else {
        display_delta = "";
    }

    if (prefs.getBoolean("extra_status_line", false)) {
        extraStatusLineText.setText(extraStatusLine());
        extraStatusLineText.setVisibility(View.VISIBLE);
    } else {
        extraStatusLineText.setText("");
        extraStatusLineText.setVisibility(View.GONE);
    }
}

From source file:com.eveningoutpost.dexdrip.Home.java

private void displayCurrentInfoFromReading(BgReading lastBgReading, boolean predictive) {
    double estimate = 0;
    double estimated_delta = 0;

    String slope_arrow = lastBgReading.slopeArrow();
    String extrastring = "";
    if ((new Date().getTime()) - stale_data_millis() - lastBgReading.timestamp > 0) {
        notificationText.setText(R.string.signal_missed);
        if (!predictive) {
            estimate = lastBgReading.calculated_value;
        } else {/*from   w  ww .j ava  2  s. c  om*/
            estimate = BgReading.estimated_bg(lastBgReading.timestamp + (6000 * 7));
        }
        currentBgValueText.setText(bgGraphBuilder.unitized_string(estimate));
        currentBgValueText.setPaintFlags(currentBgValueText.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
        dexbridgeBattery.setPaintFlags(dexbridgeBattery.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
    } else {
        if (notificationText.getText().length() == 0) {
            notificationText.setTextColor(Color.WHITE);
        }
        boolean bg_from_filtered = prefs.getBoolean("bg_from_filtered", false);
        if (!predictive) {

            estimate = lastBgReading.calculated_value; // normal
            currentBgValueText.setTypeface(null, Typeface.NORMAL);

            // if noise has settled down then switch off filtered mode
            if ((bg_from_filtered) && (BgGraphBuilder.last_noise < BgGraphBuilder.NOISE_FORGIVE)
                    && (prefs.getBoolean("bg_compensate_noise", false))) {
                bg_from_filtered = false;
                prefs.edit().putBoolean("bg_from_filtered", false).apply();

            }

            if ((BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER)
                    && (BgGraphBuilder.best_bg_estimate > 0) && (BgGraphBuilder.last_bg_estimate > 0)
                    && (prefs.getBoolean("bg_compensate_noise", false))) {
                estimate = BgGraphBuilder.best_bg_estimate; // this maybe needs scaling based on noise intensity
                estimated_delta = BgGraphBuilder.best_bg_estimate - BgGraphBuilder.last_bg_estimate;
                slope_arrow = BgReading
                        .slopeToArrowSymbol(estimated_delta / (BgGraphBuilder.DEXCOM_PERIOD / 60000)); // delta by minute
                currentBgValueText.setTypeface(null, Typeface.ITALIC);
                extrastring = "\u26A0"; // warning symbol !
            }

            if ((BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_HIGH) && (DexCollectionType.hasFiltered())) {
                bg_from_filtered = true; // force filtered mode
            }

            if (bg_from_filtered) {
                currentBgValueText
                        .setPaintFlags(currentBgValueText.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
                estimate = lastBgReading.filtered_calculated_value;
            } else {
                currentBgValueText
                        .setPaintFlags(currentBgValueText.getPaintFlags() & ~Paint.UNDERLINE_TEXT_FLAG);
            }
            String stringEstimate = bgGraphBuilder.unitized_string(estimate);
            if ((lastBgReading.hide_slope) || (bg_from_filtered)) {
                slope_arrow = "";
            }
            currentBgValueText.setText(stringEstimate + " " + slope_arrow);
        } else {
            estimate = BgReading.activePrediction();
            String stringEstimate = bgGraphBuilder.unitized_string(estimate);
            currentBgValueText.setText(stringEstimate + " " + BgReading.activeSlopeArrow());
        }
        if (extrastring.length() > 0)
            currentBgValueText.setText(extrastring + currentBgValueText.getText());
    }
    int minutes = (int) (System.currentTimeMillis() - lastBgReading.timestamp) / (60 * 1000);

    if ((!small_width) || (notificationText.length() > 0))
        notificationText.append("\n");
    if (!small_width) {
        notificationText.append(minutes + ((minutes == 1) ? getString(R.string.space_minute_ago)
                : getString(R.string.space_minutes_ago)));
    } else {
        // small screen
        notificationText.append(minutes + getString(R.string.space_mins));
        currentBgValueText.setPadding(0, 0, 0, 0);
    }

    if (small_screen) {
        if (currentBgValueText.getText().length() > 4)
            currentBgValueText.setTextSize(25);
    }

    // do we actually need to do this query here if we again do it in unitizedDeltaString
    List<BgReading> bgReadingList = BgReading.latest(2, is_follower);
    if (bgReadingList != null && bgReadingList.size() == 2) {
        // same logic as in xDripWidget (refactor that to BGReadings to avoid redundancy / later inconsistencies)?

        display_delta = bgGraphBuilder.unitizedDeltaString(true, true, is_follower);

        // TODO reduce duplication of logic
        if ((BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER) && (BgGraphBuilder.best_bg_estimate > 0)
                && (BgGraphBuilder.last_bg_estimate > 0) && (prefs.getBoolean("bg_compensate_noise", false))) {
            //final double estimated_delta = BgGraphBuilder.best_bg_estimate - BgGraphBuilder.last_bg_estimate;
            display_delta = bgGraphBuilder.unitizedDeltaStringRaw(true, true, estimated_delta);
            addDisplayDelta();
            if (!prefs.getBoolean("show_noise_workings", false)) {
                notificationText.append("\nNoise: " + bgGraphBuilder.noiseString(BgGraphBuilder.last_noise));
            }
        } else {
            addDisplayDelta();
        }

    }
    if (bgGraphBuilder.unitized(estimate) <= bgGraphBuilder.lowMark) {
        currentBgValueText.setTextColor(Color.parseColor("#C30909"));
    } else if (bgGraphBuilder.unitized(estimate) >= bgGraphBuilder.highMark) {
        currentBgValueText.setTextColor(Color.parseColor("#FFBB33"));
    } else {
        currentBgValueText.setTextColor(Color.WHITE);
    }
}