0
0
mirror of https://github.com/markusfisch/BinaryEye.git synced 2024-09-20 12:02:17 +02:00
Commit Graph

535 Commits

Author SHA1 Message Date
Markus Fisch
acdac4ca30 Improve german translation for ROI handle setting 2020-06-02 17:36:19 +02:00
Markus Fisch
221cf11576 Convert ROI handle positions to integer points
Because they're always discrete values and can never be inbetween.

Also, calling `drawBitmap()` with float values can lead to slightly
distorted renderings because the image is interpolated between
pixels then.

So let's just avoid this by using integers.
2020-06-02 16:04:39 +02:00
Markus Fisch
d34fceb48f Move ROI button back in place if ROI is too small
It's probably better to restore the original situation than
having the button stay where it is.

Also clean up DetectorView a bit and refactor some variables.
2020-06-02 09:59:18 +02:00
Markus Fisch
4cc4cef4ca Show plus in FAB if flash is not available
So it doesn't look awkward when a device doesn't have a flash.
2020-06-01 22:49:25 +02:00
Markus Fisch
969ffd3d0a Move ROI button above FAB
Looks tidier.
2020-06-01 22:48:42 +02:00
Markus Fisch
81a505c752 Refactor Candidates to Dots
The dots aren't just candidates but may already be result points
so this name doesn't really fit.
2020-06-01 20:04:06 +02:00
Markus Fisch
eafcf0dba6 Rename ic_crop_handle to button_crop
It's not an icon but a button.
2020-06-01 19:58:29 +02:00
zmni
0539468d3d
Update Indonesian translation 2020-06-01 19:48:09 +02:00
Markus Fisch
5e9361ac77 Keep ROI over orientation changes 2020-06-01 10:44:48 +02:00
Markus Fisch
54fb31d6a5 Show a default ROI when button is just tapped
Nobody knows the button is a handle that can be used.

So the natural thing to do is to tap on it which should do the
next best thing and that is showing a default region of interest.

Maybe the button should be positioned above the fab and have a
different color when inactive.
2020-05-31 22:11:43 +02:00
Markus Fisch
0f7da91e77 Draw round corners for ROI box
Looks much better.
2020-05-31 19:29:00 +02:00
Markus Fisch
13bbb3e435 Update build tools and gradle wrapper 2020-05-31 13:15:46 +02:00
Markus Fisch
e318385032 Advance version number to 1.30.0 2020-05-30 14:42:17 +02:00
Markus Fisch
9b1445efb5 Draw a dotted rectangle around ROI below Kitkat
Because Canvas.clipRect() doesn't work very well below
Kitkat.
2020-05-30 14:32:35 +02:00
Markus Fisch
9a74098f11 Commit tryHarder and autoRotate instead of apply
It's important those values are updated before returning to the
CameraActivity. `apply()` saves preferences asynchronously what
can be too late.
2020-05-30 13:46:52 +02:00
Markus Fisch
e22d242248 Add a setting to show/hide crop handle
In case somebody doesn't like/want this feature.
2020-05-30 13:40:01 +02:00
Markus Fisch
77d419aa7b Refactor axis to center in DetectorView
And name all crop handle variables just handle.
2020-05-30 13:22:05 +02:00
Markus Fisch
b2fbdceee4 Put crop handle to center bottom for portait
And to center right in landscape.
2020-05-30 12:40:23 +02:00
Markus Fisch
8a625dc5d0 Fix malformed XML of spanish translation 2020-05-30 12:40:11 +02:00
Markus Fisch
6d9c6aa53f Snap crop area for cancelled touches too
And make handlePos private because it's not used from the outside yet.
2020-05-30 12:37:29 +02:00
Markus Fisch
6b03935b9a Add a drop shadow to crop handle
To give it a similar look like the FAB.
2020-05-30 12:34:32 +02:00
Markus Fisch
fcac0add8b Add a handle to define a region of interest
And scan only within that region.

Helps to scan only a certain barcode when there are a lot
of barcodes very close together.
2020-05-29 21:02:45 +02:00
Markus Fisch
f63b78cc28 Remove insignificant inline argument
Because "inlining works best for functions with parameters
of functional types".
2020-05-29 09:03:50 +02:00
Diego Sangunietti
f34194c5b5
Add spanish translation 2020-05-29 08:57:24 +02:00
Markus Fisch
f2a22d2312 Keep camera selection over orientation changes
And save the facing flag in the state bundle too.
2020-05-28 22:24:56 +02:00
Markus Fisch
746bcc0706 Simplify generating hex dump
To export binary data.
2020-05-27 22:29:27 +02:00
Markus Fisch
2525b693c7 Add support for VCALENDAR types
Treat VCALENDAR like VEVENT types as VCALENDAR is just a wrapper
around a VEVENT.

Also add a few simple tests for VCARD, VCALENDAR and VEVENT to
make sure everything works as expected.
2020-05-27 22:23:00 +02:00
Markus Fisch
ba9970eb4d Vibrate only if activity isn't finishing
With Gesture Navigation, a back may also move the image a bit
what will cause the view to redraw and to vibrate even if the
activity is already finishing.
2020-05-24 15:37:44 +02:00
Markus Fisch
0495985518 Add copy to clipboard button to context menu
So it's easy to quickly copy something from the history.
2020-05-22 19:18:33 +02:00
Markus Fisch
b662ba9307 Enable/disable menu items in history list
Depending on if there are scans visible or not.
2020-05-22 19:04:47 +02:00
Markus Fisch
c4fe713b6d Check for null before using last list child 2020-05-22 18:55:13 +02:00
Markus Fisch
3609c377d2 Always remove current listing in history only
When the list is filtered, the remove all button should only
affect those records.
2020-05-22 18:53:11 +02:00
Markus Fisch
8043ab7eff Advance version number to 1.29.0 2020-05-22 13:39:41 +02:00
Markus Fisch
4f7b392611 Add a note about using the NDK and RenderScript
At the time of writing, it's important to _not_ have the NDK available
when compiling the custom rotation kernel. This will produce a broken
build for some ARMv7 devices running Android 6 (e.g. One Plus X,
Yotaphone 2, Moto E) while it works for newer Android versions.
2020-05-19 22:12:19 +02:00
Markus Fisch
27fb611f4e Add a note about scanning 2D barcodes with ZXing 2020-05-19 22:07:35 +02:00
Markus Fisch
3c693c7bd5 Rotate every other frame if auto rotate is set
Add a new setting that will automatically rotate every other frame
by 90 degrees. This makes it possible to read vertical 1D barcodes
too. ZXing can read 1D barcodes horizontally only.

The setting is unset by default because it makes recognition of 1D
barcodes a tiny bit slower since half of the frames are now useless
for ZXing (because the barcode is in the wrong orientation on them).

On a fast device, this is hardly noticeable. But on a low-end device
it makes a slight difference which is why the setting is unset by
default.
2020-05-19 20:21:27 +02:00
Markus Fisch
b2cc1c3c34 Move posting result into its on function
Easier to read.
2020-05-15 13:46:08 +02:00
Markus Fisch
e2effb613f Add a rule to dump meminfo of debug version 2020-05-15 13:38:51 +02:00
Markus Fisch
ae422d9a02 Advance version number to 1.28.0 2020-05-15 10:14:50 +02:00
zmni
ace841814a
Update Indonesian translation 2020-05-15 09:55:16 +02:00
Markus Fisch
21c3206464 Reset preprocessor to fit current orientation
Important for landscape to landscape orientation changes.
2020-05-14 20:28:05 +02:00
Markus Fisch
f392baca8b Remove special RenderScript handling for LineageOS
Always running `RenderScript.forceCompat()` interferes with the
`forceCompat` flag that is set/unset if there is a RSRuntimeException.

Now that the app is restarting automatically for a RSRuntimeException
this special handling is no longer required anyway.
2020-05-14 14:08:28 +02:00
Markus Fisch
4cd0fb6418 Restart the app a fixed number of times only
To avoid being stuck in a restart loop if there is always a
RSRuntimeException not matter if forceCompat() is called or
not.
2020-05-14 14:05:06 +02:00
Markus Fisch
5b948a4c8f Add a commit() method to preferences too
Removes the doubled code for putting a Boolean into preferences.
2020-05-14 14:02:25 +02:00
Markus Fisch
a75aff2e64 Add a note about RenderScript to the README
To save others from stumbling over the same problems.
2020-05-14 11:58:25 +02:00
Markus Fisch
a49a49f1d2 Save preference onStop() instead of onPause()
There's no need to save preference in onPause() when there's
onStop().
2020-05-13 13:42:07 +02:00
Markus Fisch
6db46f1d0d Automatically restart the app after a RSRuntimeExc
And toggle the forceCompat flag instead of setting it to true
so it works the other way round too.

Of course, this makes much more sense if there was a switch to
manually enable/disable forceCompat so a user can play with it.

On the other hand, I don't want users to bother with this.
So it's probably best to try and fix this behind the curtain.
2020-05-13 13:35:46 +02:00
Markus Fisch
1c0062df8b Share history as CSV and JSON too 2020-05-12 12:17:45 +02:00
Markus Fisch
d776688d26 Refactor string resource name
error_saving_binary_data should really be just error_saving_file.
2020-05-12 11:58:39 +02:00
Markus Fisch
9856aa9efa Move showing result toast to top most call
So toasts are not scattered all over export functions.
2020-05-12 11:53:58 +02:00