Update some really outdated UI display code
This commit is contained in:
parent
6eb48808aa
commit
f4a1082f75
|
@ -639,11 +639,10 @@ public class MainActivity extends FragmentActivity implements
|
|||
WindowManager winman = (WindowManager) context
|
||||
.getSystemService(Context.WINDOW_SERVICE);
|
||||
winman.getDefaultDisplay().getMetrics(metrics);
|
||||
final float scale = context.getResources().getDisplayMetrics().density;
|
||||
int toastPixels = (int) ((metrics.widthPixels * scale + 0.5f) / 18);
|
||||
|
||||
Toast toast = new Toast(context);
|
||||
toast.setGravity(Gravity.BOTTOM, 0, toastPixels);
|
||||
toast.setGravity(Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL, 0,
|
||||
(int) (72 * metrics.density + 0.5f));
|
||||
toast.setDuration(duration);
|
||||
toast.setView(layout);
|
||||
toast.show();
|
||||
|
|
|
@ -141,11 +141,6 @@ public class GL2JNIView extends GLSurfaceView
|
|||
|
||||
vib=(Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
|
||||
Runtime.getRuntime().freeMemory();
|
||||
System.gc();
|
||||
}
|
||||
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
//((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||
((WindowManager) context.getSystemService(Context.WINDOW_SERVICE))
|
||||
|
|
Loading…
Reference in New Issue