The problem is the getGenericTextView() method of the getGenericTextView() code:
// Set the text starting position textView.setPadding(36, 0, 0, 0);
setPadding(...) sets the registration (internal space) in pixels, which means that the result of this indentation will be different for each device. It seems you are using an hdpi device with a relatively large horizontal screen resolution, resulting in visually too little space on the left side of the TextView. For a more detailed explanation of this problem, read here.
Thus, you can easily overcome the problem by setting the pixel density (d (i) p) so that the space with visual indentation is the same in different resolutions. You can use TypedValue for this:
int dips = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 36, getResources().getDisplayMetrics());
Alternatively, you can inflate a TextView from xml, on which you can set density-independent properties at design time, rather than doing it on the fly at run time.
source share