"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "android/app/src/main/java/com/thomasokken/free42/Free42Activity.java" between
free42-3.0.1.tar.gz and free42-3.0.2.tar.gz

About: Free42 is a re-implementation of the HP-42S scientific calculator and the HP-82240 printer.

Free42Activity.java  (free42-3.0.1):Free42Activity.java  (free42-3.0.2)
skipping to change at line 113 skipping to change at line 113
public static final String[] builtinSkinNames = new String[] { "Standard", " Landscape" }; public static final String[] builtinSkinNames = new String[] { "Standard", " Landscape" };
private static final int SHELL_VERSION = 18; private static final int SHELL_VERSION = 18;
private static final int PRINT_BACKGROUND_COLOR = Color.LTGRAY; private static final int PRINT_BACKGROUND_COLOR = Color.LTGRAY;
private static final int MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION = 1; private static final int MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION = 1;
public static Free42Activity instance; public static Free42Activity instance;
public static final String MY_STORAGE_DIR = Environment.getExternalStorageDi
rectory() + "/Android/data/com.thomasokken.free42";
static { static {
System.loadLibrary("free42"); System.loadLibrary("free42");
} }
private CalcView calcView; private CalcView calcView;
private SkinLayout skin; private SkinLayout skin;
private View printView; private View printView;
private PrintPaperView printPaperView; private PrintPaperView printPaperView;
private ScrollView printScrollView; private ScrollView printScrollView;
private boolean printViewShowing; private boolean printViewShowing;
skipping to change at line 1078 skipping to change at line 1076
setContentView(view); setContentView(view);
this.setTitle("About Free42"); this.setTitle("About Free42");
} }
private class AboutView extends RelativeLayout { private class AboutView extends RelativeLayout {
public AboutView(Context context) { public AboutView(Context context) {
super(context); super(context);
ImageView icon = new ImageView(context); ImageView icon = new ImageView(context);
icon.setId(1); icon.setId(1);
icon.setImageResource(R.drawable.icon); icon.setImageResource(R.mipmap.icon);
addView(icon); addView(icon);
TextView label1 = new TextView(context); TextView label1 = new TextView(context);
label1.setId(2); label1.setId(2);
String version = ""; String version = "";
try { try {
version = " " + getPackageManager().getPackageInfo(getPackag eName(), 0).versionName; version = " " + getPackageManager().getPackageInfo(getPackag eName(), 0).versionName;
} catch (NameNotFoundException e) {} } catch (NameNotFoundException e) {}
label1.setText("Free42" + version); label1.setText("Free42" + version);
LayoutParams lp = new RelativeLayout.LayoutParams(RelativeLayout .LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT); LayoutParams lp = new RelativeLayout.LayoutParams(RelativeLayout .LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
skipping to change at line 1795 skipping to change at line 1793
ShellSpool.printToTxt = false; ShellSpool.printToTxt = false;
ShellSpool.printToTxtFileName = ""; ShellSpool.printToTxtFileName = "";
// fall through // fall through
case 0: case 0:
ShellSpool.maxGifHeight = 256; ShellSpool.maxGifHeight = 256;
// fall through // fall through
case 1: case 1:
skinName[0] = "Standard"; skinName[0] = "Standard";
// fall through // fall through
case 2: case 2:
externalSkinName[0] = topStorageDir() + "/Free42/" + skinName[0]; externalSkinName[0] = "";
// fall through // fall through
case 3: case 3:
skinName[1] = "Landscape"; skinName[1] = "Landscape";
externalSkinName[1] = topStorageDir() + "/Free42/" + skinName[1]; externalSkinName[1] = "";
keyClicksLevel = 3; keyClicksLevel = 3;
// fall through // fall through
case 4: case 4:
preferredOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; preferredOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
// fall through // fall through
case 5: case 5:
skinSmoothing[0] = true; skinSmoothing[0] = true;
displaySmoothing[0] = false; displaySmoothing[0] = false;
// fall through // fall through
case 6: case 6:
skipping to change at line 2006 skipping to change at line 2004
int ms = (int) (Math.pow(2, (keyVibration - 1) / 2.0) + 0.5); int ms = (int) (Math.pow(2, (keyVibration - 1) / 2.0) + 0.5);
Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
v.vibrate(ms); v.vibrate(ms);
} }
} }
public void playSound(int index, int duration) { public void playSound(int index, int duration) {
soundPool.play(soundIds[index], 1f, 1f, 0, 0, 1f); soundPool.play(soundIds[index], 1f, 1f, 0, 0, 1f);
} }
private static String topStorageDir() {
return Environment.getExternalStorageDirectory().getAbsolutePath();
}
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
///// Stubs for accessing the FREE42_MAGIC and FREE42_MAGIC_STR macros ///// ///// Stubs for accessing the FREE42_MAGIC and FREE42_MAGIC_STR macros /////
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
private static native int FREE42_MAGIC(); private static native int FREE42_MAGIC();
public static native String FREE42_MAGIC_STR(); public static native String FREE42_MAGIC_STR();
/////////////////////////////////////////// ///////////////////////////////////////////
///// Stubs for shell->core interface ///// ///// Stubs for shell->core interface /////
/////////////////////////////////////////// ///////////////////////////////////////////
skipping to change at line 2618 skipping to change at line 2612
public void shell_log(String s) { public void shell_log(String s) {
System.err.print(s); System.err.print(s);
} }
public static boolean checkStorageAccess() { public static boolean checkStorageAccess() {
return instance.checkStorageAccess2(); return instance.checkStorageAccess2();
} }
private boolean checkStorageAccess2() { private boolean checkStorageAccess2() {
if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EX TERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) { if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EX TERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
if (android.os.Build.VERSION.SDK_INT >= 19 /* KitKat; 4.4 */) getExternalFilesDir(null).mkdirs();
new File(MY_STORAGE_DIR).mkdirs();
return true; return true;
} }
ActivityCompat.requestPermissions(this, new String[] { Manifest.permissi on.WRITE_EXTERNAL_STORAGE }, MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION); ActivityCompat.requestPermissions(this, new String[] { Manifest.permissi on.WRITE_EXTERNAL_STORAGE }, MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);
return false; return false;
} }
} }
 End of changes. 6 change blocks. 
12 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)