Skip to content

Commit

Permalink
decrease log font size
Browse files Browse the repository at this point in the history
  • Loading branch information
ph4r05 committed Feb 7, 2021
1 parent 24f3914 commit 1be1c0b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
Expand Down Expand Up @@ -69,15 +70,16 @@ public View inflateViews() {
mLogView.setFocusable(true);
mLogView.setTypeface(Typeface.MONOSPACE);

// Want to set padding as 16 dips, setPadding takes pixels. Hooray math!
int paddingDips = 16;
// Want to set padding as 12 dips, setPadding takes pixels. Hooray math!
int paddingDips = 12;
double scale = getResources().getDisplayMetrics().density;
int paddingPixels = (int) ((paddingDips * (scale)) + .5);
mLogView.setPadding(paddingPixels, paddingPixels, paddingPixels, paddingPixels);
mLogView.setCompoundDrawablePadding(paddingPixels);

mLogView.setGravity(Gravity.BOTTOM);
mLogView.setTextAppearance(getActivity(), android.R.style.TextAppearance_Holo_Medium);
mLogView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 13);

mScrollView.addView(mLogView);
return mScrollView;
Expand Down

0 comments on commit 1be1c0b

Please sign in to comment.