TextView setTextColor - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for TextView setTextColor method.

This code example shows how to use the following methods: setPadding, setText, setTextColor, setTextSize
     
    TextView textView = (TextView)row.findViewById(android.R.id.text1);
    float scale = activity.getResources().getDisplayMetrics().density;
    boolean leftPadding = (parent.getTag().equals("right"));
    boolean topPadding = (position == 0);
    textView.setPadding((int)(20 * scale) * (leftPadding ? 2 : 1), (int)(20 * scale) * (!leftPadding && topPadding ? 1 : 0), (int)(20 * scale), 0);
    textView.setText(item);
    textView.setTextColor(Color.BLACK);
    textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
     
    return row;
  } 
 
  private View getWebView(int position, View convertView, ViewGroup parent) {
    View row = convertView;
    if ((row == null) || (row.findViewById(1337) == null)) {
      RelativeLayout layout = new RelativeLayout(activity);
      layout.setLayoutParams(new ListView.LayoutParams(ListView.LayoutParams.FILL_PARENT, ListView.LayoutParams.WRAP_CONTENT));
      row = layout;
       
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getHeight, setGravity, setText, setTextColor, setTextSize
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setLayoutParams, setText, setTextColor, setTextSize
                LinearLayout.LayoutParams.WRAP_CONTENT,
                LinearLayout.LayoutParams.WRAP_CONTENT, 1));
        layout.addView(tscroll);
 
        // Now create the text view and add it to the scroller. 
        textView = new TextView(context);
        textView.setTextSize(16);
        textView.setTextColor(0xffffffff);
        textView.setText(textId);
        textView.setLayoutParams(new LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.FILL_PARENT,
                LinearLayout.LayoutParams.FILL_PARENT));
        tscroll.addView(textView);
 
        // Add a layout to hold the buttons. 
        buttonHolder = new LinearLayout(context);
        buttonHolder.setBackgroundColor(0xf08080);
        buttonHolder.setOrientation(LinearLayout.HORIZONTAL);
        buttonHolder.setPadding(6, 3, 3, 3);
        layout.addView(buttonHolder, new LinearLayout.LayoutParams(
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setText, setTextColor
                } 
 
                TextView headline = (TextView) view.findViewById(android.R.id.text1);
                TextView subText = (TextView) view.findViewById(android.R.id.text2);
                headline.setText(error.sourceId() + ":" + error.lineNumber());
                subText.setText(error.message());
                switch (error.messageLevel()) {
                    case ERROR:
                        subText.setTextColor(Color.RED);
                        break; 
                    case WARNING:
                        // Orange 
                        subText.setTextColor(Color.rgb(255,192,0));
                        break; 
                    case TIP:
                        subText.setTextColor(Color.BLUE);
                        break; 
                    default: 
                        subText.setTextColor(Color.LTGRAY);
                        break; 

8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getBottom, getTop, layout, setTextColor
                leftMin = Math.min(0,
                        center - (nextViewWidth / 2) - mPaddingPush - viewWidth);
            } 
            int leftMax = center - (viewWidth / 2);
            int newLeft = map(positionOffset, 1, 0, leftMin, leftMax);
            view.layout(newLeft, view.getTop(), newLeft + viewWidth, view.getBottom());
            view.setTextColor(Color.rgb(
                    map(positionOffset, 1, 0, mInactiveTextColor.red, mActiveTextColor.red),
                    map(positionOffset, 1, 0, mInactiveTextColor.green, mActiveTextColor.green),
                    map(positionOffset, 1, 0, mInactiveTextColor.blue, mActiveTextColor.blue)));
        } 
 
        // Move the view at position + 1. This will be the label for the 
        // right of the two fragments that may be visible on screen 
        if ((position + 1) < getChildCount()) {
            TextView view = (TextView) getChildAt(position + 1);
            int viewWidth = view.getWidth();
            int prevViewWidth = getChildAt(position).getWidth();
            int leftMin = center - (viewWidth / 2);
            int leftMax = Math.max(width - viewWidth,
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related TextView setTextColor Questions & Answers:

setTextColor Method Overview
Sets the text color.
See Code Examples for other Android TextView Methods: