Clean up the FPS view to support variable text size change

This commit is contained in:
TwistedUmbrella 2014-02-14 21:29:42 -05:00
parent 3ab88a71ab
commit 8469baa39e
1 changed files with 6 additions and 15 deletions

View File

@ -71,22 +71,13 @@ public class OnScreenMenu {
public FpsPopup(Context c) {
super(c);
int pX = getPixelsFromDp(66, mContext);
int pY = getPixelsFromDp(34, mContext);
LinearLayout.LayoutParams fpsParams = new LinearLayout.LayoutParams(pX, pY);
LinearLayout flay = new LinearLayout(mContext);
flay.setOrientation(LinearLayout.HORIZONTAL);
fpsText = new TextView(mContext);
fpsParams.weight = 1.0f;
fpsParams.gravity = Gravity.CENTER;
fpsText.setTextSize(TypedValue.COMPLEX_UNIT_SP,32);
fpsText.setTextColor(mContext.getResources().getColor(android.R.color.white));
fpsText.setLayoutParams(fpsParams);
flay.addView(fpsText, fpsParams);
setContentView(flay);
fpsText.setTextSize(TypedValue.COMPLEX_UNIT_SP, 32);
fpsText.setTextColor(mContext.getResources().getColor(
android.R.color.white));
fpsText.setGravity(Gravity.CENTER);
fpsText.setText("XX");
setContentView(fpsText);
}
public void setText(int frames) {