Better to start the view when the native lib is loaded

This commit is contained in:
shagr4th 2016-12-19 19:34:28 +01:00
parent 5b87aff021
commit 5cb541b5e4
3 changed files with 22 additions and 22 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.ab.x48" android:installLocation="auto" android:versionCode="69" android:versionName="1.69"> package="org.ab.x48" android:installLocation="auto" android:versionCode="71" android:versionName="1.71">
<application android:icon="@drawable/icon" android:label="@string/app_name"> <application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".X48" <activity android:name=".X48"
android:label="@string/app_name" android:label="@string/app_name"

View file

@ -173,7 +173,6 @@ public class HPView extends SurfaceView implements SurfaceHolder.Callback, Runna
if (c > 2) if (c > 2)
c = 2; c = 2;
setContrast(0.5 * c); setContrast(0.5 * c);
//x48.flipScreen();
} }
private void setContrast(double contrast_factor) { private void setContrast(double contrast_factor) {
@ -913,6 +912,7 @@ public class HPView extends SurfaceView implements SurfaceHolder.Callback, Runna
lcd_menuicon_x = lcd_pos_x_end - menuIcon.getWidth(); lcd_menuicon_x = lcd_pos_x_end - menuIcon.getWidth();
} }
if (backBuffer != null)
c.drawBitmap(backBuffer, 0, 0, null); c.drawBitmap(backBuffer, 0, 0, null);
if (data != null) if (data != null)
mainScreen.copyPixelsFromBuffer(ShortBuffer.wrap(data)); mainScreen.copyPixelsFromBuffer(ShortBuffer.wrap(data));

View file

@ -63,13 +63,13 @@ public class X48 extends Activity {
requestWindowFeature(Window.FEATURE_NO_TITLE); requestWindowFeature(Window.FEATURE_NO_TITLE);
requestWindowFeature(Window.FEATURE_PROGRESS); requestWindowFeature(Window.FEATURE_PROGRESS);
setContentView(R.layout.main);
mainView = (HPView) findViewById(R.id.hpview);
mHandler = new Handler(Looper.getMainLooper()) { mHandler = new Handler(Looper.getMainLooper()) {
@Override @Override
public void handleMessage(Message inputMessage) { public void handleMessage(Message inputMessage) {
if (inputMessage.what == 1) { if (inputMessage.what == 1) {
setContentView(R.layout.main);
mainView = (HPView) findViewById(R.id.hpview);
readyToGo(); readyToGo();
if (!AssetUtil.isFilesReady(X48.this)) { if (!AssetUtil.isFilesReady(X48.this)) {
showDialog(DIALOG_ROM_KO); showDialog(DIALOG_ROM_KO);