Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
faf300db3e | ||
|
|
2fbdd03225 | ||
|
|
9f825f9d5d | ||
|
|
5ff1904148 | ||
|
|
16e80ff80e | ||
|
|
1dcd1845a7 | ||
|
|
955f507023 | ||
|
|
47a3224b27 | ||
|
|
d2bf09d321 | ||
|
|
deee39b367 | ||
|
|
4829433725 | ||
|
|
9efd43e496 | ||
|
|
5bd904ba4f | ||
|
|
3244f0775f | ||
|
|
f4d625a048 | ||
|
|
c838486ca1 | ||
|
|
d4a9ea1a4b | ||
|
|
4123905853 | ||
|
|
720811bf3b | ||
|
|
375fb4aa46 | ||
|
|
aa4b79d13d | ||
|
|
1e9c303646 | ||
|
|
d3ab28f2b3 | ||
|
|
7b67778a29 | ||
|
|
d2c8ef719b | ||
|
|
7bed192300 |
@@ -1,5 +1,16 @@
|
||||
# Change Log
|
||||
|
||||
## 1.3.7
|
||||
* Normalize URL schemes
|
||||
|
||||
## 1.3.6
|
||||
* Fix handling of camera scene modes
|
||||
|
||||
## 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
@@ -14,8 +14,8 @@ android {
|
||||
minSdkVersion 9
|
||||
targetSdkVersion sdk_version
|
||||
|
||||
versionCode 10
|
||||
versionName '1.3.4'
|
||||
versionCode 13
|
||||
versionName '1.3.7'
|
||||
|
||||
// it's recommended to set this value to the lowest API level
|
||||
// able to provide all the functionality
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -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"/>
|
||||
|
||||
@@ -24,7 +24,6 @@ import android.support.v7.app.AppCompatActivity
|
||||
import android.support.v7.widget.Toolbar
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.widget.SeekBar
|
||||
import android.widget.Toast
|
||||
@@ -56,6 +55,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,
|
||||
@@ -89,7 +89,6 @@ class CameraActivity : AppCompatActivity() {
|
||||
zoomBar = findViewById(R.id.zoom) as SeekBar
|
||||
|
||||
initCameraView()
|
||||
setTapToFocus()
|
||||
initZoomBar()
|
||||
restoreZoom()
|
||||
initFlashFab(findViewById(R.id.flash))
|
||||
@@ -109,6 +108,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 +182,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 {
|
||||
@@ -199,6 +203,7 @@ class CameraActivity : AppCompatActivity() {
|
||||
|
||||
private fun initCameraView() {
|
||||
cameraView.setUseOrientationListener(true)
|
||||
cameraView.setTapToFocus()
|
||||
cameraView.setOnCameraListener(object : CameraView.OnCameraListener {
|
||||
override fun onConfigureParameters(
|
||||
parameters: Camera.Parameters
|
||||
@@ -214,10 +219,13 @@ class CameraActivity : AppCompatActivity() {
|
||||
} else {
|
||||
zoomBar.visibility = View.GONE
|
||||
}
|
||||
for (mode in parameters.getSupportedSceneModes()) {
|
||||
if (mode.equals(Camera.Parameters.SCENE_MODE_BARCODE)) {
|
||||
parameters.sceneMode = mode
|
||||
break
|
||||
val sceneModes = parameters.supportedSceneModes
|
||||
sceneModes?.let {
|
||||
for (mode in sceneModes) {
|
||||
if (mode.equals(Camera.Parameters.SCENE_MODE_BARCODE)) {
|
||||
parameters.sceneMode = mode
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
CameraView.setAutoFocus(parameters)
|
||||
@@ -250,31 +258,6 @@ class CameraActivity : AppCompatActivity() {
|
||||
})
|
||||
}
|
||||
|
||||
private fun setTapToFocus() {
|
||||
val runnable = Runnable {
|
||||
cameraView.setFocusArea(null)
|
||||
}
|
||||
cameraView.setOnTouchListener({ v: View, event: MotionEvent ->
|
||||
if (event.getActionMasked() == MotionEvent.ACTION_UP) {
|
||||
val camera = cameraView.camera
|
||||
camera?.cancelAutoFocus()
|
||||
cameraView.setFocusArea(
|
||||
cameraView.calculateFocusRect(
|
||||
event.x,
|
||||
event.y,
|
||||
100
|
||||
)
|
||||
)
|
||||
camera?.autoFocus({ _: Boolean, _: Camera ->
|
||||
cameraView.removeCallbacks(runnable)
|
||||
cameraView.postDelayed(runnable, 3000)
|
||||
})
|
||||
v.performClick()
|
||||
}
|
||||
true
|
||||
})
|
||||
}
|
||||
|
||||
private fun initZoomBar() {
|
||||
zoomBar.setOnSeekBarChangeListener(object :
|
||||
SeekBar.OnSeekBarChangeListener {
|
||||
@@ -393,6 +376,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)
|
||||
|
||||
@@ -102,7 +102,10 @@ class DecodeFragment : Fragment() {
|
||||
if (activity == null || url.isEmpty()) {
|
||||
return
|
||||
}
|
||||
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
|
||||
val intent = Intent(
|
||||
Intent.ACTION_VIEW,
|
||||
Uri.parse(url).normalizeScheme()
|
||||
)
|
||||
if (intent.resolveActivity(activity.getPackageManager()) != null) {
|
||||
startActivity(intent)
|
||||
} else {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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>
|
||||
+5
-5
@@ -1,8 +1,8 @@
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.2.41'
|
||||
ext.tools_version = '3.1.2'
|
||||
ext.build_tools_version = '27.0.3'
|
||||
ext.sdk_version = 27
|
||||
ext.kotlin_version = '1.3.10'
|
||||
ext.tools_version = '3.3.0'
|
||||
ext.build_tools_version = '28.0.3'
|
||||
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 {
|
||||
|
||||
+1
-1
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
|
||||
|
||||
Reference in New Issue
Block a user