I have two activities, the main one asks for a letter and passes it to the second activity which should display the letter in the middle of the screen and as large as possible so it fills the entire screen.
I'm having issues with setting the size of the text, it seems to always be offset, off the screen or too big. I have set android:includeFontPadding="false"
Text view is:
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:singleLine="true"
android:includeFontPadding="false"
android:ellipsize="none"
android:text="p"
android:id="@+id/textView"
android:textSize="1500px"/>
I currently get the bounding box for the character:
Rect bounds = new Rect();
Paint textPaint = view.getPaint();
textPaint.getTextBounds(value, 0, value.length(), bounds);
textHeight = bounds.height();
Then try to set the size of the text depending on the height:
view.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
The text looks like it's the right height but it is usually offset, sort of half on half off the screen. Is there a way to get it rendering properly?