TextView setTextSize - 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 setTextSize 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: setGravity, setPadding, setText, setTextSize
		playerText.setText(score.getPlayer());
		playerText.setGravity(Gravity.LEFT);
		playerText.setPadding(10, 10, 10, 10);
		playerText.setTextSize(16);
 
		TextView scoreText = new TextView(parent.getContext());
		scoreText.setText(String.valueOf(score.getScore()));
		scoreText.setGravity(Gravity.RIGHT);
		scoreText.setPadding(10, 10, 10, 10);
		scoreText.setTextSize(16);
 
		layout.addView(playerText);
		layout.addView(scoreText);
 
		return layout;
	} 
 
	public List<HighScore> getScores() {
		return scores;
	} 
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: 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: setGravity, setMaxWidth, setMinWidth, setPadding, setText
	public void removeItemAt(int pos) {
		this.messages.remove(pos);
	} 
 
	public View getView(int pos, View convertView, ViewGroup parent) {
		TextView messageText = new TextView(parent.getContext());
		messageText.setText(this.getMessageText(pos));
		messageText.setGravity(Gravity.LEFT);
		messageText.setPadding(10, 10, 10, 10);
		messageText.setMaxWidth(200);
		messageText.setMinWidth(200);
		messageText.setTextSize(16);
 
		return messageText;
	} 
 
	private String extractMessageFromJsonObject(String json) {
		try { 
			ObjectMapper mapper = new ObjectMapper();
			Map<String, Object> jsonDic = mapper.readValue(json,
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related TextView setTextSize Questions & Answers:

setTextSize Method Overview
Set the default text size to the given value, interpreted as "scaled pixel" units.
See Code Examples for other Android TextView Methods: