Example usage for android.graphics Color BLACK

List of usage examples for android.graphics Color BLACK

Introduction

In this page you can find the example usage for android.graphics Color BLACK.

Prototype

int BLACK

To view the source code for android.graphics Color BLACK.

Click Source Link

Usage

From source file:com.rks.musicx.ui.fragments.RecentFragment.java

@Override
protected void funtion() {
    recentPlayedFragment = new RecentPlayedFragment().newInstance(-1, true);
    recentlyAddedFragment = new RecentlyAddedFragment().newInstance("%s limit -1", true);
    RecentlyAddedMore.setOnClickListener(v -> {
        ((MainActivity) getActivity()).setFragment(recentlyAddedFragment);
    });/*  w ww  . j  a  v  a 2s.  c  o m*/
    More.setOnClickListener(v -> {
        ((MainActivity) getActivity()).setFragment(recentPlayedFragment);
    });
    accentcolor = Config.accentColor(getContext(), Helper.getATEKey(getContext()));
    if (Extras.getInstance().getDarkTheme() || Extras.getInstance().getBlackTheme()) {
        recentName.setTextColor(Color.WHITE);
        recentPlayed.setTextColor(Color.WHITE);
        More.setTextColor(accentcolor);
        RecentlyAddedMore.setTextColor(accentcolor);
    } else {
        recentName.setTextColor(Color.BLACK);
        recentPlayed.setTextColor(Color.BLACK);
        More.setTextColor(accentcolor);
        RecentlyAddedMore.setTextColor(accentcolor);
    }
    helper = new Helper(getContext());
    background();
}

From source file:com.facebook.react.views.toolbar.ReactToolbarManager.java

private static int[] getDefaultColors(Context context) {
    Resources.Theme theme = context.getTheme();
    TypedArray toolbarStyle = null;/*w w w. j  a  v a2  s.c  o  m*/
    TypedArray textAppearances = null;
    TypedArray titleTextAppearance = null;
    TypedArray subtitleTextAppearance = null;

    try {
        toolbarStyle = theme.obtainStyledAttributes(new int[] { getIdentifier(context, "toolbarStyle") });

        int toolbarStyleResId = toolbarStyle.getResourceId(0, 0);
        textAppearances = theme.obtainStyledAttributes(toolbarStyleResId,
                new int[] { getIdentifier(context, "titleTextAppearance"),
                        getIdentifier(context, "subtitleTextAppearance"), });

        int titleTextAppearanceResId = textAppearances.getResourceId(0, 0);
        int subtitleTextAppearanceResId = textAppearances.getResourceId(1, 0);

        titleTextAppearance = theme.obtainStyledAttributes(titleTextAppearanceResId,
                new int[] { android.R.attr.textColor });
        subtitleTextAppearance = theme.obtainStyledAttributes(subtitleTextAppearanceResId,
                new int[] { android.R.attr.textColor });

        int titleTextColor = titleTextAppearance.getColor(0, Color.BLACK);
        int subtitleTextColor = subtitleTextAppearance.getColor(0, Color.BLACK);

        return new int[] { titleTextColor, subtitleTextColor };
    } finally {
        recycleQuietly(toolbarStyle);
        recycleQuietly(textAppearances);
        recycleQuietly(titleTextAppearance);
        recycleQuietly(subtitleTextAppearance);
    }
}

From source file:com.normalexception.app.rx8club.view.category.CategoryView.java

/**
 * Set the mode of the category line//  w  ww  . ja  va 2s.c  o m
 * @param vi      The view line
 * @param isTitle   If we are going to represent a title
 */
private void setMode(View vi, boolean isTitle) {
    int showMode = isTitle ? View.GONE : View.VISIBLE;
    int colorMode = isTitle ? Color.DKGRAY : Color.GRAY;
    int textColor = isTitle ? Color.WHITE : Color.BLACK;

    postCount.setVisibility(showMode);
    postCountLabel.setVisibility(showMode);
    threadCount.setVisibility(showMode);
    threadCountLabel.setVisibility(showMode);
    subCount.setVisibility(showMode);
    subCountLabel.setVisibility(showMode);
    image.setVisibility(showMode);
    vi.setBackgroundColor(colorMode);

    title.setTextColor(textColor);
}

From source file:com.clov4r.moboplayer.android.nil.codec.activity.MoboThumbnailTestActivity.java

public Bitmap getRoundedCornerBitmap(Bitmap bitmap, float roundPx) {
    try {/*ww w  .j av a  2 s . co  m*/
        Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);
        Canvas canvas = new Canvas(output);
        final Paint paint = new Paint();
        final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
        final RectF rectF = new RectF(new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()));
        paint.setAntiAlias(true);
        canvas.drawARGB(0, 0, 0, 0);
        paint.setColor(Color.BLACK);
        canvas.drawRoundRect(rectF, roundPx, roundPx, paint);
        paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
        final Rect src = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());

        canvas.drawBitmap(bitmap, src, rect, paint);
        return output;
    } catch (Exception e) {
        return bitmap;
    }
}

From source file:com.pixby.texo.EditTools.ColorTool.java

private boolean isPresetColor(@ColorInt int color) {
    return color == Color.WHITE || color == Color.GRAY || color == Color.BLACK;
}

From source file:com.ibuildapp.romanblack.MultiContactsPlugin.ContactDetailsActivity.java

@Override
public void create() {
    try {//w ww .  j a v a  2s  .c o m
        setContentView(R.layout.grouped_contacts_details);

        Intent currentIntent = getIntent();
        Bundle store = currentIntent.getExtras();
        widget = (Widget) store.getSerializable("Widget");
        if (widget == null) {
            handler.sendEmptyMessageDelayed(INITIALIZATION_FAILED, 100);
            return;
        }

        person = (Person) store.getSerializable("person");
        if (person == null) {
            handler.sendEmptyMessageDelayed(INITIALIZATION_FAILED, 100);
            return;
        }
        setTopBarTitle(widget.getTitle());

        Boolean single = currentIntent.getBooleanExtra("single", true);

        setTopBarLeftButtonTextAndColor(
                single ? getResources().getString(R.string.common_home_upper)
                        : getResources().getString(R.string.common_back_upper),
                getResources().getColor(android.R.color.black), true, new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        finish();
                    }
                });
        setTopBarTitleColor(getResources().getColor(android.R.color.black));
        setTopBarBackgroundColor(Statics.color1);

        if ((Boolean.TRUE.equals(widget.getParameter(PARAM_SEND_MAIL)))
                || (Boolean.TRUE.equals(widget.getParameter(PARAM_SEND_SMS)))
                || (Boolean.TRUE.equals(widget.getParameter(PARAM_SEND_SMS)))) {

            ImageView shareButton = (ImageView) getLayoutInflater()
                    .inflate(R.layout.grouped_contacts_share_button, null);
            shareButton.setLayoutParams(
                    new LinearLayout.LayoutParams((int) (29 * getResources().getDisplayMetrics().density),
                            (int) (39 * getResources().getDisplayMetrics().density)));
            shareButton.setColorFilter(Color.BLACK);
            setTopBarRightButton(shareButton, getString(R.string.multicontacts_list_share),
                    new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {
                            DialogSharing.Configuration.Builder sharingDialogBuilder = new DialogSharing.Configuration.Builder();

                            if (Boolean.TRUE.equals(widget.getParameter(PARAM_SEND_MAIL)))
                                sharingDialogBuilder
                                        .setEmailSharingClickListener(new DialogSharing.Item.OnClickListener() {
                                            @Override
                                            public void onClick() {
                                                String message = getContactInfo();
                                                Intent email = new Intent(Intent.ACTION_SEND);
                                                email.putExtra(Intent.EXTRA_TEXT, message);
                                                email.setType("message/rfc822");
                                                startActivity(Intent.createChooser(email,
                                                        getString(R.string.choose_email_client)));
                                            }
                                        });

                            if (Boolean.TRUE.equals(widget.getParameter(PARAM_SEND_SMS)))
                                sharingDialogBuilder
                                        .setSmsSharingClickListener(new DialogSharing.Item.OnClickListener() {
                                            @Override
                                            public void onClick() {
                                                String message = getContactInfo();

                                                try {
                                                    Utils.sendSms(ContactDetailsActivity.this, message);
                                                } catch (ActivityNotFoundException e) {
                                                    e.printStackTrace();
                                                }
                                            }
                                        });

                            if (Boolean.TRUE.equals(widget.getParameter(PARAM_ADD_CONTACT)))
                                sharingDialogBuilder.addCustomListener(R.string.multicontacts_add_to_phonebook,
                                        R.drawable.gc_add_to_contacts, true,
                                        new DialogSharing.Item.OnClickListener() {
                                            @Override
                                            public void onClick() {
                                                createNewContact(person.getName(), person.getPhone(),
                                                        person.getEmail());
                                            }
                                        });

                            showDialogSharing(sharingDialogBuilder.build());
                        }
                    });

        }

        boolean hasSchema = store.getBoolean("hasschema");
        cachePath = widget.getCachePath() + "/contacts-" + widget.getOrder();

        contacts = person.getContacts();

        if (widget.getTitle().length() > 0) {
            setTitle(widget.getTitle());
        }

        root = (LinearLayout) findViewById(R.id.grouped_contacts_details_root);

        if (hasSchema) {
            root.setBackgroundColor(Statics.color1);
        } else if (widget.isBackgroundURL()) {
            cacheBackgroundFile = cachePath + "/" + Utils.md5(widget.getBackgroundURL());
            File backgroundFile = new File(cacheBackgroundFile);
            if (backgroundFile.exists()) {
                root.setBackgroundDrawable(
                        new BitmapDrawable(BitmapFactory.decodeStream(new FileInputStream(backgroundFile))));
            } else {
                BackgroundDownloadTask dt = new BackgroundDownloadTask();
                dt.execute(widget.getBackgroundURL());
            }
        } else if (widget.isBackgroundInAssets()) {
            AssetManager am = this.getAssets();
            root.setBackgroundDrawable(new BitmapDrawable(am.open(widget.getBackgroundURL())));
        }

        if (contacts != null) {
            ImageView avatarImage = (ImageView) findViewById(R.id.grouped_contacts_details_avatar);

            avatarImage.setImageResource(R.drawable.gc_profile_avatar);
            if (person.hasAvatar() && NetworkUtils.isOnline(this)) {
                avatarImage.setVisibility(View.VISIBLE);
                Glide.with(this).load(person.getAvatarUrl()).placeholder(R.drawable.gc_profile_avatar)
                        .dontAnimate().into(avatarImage);
            } else {
                avatarImage.setVisibility(View.VISIBLE);
                avatarImage.setImageResource(R.drawable.gc_profile_avatar);
            }

            String name = "";
            neededContacts = new ArrayList<>();
            for (Contact con : contacts) {
                if ((con.getType() == 5) || (con.getDescription().length() == 0)) {
                } else {
                    if (con.getType() == 0) {
                        name = con.getDescription();
                    } else
                        neededContacts.add(con);
                }
            }

            if (neededContacts.isEmpty()) {
                handler.sendEmptyMessage(THERE_IS_NO_CONTACT_DATA);
                return;
            }

            headSeparator = findViewById(R.id.gc_head_separator);
            bottomSeparator = findViewById(R.id.gc_bottom_separator);
            imageBottom = findViewById(R.id.gc_image_bottom_layout);
            personName = (TextView) findViewById(R.id.gc_details_description);

            if ("".equals(name))
                personName.setVisibility(View.GONE);
            else {
                personName.setVisibility(View.VISIBLE);
                personName.setText(name);
                personName.setTextColor(Statics.color3);
            }
            if (Statics.isLight) {
                headSeparator.setBackgroundColor(Color.parseColor("#4d000000"));
                bottomSeparator.setBackgroundColor(Color.parseColor("#4d000000"));
            } else {
                headSeparator.setBackgroundColor(Color.parseColor("#4dFFFFFF"));
                bottomSeparator.setBackgroundColor(Color.parseColor("#4dFFFFFF"));
            }

            ViewUtils.setBackgroundLikeHeader(imageBottom, Statics.color1);

            ListView list = (ListView) findViewById(R.id.grouped_contacts_details_list_view);
            list.setDivider(null);

            ContactDetailsAdapter adapter = new ContactDetailsAdapter(ContactDetailsActivity.this,
                    R.layout.grouped_contacts_details_item, neededContacts, isChemeDark(Statics.color1));
            list.setAdapter(adapter);
            list.setOnItemClickListener(new OnItemClickListener() {
                @Override
                public void onItemClick(AdapterView<?> arg0, View view, int position, long id) {
                    listViewItemClick(position);
                }
            });
        }

        if (widget.hasParameter("add_contact")) {
            HashMap<String, String> hm = new HashMap<>();
            for (int i = 0; i < contacts.size(); i++) {
                switch (contacts.get(i).getType()) {
                case 0: {
                    hm.put("contactName", contacts.get(i).getDescription());
                }
                    break;
                case 1: {
                    hm.put("contactNumber", contacts.get(i).getDescription());
                }
                    break;
                case 2: {
                    hm.put("contactEmail", contacts.get(i).getDescription());
                }
                    break;
                case 3: {
                    hm.put("contactSite", contacts.get(i).getDescription());
                }
                    break;
                }
            }
            addNativeFeature(NATIVE_FEATURES.ADD_CONTACT, null, hm);
        }
        if (widget.hasParameter("send_sms")) {
            HashMap<String, String> hm = new HashMap<>();
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < contacts.size(); i++) {
                sb.append(contacts.get(i).getDescription());
                if (i < contacts.size() - 1) {
                    sb.append(", ");
                }
            }
            hm.put("text", sb.toString());
            addNativeFeature(NATIVE_FEATURES.SMS, null, hm);
        }
        if (widget.hasParameter("send_mail")) {
            HashMap<String, CharSequence> hm = new HashMap<>();
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < contacts.size(); i++) {
                switch (contacts.get(i).getType()) {
                case 0: {
                    sb.append("Name: ");
                }
                    break;
                case 1: {
                    sb.append("Phone: ");
                }
                    break;
                case 2: {
                    sb.append("Email: ");
                }
                    break;
                case 3: {
                    sb.append("Site: ");
                }
                    break;
                case 4: {
                    sb.append("Address: ");
                }
                    break;
                }
                sb.append(contacts.get(i).getDescription());
                sb.append("<br/>");
            }

            if (widget.isHaveAdvertisement()) {
                sb.append("<br>\n (sent from <a href=\"http://ibuildapp.com\">iBuildApp</a>)");
            }

            hm.put("text", sb.toString());
            hm.put("subject", "Contacts");
            addNativeFeature(NATIVE_FEATURES.EMAIL, null, hm);
        }

    } catch (Exception e) {
        Log.e(TAG, e.getMessage());
        e.printStackTrace();
    }
}

From source file:com.facebook.react.views.slider.ReactSlider.java

private NinePatchDrawable createNineDrawable(Bitmap src) {
    if (src.getNinePatchChunk() != null) {
        return NinePatchDrawableFactory.convertBitmap(getResources(), src, null);
    }/*from   www . ja va2s .co m*/
    Bitmap desc = Bitmap.createBitmap(src.getWidth() + 4, src.getHeight() + 4, Bitmap.Config.ARGB_4444);
    PointF center = new PointF(desc.getWidth() / 2, desc.getHeight() / 2);
    Canvas canvas = new Canvas(desc);
    canvas.drawBitmap(src, 2, 2, null);
    Paint p = new Paint();
    p.setColor(Color.BLACK);
    canvas.drawLine(center.x, 0, center.x + 1, 0, p);
    canvas.drawLine(0, center.y, 0, center.y + 1, p);
    NinePatchDrawable drawable = NinePatchDrawableFactory.convertBitmap(getResources(), desc, null);
    desc.recycle();
    return drawable;
}

From source file:com.doodle.android.chips.ChipsView.java

private void initAttr(Context context, AttributeSet attrs) {
    TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.ChipsView, 0, 0);
    try {//from  w  w w  .  j  a v  a2 s  . co  m
        mMaxHeight = a.getDimensionPixelSize(R.styleable.ChipsView_cv_max_height, DEFAULT_MAX_HEIGHT);
        mVerticalSpacing = a.getDimensionPixelSize(R.styleable.ChipsView_cv_vertical_spacing,
                (int) (DEFAULT_VERTICAL_SPACING * mDensity));
        mChipsColor = a.getColor(R.styleable.ChipsView_cv_color,
                ContextCompat.getColor(context, R.color.base30));
        mChipsColorClicked = a.getColor(R.styleable.ChipsView_cv_color_clicked,
                ContextCompat.getColor(context, R.color.colorPrimaryDark));
        mChipsColorErrorClicked = a.getColor(R.styleable.ChipsView_cv_color_error_clicked,
                ContextCompat.getColor(context, R.color.color_error));
        mChipsBgColor = a.getColor(R.styleable.ChipsView_cv_bg_color,
                ContextCompat.getColor(context, R.color.base10));
        mChipsBgColorClicked = a.getColor(R.styleable.ChipsView_cv_bg_color_clicked,
                ContextCompat.getColor(context, R.color.blue));
        mChipsBgColorIndelible = a.getColor(R.styleable.ChipsView_cv_bg_color_indelible, mChipsBgColor);
        mChipsBgColorErrorClicked = a.getColor(R.styleable.ChipsView_cv_bg_color_clicked,
                ContextCompat.getColor(context, R.color.color_error));
        mChipsTextColor = a.getColor(R.styleable.ChipsView_cv_text_color, Color.BLACK);
        mChipsTextColorClicked = a.getColor(R.styleable.ChipsView_cv_text_color_clicked, Color.WHITE);
        mChipsTextColorErrorClicked = a.getColor(R.styleable.ChipsView_cv_text_color_clicked, Color.WHITE);
        mChipsTextColorIndelible = a.getColor(R.styleable.ChipsView_cv_text_color_indelible, mChipsTextColor);
        mChipsPlaceholderResId = a.getResourceId(R.styleable.ChipsView_cv_icon_placeholder,
                R.drawable.ic_person_24dp);
        mChipsPlaceholderTint = a.getColor(R.styleable.ChipsView_cv_icon_placeholder_tint, 0);
        mChipsDeleteResId = a.getResourceId(R.styleable.ChipsView_cv_icon_delete, R.drawable.ic_close_24dp);
        mChipsHintText = a.getString(R.styleable.ChipsView_cv_text_hint);
        mChipsMargin = a.getDimensionPixelSize(R.styleable.ChipsView_cv_chips_margin, 0);
    } finally {
        a.recycle();
    }
}

From source file:com.android.nsboc.ComposeFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    if (mItem != null) {
        switch (mItem.id + "") {
        case "1":
            mRootView = inflater.inflate(R.layout.form_unlicensed, container, false);
            break;
        case "2":
            mRootView = inflater.inflate(R.layout.form_salon, container, false);
            break;
        }/*  www  .j a  va2s .co  m*/
    }

    showCurrentDateInEditText();

    ToggleButton complianceToggle = (ToggleButton) mRootView.findViewById(R.id.compliance_toggle);
    if (complianceToggle != null) {
        final LinearLayout complianceContainer = (LinearLayout) mRootView
                .findViewById(R.id.compliance_container);

        complianceToggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if (!isChecked) {
                    complianceContainer.setVisibility(View.VISIBLE);

                    final LinearLayout complianceLayout = (LinearLayout) View.inflate(getActivity(),
                            R.layout.compliance_layout, null);

                    Spinner violationTypeSpinner = (Spinner) complianceLayout
                            .findViewById(R.id.violation_type_spinner);
                    violationTypeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
                        @Override
                        public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
                            switch (position) {
                            case 0:
                                complianceLayout.findViewById(R.id.type_citation_container)
                                        .setVisibility(View.VISIBLE);
                                break;
                            case 1:
                                complianceLayout.findViewById(R.id.type_citation_container)
                                        .setVisibility(View.GONE);
                                break;
                            }
                        }

                        @Override
                        public void onNothingSelected(AdapterView<?> parent) {
                        }
                    });

                    ToggleButton anotherToggle = (ToggleButton) complianceLayout
                            .findViewById(R.id.compliance_toggle);
                    anotherToggle.setOnCheckedChangeListener(getNextToggleListener(complianceLayout));

                    complianceContainer.addView(complianceLayout);
                } else {
                    complianceContainer.setVisibility(View.GONE);
                }
            }
        });
    }

    ToggleButton emailToggle = (ToggleButton) mRootView.findViewById(R.id.emailTo_toggle);
    if (emailToggle != null) {
        final LinearLayout emailLayout = (LinearLayout) mRootView.findViewById(R.id.emailTo_layout);

        emailToggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if (isChecked) {
                    emailLayout.setVisibility(View.VISIBLE);
                } else {
                    emailLayout.setVisibility(View.GONE);
                }
            }
        });
    }

    final TextView noticeTextView = (TextView) mRootView.findViewById(R.id.notice_textview);
    if (noticeTextView != null) {
        noticeTextView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (noticeTextView.getCurrentTextColor() == Color.BLACK) {
                    noticeTextView.setText(R.string.civil_citation_header);
                    noticeTextView.setTextColor(Color.parseColor("#17405e"));
                    noticeTextView.setText(Html.fromHtml("<u>" + noticeTextView.getText() + "</u>"));
                    mRootView.findViewById(R.id.civil_citation).requestFocus();
                } else {
                    noticeTextView.setText(R.string.civil_citation_notice);
                    noticeTextView.setMaxLines(Integer.MAX_VALUE);
                    noticeTextView.setTextColor(Color.BLACK);
                    noticeTextView.setText(
                            noticeTextView.getText().toString().replace("<u>", "").replace("</u>", ""));
                }
            }
        });
    }

    Spinner stateSpinner = (Spinner) mRootView.findViewById(R.id.state);
    if (stateSpinner != null) {
        stateSpinner.setSelection(27);
    }

    return mRootView;
}

From source file:com.chalmers.schmaps.CheckBusActivity.java

/**
 * Makes the rows for the lindholmentable
 *//*from  w  w w.  j  av a 2 s  .c o m*/
public void makeLindholmenRows() {
    for (int i = 0; i < NROFROWS; i++) {
        TableRow tempTableRow = new TableRow(this);
        tempTableRow.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));

        // Makes every other row light gray or white
        if (i % 2 == 0) {
            tempTableRow.setBackgroundColor(getResources().getColor(R.color.transp_grey));
        } else {
            tempTableRow.setBackgroundColor(getResources().getColor(R.color.transp_white));
        }

        //Makes every textview for each column and add it before starting with a new one 
        for (int j = 0; j < NR_OF_COLUMNS; j++) {
            TextView textview = new TextView(this);
            textview.setTextColor(Color.BLACK);
            textview.setTextSize(TypedValue.COMPLEX_UNIT_SP, TEXT_SIZE);
            //Check which content should be written in the textview
            if (j == COLUMN_NR_1) {
                textview.setText(lindholmenLineArray.get(i));
            } else if (j == COLUMN_NR_2) {
                textview.setText(lindholmenDestArray.get(i));
            } else if (j == COLUMN_NR_3) {
                textview.setText(lindholmenTimeArray.get(i));
            } else if (j == COLUMN_NR_4) {
                textview.setText(lindholmenTrackArray.get(i));
            }

            textview.setGravity(Gravity.CENTER_HORIZONTAL);
            tempTableRow.addView(textview);
        }
        lindholmenTable.addView(tempTableRow,
                new TableLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
    }
}