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"?>
<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">
<activity android:name=".X48"
android:label="@string/app_name"

View file

@ -173,7 +173,6 @@ public class HPView extends SurfaceView implements SurfaceHolder.Callback, Runna
if (c > 2)
c = 2;
setContrast(0.5 * c);
//x48.flipScreen();
}
private void setContrast(double contrast_factor) {
@ -912,24 +911,25 @@ public class HPView extends SurfaceView implements SurfaceHolder.Callback, Runna
lcd_menuicon_x = lcd_pos_x_end - menuIcon.getWidth();
}
c.drawBitmap(backBuffer, 0, 0, null);
if (data != null)
mainScreen.copyPixelsFromBuffer(ShortBuffer.wrap(data));
c.drawBitmap(mainScreen, matrixScreen, screenPaint);
for(int i=0;i<MAX_TOUCHES;i++) {
if (touches[i] != 0) {
c.drawRoundRect(new RectF(new Rect(buttons_coords[i][0], buttons_coords[i][1], buttons_coords[i][2], buttons_coords[i][3])), 12f, 12f, paint);
}
}
for(int i=0;i<6;i++) {
if (ann[i])
c.drawBitmap(annImages[i], icons_coords[i][0], icons_coords[i][1], null);
}
if (systemOptionDisplayed)
c.drawBitmap(menuIcon, lcd_menuicon_x, lcd_pos_y, null);
if (backBuffer != null)
c.drawBitmap(backBuffer, 0, 0, null);
if (data != null)
mainScreen.copyPixelsFromBuffer(ShortBuffer.wrap(data));
c.drawBitmap(mainScreen, matrixScreen, screenPaint);
for(int i=0;i<MAX_TOUCHES;i++) {
if (touches[i] != 0) {
c.drawRoundRect(new RectF(new Rect(buttons_coords[i][0], buttons_coords[i][1], buttons_coords[i][2], buttons_coords[i][3])), 12f, 12f, paint);
}
}
for(int i=0;i<6;i++) {
if (ann[i])
c.drawBitmap(annImages[i], icons_coords[i][0], icons_coords[i][1], null);
}
if (systemOptionDisplayed)
c.drawBitmap(menuIcon, lcd_menuicon_x, lcd_pos_y, null);
} else {
//Log.i("x48", "null canvas !");

View file

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