Example usage for android.graphics Typeface BOLD

List of usage examples for android.graphics Typeface BOLD

Introduction

In this page you can find the example usage for android.graphics Typeface BOLD.

Prototype

int BOLD

To view the source code for android.graphics Typeface BOLD.

Click Source Link

Usage

From source file:com.odoo.OdooActivity.java

private View generateView(String title, int res_id) {
    View view = LayoutInflater.from(this).inflate(R.layout.base_drawer_account_item, mDrawerAccountContainer,
            false);//w  w w. j ava  2  s.c o  m
    OControls.setGone(view, R.id.profile_url_text);
    ImageView icon = (ImageView) view.findViewById(R.id.profile_image);
    icon.setImageResource(res_id);
    icon.setColorFilter(OResource.color(this, R.color.body_text_2));
    TextView name = (TextView) view.findViewById(R.id.profile_name_text);
    name.setTypeface(name.getTypeface(), Typeface.BOLD);
    name.setText(title);
    return view;
}

From source file:eu.iescities.pilot.rovereto.roveretoexplorer.fragments.event.info.EventDetailInfoAdapter.java

public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parentView) {

    EventInfoParent parent = this.fragment.parents.get(groupPosition);
    ////from ww w .j  a va 2  s. c o m
    // Log.i("GROUPVIEW", "************ init group view!! ************ ");
    // Log.i("GROUPVIEW", "COUNT: " + countGroupViewCall);
    // Log.i("GROUPVIEW", "GROUP POSITION: " + groupPosition);
    // Log.i("GROUPVIEW", "tag group set label: " + tagGroupLabelSet);

    // Inflate event_info_group_item.xml file for parent rows
    if (convertView == null) {
        LayoutInflater infalInflater = (LayoutInflater) this.fragment.context
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        convertView = infalInflater.inflate(R.layout.event_info_group_item, null);
    }

    convertView.setBackgroundResource(getBackgroundColor(groupPosition));

    // Get grouprow.xml file elements and set values
    TextView item = (TextView) convertView.findViewById(R.id.event_info_attribute_names);
    item.setTypeface(null, Typeface.BOLD);
    item.setText(parent.getText1());

    ImageView image = (ImageView) convertView.findViewById(R.id.event_info_action);
    int imageId = fragment.groupImages.get(groupPosition);
    image.setImageResource(imageId);

    image.setOnClickListener(new GroupIconClickListener(this.fragment.context, parent));

    countGroupViewCall++;
    return convertView;

}

From source file:com.saulcintero.moveon.fragments.Summary3.java

private XYMultipleSeriesRenderer getRenderer_type2(int type) {
    XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
    XYSeriesRenderer r = new XYSeriesRenderer();

    r = new XYSeriesRenderer();
    r.setFillPoints(true);//from  ww w .j  a  v  a2  s .co  m
    r.setLineWidth(2f);
    r.setDisplayChartValues(false);
    r.setChartValuesTextSize(10f);

    switch (type) {
    case 1:
        r.setColor(Color.rgb(0, 0, 188));
        r.setFillBelowLine(true);
        break;
    case 2:
        r.setColor(Color.rgb(255, 124, 0));
        break;
    }

    renderer.addSeriesRenderer(r);
    renderer.setAxesColor(Color.WHITE);
    renderer.setLabelsColor(Color.LTGRAY);
    renderer.setBackgroundColor(Color.TRANSPARENT);
    renderer.setTextTypeface("sans_serif", Typeface.BOLD);

    renderer.setLabelsTextSize(14f);
    renderer.setAxisTitleTextSize(15);
    renderer.setLegendTextSize(15);

    renderer.setXTitle(FunctionUtils.capitalizeFirtsLetter(getString(R.string.minutes)));
    renderer.setXLabels(20);
    renderer.setYLabels(20);
    renderer.setYLabelsAlign(Align.LEFT);
    renderer.setShowGrid(false);
    renderer.setXAxisMin((timeList.get(0) / 60));
    renderer.setXAxisMax((float) ((float) timeList.get(timeList.size() - 1) / 60));

    switch (type) {
    case 1:
        renderer.setYTitle(
                isMetric ? FunctionUtils.capitalizeFirtsLetter(getString(R.string.long_unit1_detail_10))
                        : FunctionUtils.capitalizeFirtsLetter(getString(R.string.long_unit2_detail_10)));
        renderer.setYAxisMin(min_altitude);
        renderer.setYAxisMax(max_altitude);
        break;
    case 2:
        renderer.setYTitle(
                isMetric ? getString(R.string.long_unit1_detail_7) : getString(R.string.long_unit2_detail_7));
        renderer.setYAxisMin(min_speed);
        renderer.setYAxisMax(max_speed);
        break;
    }

    return renderer;
}

From source file:info.hl.mediam.GroupProfileActivity.java

private void getImageDialog() {
    final Dialog imageDialog = new Dialog(GroupProfileActivity.this, R.style.TransparentDialogTheme);
    imageDialog.getWindow().setGravity(Gravity.BOTTOM);
    imageDialog.setContentView(R.layout.dialog_get_image);
    WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams();
    Window window = imageDialog.getWindow();
    layoutParams.copyFrom(window.getAttributes());
    layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
    layoutParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
    window.setAttributes(layoutParams);//from  ww  w  .  j  a  va2  s.c om

    final Button btnGallery = (Button) imageDialog.findViewById(R.id.btnGallery);
    btnGallery.setTypeface(MediamApp.getTfMyriadProBold(), Typeface.BOLD);
    btnGallery.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {

            Intent galleryIntent = new Intent(GroupProfileActivity.this, CameraCropActivity.class);
            galleryIntent.putExtra("type", "gallery");
            galleryIntent.putExtra("groupUpdate", true);
            GroupProfileActivity.this.startActivityForResult(galleryIntent, UPDATE_IMAGE_REQUEST_CODE);
            imageDialog.dismiss();

        }
    });

    final Button btnCamera = (Button) imageDialog.findViewById(R.id.btnCamera);
    btnCamera.setTypeface(MediamApp.getTfMyriadProBold(), Typeface.BOLD);
    btnCamera.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {

            Intent cameraIntent = new Intent(GroupProfileActivity.this, CameraCropActivity.class);
            cameraIntent.putExtra("type", "camera");
            cameraIntent.putExtra("groupUpdate", true);
            GroupProfileActivity.this.startActivityForResult(cameraIntent, UPDATE_IMAGE_REQUEST_CODE);
            imageDialog.dismiss();

        }
    });

    final Button btnRemovePhoto = (Button) imageDialog.findViewById(R.id.btnRemovePhoto);
    btnRemovePhoto.setTypeface(MediamApp.getTfMyriadProBold(), Typeface.BOLD);
    btnRemovePhoto.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {

            mGroupAvatarId = "";
            gGroupImage = null;
            Utils.displayImage(mGroupAvatarId, mIvGroupImage, mPbLoading, ImageLoader.LARGE,
                    R.drawable.group_stub_large, false);
            imageDialog.dismiss();

        }
    });

    imageDialog.show();
}

From source file:com.cloverstudio.spika.GroupProfileActivity.java

private void getImageDialog() {
    final Dialog imageDialog = new Dialog(GroupProfileActivity.this, R.style.TransparentDialogTheme);
    imageDialog.getWindow().setGravity(Gravity.BOTTOM);
    imageDialog.setContentView(R.layout.dialog_get_image);
    WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams();
    Window window = imageDialog.getWindow();
    layoutParams.copyFrom(window.getAttributes());
    layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
    layoutParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
    window.setAttributes(layoutParams);//  w  w w. ja  va  2s  .c o m

    final Button btnGallery = (Button) imageDialog.findViewById(R.id.btnGallery);
    btnGallery.setTypeface(SpikaApp.getTfMyriadProBold(), Typeface.BOLD);
    btnGallery.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {

            Intent galleryIntent = new Intent(GroupProfileActivity.this, CameraCropActivity.class);
            galleryIntent.putExtra("type", "gallery");
            galleryIntent.putExtra("groupUpdate", true);
            GroupProfileActivity.this.startActivityForResult(galleryIntent, UPDATE_IMAGE_REQUEST_CODE);
            imageDialog.dismiss();

        }
    });

    final Button btnCamera = (Button) imageDialog.findViewById(R.id.btnCamera);
    btnCamera.setTypeface(SpikaApp.getTfMyriadProBold(), Typeface.BOLD);
    btnCamera.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {

            Intent cameraIntent = new Intent(GroupProfileActivity.this, CameraCropActivity.class);
            cameraIntent.putExtra("type", "camera");
            cameraIntent.putExtra("groupUpdate", true);
            GroupProfileActivity.this.startActivityForResult(cameraIntent, UPDATE_IMAGE_REQUEST_CODE);
            imageDialog.dismiss();

        }
    });

    final Button btnRemovePhoto = (Button) imageDialog.findViewById(R.id.btnRemovePhoto);
    btnRemovePhoto.setTypeface(SpikaApp.getTfMyriadProBold(), Typeface.BOLD);
    btnRemovePhoto.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {

            mGroupAvatarId = "";
            gGroupImage = null;
            Utils.displayImage(mGroupAvatarId, mIvGroupImage, mPbLoading, ImageLoader.LARGE,
                    R.drawable.group_stub_large, false);
            imageDialog.dismiss();

        }
    });

    imageDialog.show();
}

From source file:com.ruesga.rview.tasks.AsyncTextDiffProcessor.java

private CharSequence processHighlightTabs(CharSequence text) {
    if (!mHighlightTabs || !text.toString().contains(StringHelper.NON_PRINTABLE_CHAR)) {
        return text;
    }//from   www .ja v  a2 s.  c o m

    int color = ContextCompat.getColor(mContext, R.color.diffHighlightColor);
    SpannableStringBuilder ssb = new SpannableStringBuilder(text);
    String line = text.toString();
    int index = line.length();
    while ((index = line.lastIndexOf(StringHelper.NON_PRINTABLE_CHAR, index)) != -1) {
        ssb.replace(index, index + 1, "\u00BB    ");
        ssb.setSpan(new ForegroundColorSpan(color), index, index + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        ssb.setSpan(new StyleSpan(Typeface.BOLD), index, index + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        index--;
    }
    return ssb;
}

From source file:com.einzig.ipst2.activities.MainActivity.java

/**
 * Method for when radiobuttons are clicked
 *
 * @param view RadioButton/*from w  w  w  . ja  v a  2  s.  c  o  m*/
 */
public void onRadioButtonClicked(View view) {
    if (!((RadioButton) view).isChecked())
        return;
    RadioButton tempButton = (RadioButton) view;
    tempButton.setTypeface(null, Typeface.BOLD);
    formatUIFromRadio(view.getId());
}

From source file:com.eurotong.orderhelperandroid.OrderMenuActivity.java

void SetStyleForOrderedMenu(VMMenulistOrder menu, TextView textViewOrderCount) {
    if (menu.OrderCount > 0) {
        textViewOrderCount.setTextColor(Color.RED);
        //textViewOrderCount.setTextSize((float) (textCountSize*1.5));
        //textViewOrderCount.setTextSize((float) (textCountSize));
        textViewOrderCount.setTypeface(null, Typeface.BOLD);
    } else {//from  w  w  w  .ja  v a2 s.co m
        textViewOrderCount.setTextColor(Color.BLACK);
        //textViewOrderCount.setTextSize((float) (textCountSize));
        textViewOrderCount.setTypeface(null, Typeface.NORMAL);
    }
}

From source file:org.otempo.view.StationActivity.java

/**
 * Actualiza la parte del layout que visualiza predicciones
 *///from w ww  .j a  v  a  2s.  c  om
private void updateLayout() {

    final LinearLayout scrolled = findViewById(R.id.scrolled);
    scrolled.removeAllViews();
    final LinearLayout predictedGroup = findViewById(R.id.predictedGroup);
    if (predictedGroup != null) { // en landscape no hay
        predictedGroup.setVisibility(LinearLayout.INVISIBLE);
    }
    final LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutUtils.dips(75, this),
            LinearLayout.LayoutParams.WRAP_CONTENT);
    Station currentStation = _stationManager.getStation();
    if (currentStation == null) {
        // Si no hay estacin elegida, nada ms que hacer...
        return;
    }
    final int currentStationId = currentStation.getId();
    if (currentStation.getPredictions().size() > 0) {
        removeDialog(DIALOG_LOADING_ID);
        if (predictedGroup != null) { // en landscape no hay
            final TextView predictionTime = findViewById(R.id.predictionTime);
            predictionTime.setText(getPredictionTimeString(currentStation.getLastCreationDate()));
            predictedGroup.setVisibility(LinearLayout.VISIBLE);
        }
        currentStation.acceptPredictionVisitor(new StationPredictionVisitor() {
            @Override
            public void apply(@NonNull StationShortTermPrediction shortPred, final int index) {
                Calendar predictionDate = shortPred.getDate();
                if (predictionDate == null || !DateUtils.isFromToday(predictionDate)) {
                    return;
                }
                LinearLayout day = new LinearLayout(StationActivity.this);
                day.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View arg0) {
                        showDialog(DIALOG_DAY_COMMENT_MASK + index + currentStationId * MAX_PREDICTED_DAYS);
                    }
                });
                day.setOrientation(LinearLayout.VERTICAL);
                TextView dayName = getDayName(shortPred.getDate());
                day.addView(dayName);
                ImageView morningIcon = new ImageView(StationActivity.this);
                morningIcon.setImageResource(ResourceUtils.getResource(shortPred.getSkyStateMorning(), true));
                day.addView(morningIcon);
                ImageView afternoonIcon = new ImageView(StationActivity.this);
                afternoonIcon
                        .setImageResource(ResourceUtils.getResource(shortPred.getSkyStateAfternoon(), true));
                day.addView(afternoonIcon);
                ImageView nightIcon = new ImageView(StationActivity.this);
                nightIcon.setImageResource(ResourceUtils.getResource(shortPred.getSkyStateNight(), false));
                day.addView(nightIcon);
                TextView temps = new TextView(StationActivity.this);
                temps.setText(shortPred.getMinTemp() + " - " + shortPred.getMaxTemp() + " C");
                temps.setGravity(Gravity.CENTER_HORIZONTAL);
                day.addView(temps);
                if (DateUtils.isToday(predictionDate)) {
                    day.setBackgroundResource(R.drawable.today_bg);
                    temps.setTypeface(Typeface.DEFAULT, Typeface.BOLD);
                    dayName.setTypeface(Typeface.DEFAULT, Typeface.BOLD);
                }
                scrolled.addView(day, params);
            }

            @Override
            public void apply(@NonNull StationMediumTermPrediction medPred, final int index) {
                Calendar predictionDate = medPred.getDate();
                if (predictionDate == null || !DateUtils.isFromToday(predictionDate)) {
                    return;
                }
                LinearLayout day = new LinearLayout(StationActivity.this);
                day.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View arg0) {
                        showDialog(DIALOG_DAY_COMMENT_MASK + index + currentStationId * MAX_PREDICTED_DAYS);
                    }
                });
                day.setOrientation(LinearLayout.VERTICAL);
                TextView dayName = getDayName(medPred.getDate());
                day.addView(dayName);
                ImageView morningIcon = new ImageView(StationActivity.this);
                morningIcon.setImageResource(ResourceUtils.getResource(medPred.getSkyState(), true));
                day.addView(morningIcon);
                TextView temps = new TextView(StationActivity.this);
                temps.setText(medPred.getMinTemp() + " - " + medPred.getMaxTemp() + " C");
                temps.setGravity(Gravity.CENTER_HORIZONTAL);
                temps.setTextColor(Color.WHITE);
                day.addView(temps);
                scrolled.addView(day, params);
            }
        });
    } else {
        // Ahora mostramos el dilogo si hace falta, y sino borramos la marca de skip
        if (_skipDialog) {
            _skipDialog = false;
        } else {
            if (!this.isFinishing()) {
                showDialog(DIALOG_LOADING_ID);
                fetchThenShow(currentStation, false);
            }
        }
    }
}

From source file:com.mifos.mifosxdroid.online.generatecollectionsheet.GenerateCollectionSheetFragment.java

private void inflateProductiveCollectionTable(CollectionSheetResponse collectionSheetResponse) {

    //Clear old views in case they are present.
    if (tableProductive.getChildCount() > 0) {
        tableProductive.removeAllViews();
    }/*from w w  w . j a v a 2 s  .c  om*/

    if (tableAdditional.getVisibility() == View.VISIBLE) {
        tableAdditional.removeAllViews();
        tableAdditional.setVisibility(View.GONE);
    }

    //A List to be used to inflate Attendance Spinners
    ArrayList<String> attendanceTypes = new ArrayList<>();
    attendanceTypeOptions.clear();
    attendanceTypeOptions = presenter.filterAttendanceTypes(collectionSheetResponse.getAttendanceTypeOptions(),
            attendanceTypes);

    //Add the heading Row
    TableRow headingRow = new TableRow(getContext());
    TableRow.LayoutParams headingRowParams = new TableRow.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
            ViewGroup.LayoutParams.WRAP_CONTENT);
    headingRowParams.gravity = Gravity.CENTER;
    headingRowParams.setMargins(0, 0, 0, 10);
    headingRow.setLayoutParams(headingRowParams);

    TextView tvGroupName = new TextView(getContext());
    tvGroupName.setText(collectionSheetResponse.getGroups().get(0).getGroupName());
    tvGroupName.setTypeface(tvGroupName.getTypeface(), Typeface.BOLD);
    tvGroupName.setGravity(Gravity.CENTER);
    headingRow.addView(tvGroupName);

    for (LoanProducts loanProduct : collectionSheetResponse.getLoanProducts()) {
        TextView tvProduct = new TextView(getContext());
        tvProduct.setText(getString(R.string.collection_heading_charges, loanProduct.getName()));
        tvProduct.setTypeface(tvProduct.getTypeface(), Typeface.BOLD);
        tvProduct.setGravity(Gravity.CENTER);
        headingRow.addView(tvProduct);
    }

    TextView tvAttendance = new TextView(getContext());
    tvAttendance.setText(getString(R.string.attendance));
    tvAttendance.setGravity(Gravity.CENTER);
    tvAttendance.setTypeface(tvAttendance.getTypeface(), Typeface.BOLD);
    headingRow.addView(tvAttendance);

    tableProductive.addView(headingRow);

    for (ClientCollectionSheet clientCollectionSheet : collectionSheetResponse.getGroups().get(0)
            .getClients()) {
        //Insert rows
        TableRow row = new TableRow(getContext());
        TableRow.LayoutParams rowParams = new TableRow.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
                ViewGroup.LayoutParams.WRAP_CONTENT);
        rowParams.gravity = Gravity.CENTER;
        rowParams.setMargins(0, 0, 0, 10);
        row.setLayoutParams(rowParams);

        //Column 1: Client Name and Id
        TextView tvClientName = new TextView(getContext());
        tvClientName.setText(
                concatIdWithName(clientCollectionSheet.getClientName(), clientCollectionSheet.getClientId()));
        row.addView(tvClientName);

        //Subsequent columns: The Loan products
        for (LoanProducts loanProduct : collectionSheetResponse.getLoanProducts()) {
            //Since there may be several items in this column, create a container.
            LinearLayout productContainer = new LinearLayout(getContext());
            productContainer.setOrientation(LinearLayout.HORIZONTAL);

            //Iterate through all the loans in of this type and add in the container
            for (LoanCollectionSheet loanCollectionSheet : clientCollectionSheet.getLoans()) {
                if (loanProduct.getName().equals(loanCollectionSheet.getProductShortName())) {
                    //This loan should be shown in this column. So, add it in the container.
                    EditText editText = new EditText(getContext());
                    editText.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
                    editText.setText(String.format(Locale.getDefault(), "%f", 0.0));
                    //Set the loan id as the Tag of the EditText which
                    //will later be used as the identifier for this.
                    editText.setTag(TYPE_LOAN + ":" + loanCollectionSheet.getLoanId());
                    productContainer.addView(editText);
                }
            }
            row.addView(productContainer);
        }

        Spinner spAttendance = new Spinner(getContext());
        setSpinner(spAttendance, attendanceTypes);
        row.addView(spAttendance);

        tableProductive.addView(row);
    }

    if (btnSubmitProductive.getVisibility() != View.VISIBLE) {
        //Show the button the first time sheet is loaded.
        btnSubmitProductive.setVisibility(View.VISIBLE);
        btnSubmitProductive.setOnClickListener(this);
    }

    //If this block has been executed, that the CollectionSheet
    //which is already shown on screen is for center - Productive.
    btnSubmitProductive.setTag(TAG_TYPE_PRODUCTIVE);
}