Compare commits

...
13 Commits
Author SHA1 Message Date
Markus Fisch 3244f0775f Advance version number to 1.3.5 2018-08-08 18:48:06 +02:00
Markus Fisch f4d625a048 Fix some minor style issues 2018-08-08 18:29:34 +02:00
Markus Fisch c838486ca1 Apply Kotlin Coding Conventions
Functions that don't fit on a single line should use
the following syntax:

https://kotlinlang.org/docs/reference/coding-conventions.html#function-formatting
2018-07-29 23:37:02 +02:00
Markus Fisch d4a9ea1a4b Fix directory name of german resources
Because `values-de-DE` results in:
> Error: Invalid resource directory name
2018-07-29 23:35:55 +02:00
Markus Fisch 4123905853 Add german translation for encode button
Remove `app_name` because that's in `donottranslate.xml`.

And convert spaces to tabs.
2018-07-29 23:29:53 +02:00
Markus FischandGitHub 720811bf3b Add German translation
Merge pull request #4 from ialokim/german
2018-07-29 23:27:50 +02:00
Markus FischandGitHub 375fb4aa46 Fix Share intent handling
Merge pull request #3 from ialokim/encode-indent
2018-07-29 23:26:42 +02:00
Ialokim aa4b79d13d added German translation 2018-07-29 19:43:53 +02:00
Ialokim 1e9c303646 handle Intent.SEND correctly, directly opening EncodeFragment 2018-07-29 19:20:37 +02:00
Markus Fisch d3ab28f2b3 Update Kotlin version 2018-07-29 15:44:54 +02:00
Markus Fisch 7b67778a29 Return scan result for ZXing' SCAN intents
Of course, handling ZXing' SCAN intents makes only
sense when the app is returning the scanned data.

And that's why responding to IMAGE_CAPTURE does not
make sense at all. Removed that.
2018-07-29 15:40:47 +02:00
Markus Fisch d2c8ef719b Respond to IMAGE_CAPTURE and ZXing' SCAN intents
So a user can pick Binary Eye in the share menu.
2018-07-29 13:32:24 +02:00
Markus Fisch 7bed192300 Update build tools and target SDK 2018-07-05 21:32:03 +02:00
8 changed files with 64 additions and 11 deletions
+5
View File
@@ -1,5 +1,10 @@
# Change Log
## 1.3.5
* Add german translation
* Fix handling of data intents
* Respond to ZXing' SCAN intents
## 1.3.4
* Fix pre-processing for Android 7+
* Fix adaptive icons for Android 8+
+2 -2
View File
@@ -14,8 +14,8 @@ android {
minSdkVersion 9
targetSdkVersion sdk_version
versionCode 10
versionName '1.3.4'
versionCode 11
versionName '1.3.5'
// it's recommended to set this value to the lowest API level
// able to provide all the functionality
+5 -1
View File
@@ -29,11 +29,15 @@
<activity
android:name=".activity.CameraActivity"
android:label="@string/scan_code">
<intent-filter>
<intent-filter android:label="@string/compose_barcode">
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/plain"/>
</intent-filter>
<intent-filter>
<action android:name="com.google.zxing.client.android.SCAN"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
@@ -56,6 +56,7 @@ class CameraActivity : AppCompatActivity() {
private var frameOrientation: Int = 0
private var invert = false
private var flash = false
private var returnResult = false
override fun onRequestPermissionsResult(
requestCode: Int,
@@ -109,6 +110,10 @@ class CameraActivity : AppCompatActivity() {
override fun onResume() {
super.onResume()
System.gc()
returnResult = "com.google.zxing.client.android.SCAN".equals(
intent.action
)
handleSendText(intent)
if (hasCameraPermission()) {
cameraView.openAsync(
CameraView.findCameraId(
@@ -179,7 +184,8 @@ class CameraActivity : AppCompatActivity() {
// consume this intent
intent.setAction(null)
startActivity(MainActivity.getEncodeIntent(this, text))
startActivity(MainActivity.getEncodeIntent(this, text, true))
finish()
}
private fun hasCameraPermission(): Boolean {
@@ -393,6 +399,14 @@ class CameraActivity : AppCompatActivity() {
cancelDecoding()
vibrator.vibrate(100)
if (returnResult) {
val resultIntent = Intent()
resultIntent.putExtra("SCAN_RESULT", result.text)
setResult(RESULT_OK, resultIntent)
finish()
return
}
startActivity(
MainActivity.getDecodeIntent(
this,
@@ -59,14 +59,26 @@ class MainActivity : AppCompatActivity() {
private const val DECODE = "decode"
private const val DECODE_FORMAT = "decode_format"
fun getEncodeIntent(context: Context, text: String? = ""): Intent {
fun getEncodeIntent(
context: Context,
text: String? = "",
isExternal: Boolean = false
): Intent {
val intent = Intent(context, MainActivity::class.java)
intent.putExtra(ENCODE, text)
if (isExternal) {
intent.addFlags(
android.content.Intent.FLAG_ACTIVITY_NO_HISTORY or
android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK or
android.content.Intent.FLAG_ACTIVITY_NEW_TASK
)
}
return intent
}
fun getDecodeIntent(
context: Context, text: String,
context: Context,
text: String,
format: BarcodeFormat
): Intent {
val intent = Intent(context, MainActivity::class.java)
@@ -118,7 +118,7 @@ class EncodeFragment : Fragment() {
private fun updateSize(power: Int) {
val size = getSize(power)
sizeView.setText("${size}x${size}")
sizeView.setText("${size}x$size")
}
private fun getSize(power: Int) = 128 * (power + 1)
+18
View File
@@ -0,0 +1,18 @@
<resources>
<string name="no_camera_no_fun">Diese App kann ohne Kamerazugriff nicht funktionieren. Tschüss!</string>
<string name="camera_error">Auf die Kamera kann nicht zugegriffen werden, bitte versuche es nochmal</string>
<string name="scan_code">Code scannen</string>
<string name="compose_barcode">Barcode erstellen</string>
<string name="content">Inhalt</string>
<string name="copy_to_clipboard">In die Zwischenablage kopieren</string>
<string name="put_into_clipboard">In die Zwischenablage legen</string>
<string name="open_url">URL öffnen</string>
<string name="cannot_resolve_action">Keine App kann das öffnen</string>
<string name="format">Format</string>
<string name="size">Größe in Pixeln</string>
<string name="input_content_here">Gib den Inhalt hier ein</string>
<string name="encode">KODIEREN</string>
<string name="error_no_content">Fehlender Inhalt</string>
<string name="view_barcode">Barcode ansehen</string>
<string name="info">Info</string>
</resources>
+4 -4
View File
@@ -1,8 +1,8 @@
buildscript {
ext.kotlin_version = '1.2.41'
ext.tools_version = '3.1.2'
ext.kotlin_version = '1.2.51'
ext.tools_version = '3.1.3'
ext.build_tools_version = '27.0.3'
ext.sdk_version = 27
ext.sdk_version = 28
ext.support_version = '25.3.1'
repositories {
@@ -22,7 +22,7 @@ buildscript {
}
plugins {
id 'org.sonarqube' version '2.6'
id 'org.sonarqube' version '2.6.2'
}
allprojects {