diff --git a/bin/classes.dex b/bin/classes.dex index 3d213dd..05e54f9 100644 Binary files a/bin/classes.dex and b/bin/classes.dex differ diff --git a/bin/droid48.apk b/bin/droid48.apk index d7bf0bb..6867c37 100644 Binary files a/bin/droid48.apk and b/bin/droid48.apk differ diff --git a/src/org/ab/x48/HPView.java b/src/org/ab/x48/HPView.java index e4caca8..3ff93f3 100644 --- a/src/org/ab/x48/HPView.java +++ b/src/org/ab/x48/HPView.java @@ -33,41 +33,18 @@ public class HPView extends SurfaceView implements SurfaceHolder.Callback, Runna private X48 x48; private Bitmap mainScreen; private SurfaceHolder mSurfaceHolder; - //private Bitmap mBackgroundImage; - //private Bitmap mBackgroundImageLand; - //private Bitmap mTouchImage; private Bitmap annImages []; boolean ann []; int ann_pos [] = { 62, 105, 152, 197, 244, 287 }; private List queuedCodes; private boolean touches [] = new boolean [MAX_TOUCHES]; - //private int touches_x [] = new int [MAX_TOUCHES]; - //private int touches_y [] = new int [MAX_TOUCHES]; private short buf []; private int currentOrientation; - //private float scaleX = 1.0f; - //private float scaleY = 1.0f; - int buttons_coords [][] = new int [MAX_TOUCHES][4]; int icons_coords [][] = new int [6][2]; - /*int screen_coord [] = new int[2]; - float screen_factor_x = 1; - float back_factor_x = 1; - - float screen_factor_y = 1; - float back_factor_y = 1; - - int buttons_coords_land [][] = new int [MAX_TOUCHES][4]; - int icons_coords_land [][] = new int [6][2]; - int screen_coord_land [] = new int[2]; - float screen_factor_land_x = 1; - float back_factor_land_x = 1; - - float screen_factor_land_y = 1; - float back_factor_land_y = 1;*/ - + Matrix matrixScreen; Matrix matrixBack; Paint paint; @@ -106,247 +83,7 @@ public class HPView extends SurfaceView implements SurfaceHolder.Callback, Runna } - /* - private void initGraphicsElements() { - - - icons_coords = new int [][] { { 62, 0 }, {105, 0}, {152, 0}, {197, 0}, {244, 0}, {287, 0} }; - screen_coord = new int [] { 46-15, 1 }; - screen_factor_x = 1; - screen_factor_y = 1; - back_factor_x = 1; - back_factor_y = 1; - buttons_coords = new int [][] { - {15, 139, 83, 170}, - {83, 139, 129, 170}, - {129, 139, 175, 170}, - {175, 139, 221, 170}, - {221, 139, 267, 170}, - {267, 139, 1000, 170}, - {15, 170, 83, 206}, - {83, 170, 129, 206}, - {129, 170, 175, 206}, - {175, 170, 221, 206}, - {221, 170, 267, 206}, - {267, 170, 1000, 206}, - {15, 206, 83, 242}, - {83, 206, 129, 242}, - {129, 206, 175, 242}, - {175, 206, 221, 242}, - {221, 206, 267, 242}, - {267, 206, 1000, 242}, - {15, 242, 83, 276}, - {83, 242, 129, 276}, - {129, 242, 175, 276}, - {175, 242, 221, 276}, - {221, 242, 267, 276}, - {267, 242, 1000, 276}, - {15, 276, 129, 312}, // enter - {129, 276, 175, 312}, - {175, 276, 221, 312}, - {221, 276, 267, 312}, - {267, 276, 1000, 312}, - {15, 312, 91, 348}, - {91, 312, 147, 348}, - {147, 312, 203, 348}, - {203, 312, 259, 348}, - {259, 312, 1000, 348}, - {15, 348, 91, 383}, - {91, 348, 147, 383}, - {147, 348, 203, 383}, - {203, 348, 259, 383}, - {259, 348, 1000, 383}, - {15, 383, 91, 418}, - {91, 383, 147, 418}, - {147, 383, 203, 418}, - {203, 383, 259, 418}, - {259, 383, 1000, 418}, - {15, 418, 91, 1000}, - {91, 418, 147, 1000}, - {147, 418, 203, 1000}, - {203, 418, 259, 1000}, - {259, 418, 1000, 1000} - }; - for(int i=0;i 750 || height > 750) && mBackgroundImage.getWidth() == 480) //hdpi mode - { - screen_factor_x = 1.5f; - screen_factor_y = 1.5f; - screen_factor_land_x = 1.5f; - screen_factor_land_y = 1.5f; - - ratio_x = (float) width / 480; - if (height < width) // land - ratio_x = (float) width / 800; - - ratio_y = ratio_x; - - - back_factor_x = ratio_x; - back_factor_y = ratio_y; - back_factor_land_x = ratio_x; - back_factor_land_y = ratio_y; - - screen_factor_land_x = screen_factor_land_x * ratio_x; - screen_factor_land_y = screen_factor_land_y * ratio_y; - buttons_coords = new int [][] { - {0, 215, 80, 274}, - {80, 215, 160, 274}, - {160, 215, 240, 274}, - {240, 215, 320, 274}, - {320, 215, 400, 274}, - {400, 215, 480, 274}, - {0, 274, 80, 336}, - {80, 274, 160, 336}, - {160, 274, 240, 336}, - {240, 274, 320, 336}, - {320, 274, 400, 336}, - {400, 274, 480, 336}, - {0, 336, 80, 396}, - {80, 336, 160, 396}, - {160, 336, 240, 396}, - {240, 336, 320, 396}, - {320, 336, 400, 396}, - {400, 336, 480, 396}, - {0, 396, 80, 454}, - {80, 396, 160, 454}, - {160, 396, 240, 454}, - {240, 396, 320, 454}, - {320, 396, 400, 454}, - {400, 396, 480, 454}, - {0, 454, 160, 514}, // enter - {160, 454, 240, 514}, - {240, 454, 320, 514}, - {320, 454, 400, 514}, - {400, 454, 480, 514}, - {0, 514, 96, 576}, - {96, 514, 192, 576}, - {192, 514, 288, 576}, - {288, 514, 384, 576}, - {384, 514, 480, 576}, - {0, 576, 96, 638}, - {96, 576, 192, 638}, - {192, 576, 288, 638}, - {288, 576, 384, 638}, - {384, 576, 480, 638}, - {0, 638, 96, 698}, - {96, 638, 192, 698}, - {192, 638, 288, 698}, - {288, 638, 384, 698}, - {384, 638, 480, 698}, - {0, 698, 96, 1000}, - {96, 698, 192, 1000}, - {192, 698, 288, 1000}, - {288, 698, 384, 1000}, - {384, 698, 480, 1000} - }; - } else { - for(int i=0;i= buttons_coords[i][0] && x < buttons_coords[i][2] && y >= buttons_coords[i][1] && y < buttons_coords[i][3]) - { - code = i; - break; - } - } - if (code == -1 && action == MotionEvent.ACTION_DOWN && currentOrientation != Configuration.ORIENTATION_LANDSCAPE ) { - //x48.flipkeyboard(); - keybLite = !keybLite; - backBuffer = null; - refreshMainScreen(null); - return true; - } - } else { - - /*for(int i=0;i= buttons_coords_land[i][0] && x < buttons_coords_land[i][2] && y >= buttons_coords_land[i][1] && y < buttons_coords_land[i][3]) - { - code = i; - break; - } - } - */ - } - - //Log.i("x48", "action: " + action + " code: " + code); + for(int i=0;i= buttons_coords[i][0] && x < buttons_coords[i][2] && y >= buttons_coords[i][1] && y < buttons_coords[i][3]) + { + code = i; + break; + } + } + if (code == -1 && action == MotionEvent.ACTION_DOWN && currentOrientation != Configuration.ORIENTATION_LANDSCAPE ) { + //x48.flipkeyboard(); + keybLite = !keybLite; + backBuffer = null; + refreshMainScreen(null); + return true; + } + if (code > -1) { key(code, action == MotionEvent.ACTION_DOWN); return action == MotionEvent.ACTION_DOWN; @@ -1046,16 +746,5 @@ public class HPView extends SurfaceView implements SurfaceHolder.Callback, Runna default: return false; } } - - @Override - public boolean onTrackballEvent(MotionEvent event) { - /*float x = event.getX(); - float y = event.getY(); - int hs = event.getHistorySize(); - Log.i("x48", "tevent: " + hs + " x: " + x + " - " + y); - return true;*/ - return super.onTrackballEvent(event); - } - }