gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-merchant-terminal-android] branch master updated: Fix lint and ma


From: gnunet
Subject: [taler-merchant-terminal-android] branch master updated: Fix lint and make all strings translatable
Date: Fri, 21 Feb 2020 19:34:59 +0100

This is an automated email from the git hooks/post-receive script.

torsten-grote pushed a commit to branch master
in repository merchant-terminal-android.

The following commit(s) were added to refs/heads/master by this push:
     new a78fac0  Fix lint and make all strings translatable
a78fac0 is described below

commit a78fac0ff0d959add9b17bea7aa613d13c5b7b43
Author: Torsten Grote <address@hidden>
AuthorDate: Fri Feb 21 15:34:33 2020 -0300

    Fix lint and make all strings translatable
---
 .idea/dictionaries/user.xml                        | 10 +++
 app/build.gradle                                   |  7 +--
 .../taler/merchantpos/ExampleInstrumentedTest.kt   | 24 -------
 app/src/main/AndroidManifest.xml                   |  3 +-
 app/src/main/java/net/taler/merchantpos/Amount.kt  |  7 ++-
 .../java/net/taler/merchantpos/MerchantHistory.kt  |  6 +-
 .../main/java/net/taler/merchantpos/NfcManager.kt  |  4 +-
 app/src/main/java/net/taler/merchantpos/Utils.kt   |  1 +
 .../merchantpos/payment/ProcessPaymentFragment.kt  |  4 +-
 .../res/drawable-v24/ic_launcher_foreground.xml    | 34 ----------
 app/src/main/res/drawable/ic_menu_camera.xml       | 12 ----
 app/src/main/res/drawable/ic_menu_gallery.xml      |  9 ---
 app/src/main/res/drawable/ic_menu_send.xml         |  9 ---
 app/src/main/res/drawable/ic_menu_share.xml        |  9 ---
 app/src/main/res/drawable/ic_menu_slideshow.xml    |  9 ---
 .../main/res/layout/fragment_merchant_history.xml  |  2 +-
 .../main/res/layout/fragment_payment_success.xml   | 63 +++++++++----------
 .../main/res/layout/fragment_process_payment.xml   | 73 +++++++++++++---------
 app/src/main/res/layout/history_row.xml            | 29 ++++-----
 app/src/main/res/layout/nav_header_main.xml        | 30 ++++-----
 app/src/main/res/menu/activity_main_drawer.xml     |  6 +-
 app/src/main/res/navigation/nav_graph.xml          |  3 +-
 app/src/main/res/values/dimens.xml                 |  2 -
 app/src/main/res/values/strings.xml                | 26 ++++----
 app/src/main/res/xml/backup_descriptor.xml         |  4 ++
 .../java/net/taler/merchantpos/ExampleUnitTest.kt  | 17 -----
 26 files changed, 153 insertions(+), 250 deletions(-)

diff --git a/.idea/dictionaries/user.xml b/.idea/dictionaries/user.xml
new file mode 100644
index 0000000..8113b4d
--- /dev/null
+++ b/.idea/dictionaries/user.xml
@@ -0,0 +1,10 @@
+<component name="ProjectDictionaryState">
+  <dictionary name="user">
+    <words>
+      <w>abcdef</w>
+      <w>apdu</w>
+      <w>merchantpos</w>
+      <w>qrcode</w>
+    </words>
+  </dictionary>
+</component>
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index ca16c9d..38ddaa9 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -10,7 +10,7 @@ android {
     buildToolsVersion "29.0.2"
     defaultConfig {
         applicationId "net.taler.merchantpos"
-        minSdkVersion 21
+        minSdkVersion 26
         targetSdkVersion 29
         versionCode 1
         versionName "1.0"
@@ -34,7 +34,6 @@ android {
 }
 
 dependencies {
-    implementation fileTree(dir: 'libs', include: ['*.jar'])
     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
     implementation 'androidx.appcompat:appcompat:1.1.0'
     implementation 'androidx.core:core-ktx:1.2.0'
@@ -63,8 +62,4 @@ dependencies {
 
     // JSON parsing and serialization
     implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.10.2"
-
-    testImplementation 'junit:junit:4.13'
-    androidTestImplementation 'androidx.test:runner:1.2.0'
-    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
 }
diff --git 
a/app/src/androidTest/java/net/taler/merchantpos/ExampleInstrumentedTest.kt 
b/app/src/androidTest/java/net/taler/merchantpos/ExampleInstrumentedTest.kt
deleted file mode 100644
index 705c8db..0000000
--- a/app/src/androidTest/java/net/taler/merchantpos/ExampleInstrumentedTest.kt
+++ /dev/null
@@ -1,24 +0,0 @@
-package net.taler.merchantpos
-
-import androidx.test.InstrumentationRegistry
-import androidx.test.runner.AndroidJUnit4
-
-import org.junit.Test
-import org.junit.runner.RunWith
-
-import org.junit.Assert.*
-
-/**
- * Instrumented test, which will execute on an Android device.
- *
- * See [testing documentation](http://d.android.com/tools/testing).
- */
-@RunWith(AndroidJUnit4::class)
-class ExampleInstrumentedTest {
-    @Test
-    fun useAppContext() {
-        // Context of the app under test.
-        val appContext = InstrumentationRegistry.getTargetContext()
-        assertEquals("net.taler.merchantpos", appContext.packageName)
-    }
-}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 95a071f..bd33d05 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -16,6 +16,7 @@
 
     <application
             android:allowBackup="true"
+            android:fullBackupContent="@xml/backup_descriptor"
             android:icon="@mipmap/ic_taler_logo"
             android:label="@string/app_name"
             android:roundIcon="@mipmap/ic_taler_logo_round"
@@ -35,4 +36,4 @@
         </activity>
     </application>
 
-</manifest>
\ No newline at end of file
+</manifest>
diff --git a/app/src/main/java/net/taler/merchantpos/Amount.kt 
b/app/src/main/java/net/taler/merchantpos/Amount.kt
index 15cadf4..16068cd 100644
--- a/app/src/main/java/net/taler/merchantpos/Amount.kt
+++ b/app/src/main/java/net/taler/merchantpos/Amount.kt
@@ -3,12 +3,15 @@ package net.taler.merchantpos
 import org.json.JSONObject
 
 data class Amount(val currency: String, val amount: String) {
+    @Suppress("unused")
     fun isZero(): Boolean {
         return amount.toDouble() == 0.0
     }
 
     companion object {
-        const val FRACTIONAL_BASE = 1e8;
+        private const val FRACTIONAL_BASE = 1e8
+
+        @Suppress("unused")
         fun fromJson(jsonAmount: JSONObject): Amount {
             val amountCurrency = jsonAmount.getString("currency")
             val amountValue = jsonAmount.getString("value")
@@ -26,4 +29,4 @@ data class Amount(val currency: String, val amount: String) {
             return Amount(components[0], components[1])
         }
     }
-}
\ No newline at end of file
+}
diff --git a/app/src/main/java/net/taler/merchantpos/MerchantHistory.kt 
b/app/src/main/java/net/taler/merchantpos/MerchantHistory.kt
index eb8288c..c21a8a7 100644
--- a/app/src/main/java/net/taler/merchantpos/MerchantHistory.kt
+++ b/app/src/main/java/net/taler/merchantpos/MerchantHistory.kt
@@ -69,15 +69,15 @@ class MerchantHistory : Fragment() {
             adapter = historyListAdapter
         }
 
-        swiperefresh.isRefreshing = false
-        swiperefresh.setOnRefreshListener {
+        swipeRefresh.isRefreshing = false
+        swipeRefresh.setOnRefreshListener {
             Log.v(TAG, "refreshing!")
             fetchHistory()
         }
 
         this.isLoading.observe(viewLifecycleOwner, androidx.lifecycle.Observer 
{ loading ->
             Log.v(TAG, "setting refreshing to $loading")
-            swiperefresh.isRefreshing = loading
+            swipeRefresh.isRefreshing = loading
         })
     }
 
diff --git a/app/src/main/java/net/taler/merchantpos/NfcManager.kt 
b/app/src/main/java/net/taler/merchantpos/NfcManager.kt
index 1d21795..1628d2b 100644
--- a/app/src/main/java/net/taler/merchantpos/NfcManager.kt
+++ b/app/src/main/java/net/taler/merchantpos/NfcManager.kt
@@ -14,6 +14,9 @@ import java.io.ByteArrayOutputStream
 import java.net.URL
 import javax.net.ssl.HttpsURLConnection
 
+@Suppress("unused")
+private const val TALER_AID = "A0000002471001"
+
 class NfcManager : NfcAdapter.ReaderCallback {
 
     companion object {
@@ -45,7 +48,6 @@ class NfcManager : NfcAdapter.ReaderCallback {
         }
     }
 
-    private val TALER_AID = "A0000002471001"
     private val flags = FLAG_READER_NFC_A or FLAG_READER_SKIP_NDEF_CHECK
 
     private var tagString: String? = null
diff --git a/app/src/main/java/net/taler/merchantpos/Utils.kt 
b/app/src/main/java/net/taler/merchantpos/Utils.kt
index a318d23..9b0075a 100644
--- a/app/src/main/java/net/taler/merchantpos/Utils.kt
+++ b/app/src/main/java/net/taler/merchantpos/Utils.kt
@@ -24,6 +24,7 @@ object Utils {
 
     private val HEX_CHARS_ARRAY = HEX_CHARS.toCharArray()
 
+    @Suppress("unused")
     fun toHex(byteArray: ByteArray): String {
         val result = StringBuffer()
 
diff --git 
a/app/src/main/java/net/taler/merchantpos/payment/ProcessPaymentFragment.kt 
b/app/src/main/java/net/taler/merchantpos/payment/ProcessPaymentFragment.kt
index 89198b8..738ec2f 100644
--- a/app/src/main/java/net/taler/merchantpos/payment/ProcessPaymentFragment.kt
+++ b/app/src/main/java/net/taler/merchantpos/payment/ProcessPaymentFragment.kt
@@ -1,5 +1,6 @@
 package net.taler.merchantpos.payment
 
+import android.annotation.SuppressLint
 import android.os.Bundle
 import android.view.LayoutInflater
 import android.view.View
@@ -50,8 +51,9 @@ class ProcessPaymentFragment : Fragment() {
             model.orderManager.restartOrUndo()
             return
         }
+        @SuppressLint("SetTextI18n")
         text_view_amount.text = "${payment.order.totalAsString} 
${payment.currency}"
-        text_view_order_reference.text = "Order Reference: ${payment.orderId}"
+        text_view_order_reference.text = getString(R.string.payment_order_ref, 
payment.orderId)
         payment.talerPayUri?.let {
             val qrcodeBitmap = makeQrCode(it)
             qrcode.setImageBitmap(qrcodeBitmap)
diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml 
b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
deleted file mode 100644
index 6348baa..0000000
--- a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<vector xmlns:android="http://schemas.android.com/apk/res/android";
-        xmlns:aapt="http://schemas.android.com/aapt";
-        android:width="108dp"
-        android:height="108dp"
-        android:viewportHeight="108"
-        android:viewportWidth="108">
-    <path
-            android:fillType="evenOdd"
-            android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 
70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
-            android:strokeColor="#00000000"
-            android:strokeWidth="1">
-        <aapt:attr name="android:fillColor">
-            <gradient
-                    android:endX="78.5885"
-                    android:endY="90.9159"
-                    android:startX="48.7653"
-                    android:startY="61.0927"
-                    android:type="linear">
-                <item
-                        android:color="#44000000"
-                        android:offset="0.0"/>
-                <item
-                        android:color="#00000000"
-                        android:offset="1.0"/>
-            </gradient>
-        </aapt:attr>
-    </path>
-    <path
-            android:fillColor="#FFFFFF"
-            android:fillType="nonZero"
-            android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 
76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 
36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 
50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 
63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 
72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 
65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C6 
[...]
-            android:strokeColor="#00000000"
-            android:strokeWidth="1"/>
-</vector>
diff --git a/app/src/main/res/drawable/ic_menu_camera.xml 
b/app/src/main/res/drawable/ic_menu_camera.xml
deleted file mode 100644
index 41688d5..0000000
--- a/app/src/main/res/drawable/ic_menu_camera.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<vector xmlns:android="http://schemas.android.com/apk/res/android";
-        android:width="24dp"
-        android:height="24dp"
-        android:viewportWidth="24.0"
-        android:viewportHeight="24.0">
-    <path
-            android:fillColor="#FF000000"
-            android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 
1,-6.4 0"/>
-    <path
-            android:fillColor="#FF000000"
-            android:pathData="M9,2L7.17,4H4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 
2,2h16c1.1,0 2,-0.9 2,-2V6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2H9zm3,15c-2.76,0 
-5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z"/>
-</vector>
diff --git a/app/src/main/res/drawable/ic_menu_gallery.xml 
b/app/src/main/res/drawable/ic_menu_gallery.xml
deleted file mode 100644
index ff8ce52..0000000
--- a/app/src/main/res/drawable/ic_menu_gallery.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<vector xmlns:android="http://schemas.android.com/apk/res/android";
-        android:width="24dp"
-        android:height="24dp"
-        android:viewportWidth="24.0"
-        android:viewportHeight="24.0">
-    <path
-            android:fillColor="#FF000000"
-            android:pathData="M22,16V4c0,-1.1 -0.9,-2 -2,-2H8c-1.1,0 -2,0.9 
-2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 
2,-2zm-11,-4l2.03,2.71L16,11l4,5H8l3,-4zM2,6v14c0,1.1 0.9,2 2,2h14v-2H4V6H2z"/>
-</vector>
diff --git a/app/src/main/res/drawable/ic_menu_send.xml 
b/app/src/main/res/drawable/ic_menu_send.xml
deleted file mode 100644
index 9745066..0000000
--- a/app/src/main/res/drawable/ic_menu_send.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<vector xmlns:android="http://schemas.android.com/apk/res/android";
-        android:width="24dp"
-        android:height="24dp"
-        android:viewportWidth="24.0"
-        android:viewportHeight="24.0">
-    <path
-            android:fillColor="#FF000000"
-            android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z"/>
-</vector>
diff --git a/app/src/main/res/drawable/ic_menu_share.xml 
b/app/src/main/res/drawable/ic_menu_share.xml
deleted file mode 100644
index b3e39e2..0000000
--- a/app/src/main/res/drawable/ic_menu_share.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<vector xmlns:android="http://schemas.android.com/apk/res/android";
-        android:width="24dp"
-        android:height="24dp"
-        android:viewportWidth="24.0"
-        android:viewportHeight="24.0">
-    <path
-            android:fillColor="#FF000000"
-            android:pathData="M18,16.08c-0.76,0 -1.44,0.3 
-1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 
-0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 
-3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 
6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 
2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 
2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z"/>
-</vector>
diff --git a/app/src/main/res/drawable/ic_menu_slideshow.xml 
b/app/src/main/res/drawable/ic_menu_slideshow.xml
deleted file mode 100644
index ae51e49..0000000
--- a/app/src/main/res/drawable/ic_menu_slideshow.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<vector xmlns:android="http://schemas.android.com/apk/res/android";
-        android:width="24dp"
-        android:height="24dp"
-        android:viewportWidth="24.0"
-        android:viewportHeight="24.0">
-    <path
-            android:fillColor="#FF000000"
-            android:pathData="M4,6H2v14c0,1.1 0.9,2 
2,2h14v-2H4V6zm16,-4H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 
2,-2V4c0,-1.1 -0.9,-2 -2,-2zm-8,12.5v-9l6,4.5 -6,4.5z"/>
-</vector>
diff --git a/app/src/main/res/layout/fragment_merchant_history.xml 
b/app/src/main/res/layout/fragment_merchant_history.xml
index abb757c..516e33b 100644
--- a/app/src/main/res/layout/fragment_merchant_history.xml
+++ b/app/src/main/res/layout/fragment_merchant_history.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <androidx.swiperefreshlayout.widget.SwipeRefreshLayout 
xmlns:android="http://schemas.android.com/apk/res/android";
-        android:id="@+id/swiperefresh"
+        android:id="@+id/swipeRefresh"
         android:layout_width="match_parent"
         android:layout_height="match_parent">
 
diff --git a/app/src/main/res/layout/fragment_payment_success.xml 
b/app/src/main/res/layout/fragment_payment_success.xml
index 8db64df..d6a27db 100644
--- a/app/src/main/res/layout/fragment_payment_success.xml
+++ b/app/src/main/res/layout/fragment_payment_success.xml
@@ -1,38 +1,33 @@
 <?xml version="1.0" encoding="utf-8"?>
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android";
+<androidx.constraintlayout.widget.ConstraintLayout 
xmlns:android="http://schemas.android.com/apk/res/android";
+        xmlns:app="http://schemas.android.com/apk/res-auto";
         xmlns:tools="http://schemas.android.com/tools";
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_margin="15dp"
-        tools:context=".PaymentSuccessful">
-
-
-    <LinearLayout
-            android:orientation="vertical"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent">
-
-        <Space android:layout_width="match_parent" android:layout_height="0dp"
-                android:layout_weight="1"/>
-
-        <TextView
-                android:layout_gravity="center"
-                android:layout_width="match_parent"
-                android:textAlignment="center"
-                android:layout_height="50dp"
-                android:text="Payment Received"
-                android:autoSizeTextType="uniform"
-                android:textColor="@android:color/holo_green_dark"/>
-
-
-        <Space android:layout_width="match_parent" android:layout_height="0dp"
-                android:layout_weight="1"/>
-        <Button
-                android:text="Go Back"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:id="@+id/button_success_back"/>
-
-    </LinearLayout>
-
-</FrameLayout>
\ No newline at end of file
+        android:layout_margin="16dp"
+        tools:context=".payment.PaymentSuccessFragment">
+
+    <TextView
+            android:id="@+id/textView3"
+            android:layout_width="0dp"
+            android:layout_height="0dp"
+            android:gravity="center"
+            android:text="@string/payment_received"
+            android:textColor="@android:color/holo_green_dark"
+            app:autoSizeMaxTextSize="42sp"
+            app:autoSizeTextType="uniform"
+            app:layout_constraintBottom_toTopOf="@+id/button_success_back"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+    <Button
+            android:id="@+id/button_success_back"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:text="@string/payment_back_button"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/app/src/main/res/layout/fragment_process_payment.xml 
b/app/src/main/res/layout/fragment_process_payment.xml
index 89e88d8..879773c 100644
--- a/app/src/main/res/layout/fragment_process_payment.xml
+++ b/app/src/main/res/layout/fragment_process_payment.xml
@@ -1,63 +1,76 @@
 <?xml version="1.0" encoding="utf-8"?>
 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android";
-             xmlns:app="http://schemas.android.com/apk/res-auto"; 
xmlns:tools="http://schemas.android.com/tools";
-             android:layout_width="match_parent"
-             android:layout_height="match_parent"
-             android:layout_margin="15dp"
-             tools:context=".payment.ProcessPaymentFragment" 
android:id="@+id/frameLayout2">
+        xmlns:app="http://schemas.android.com/apk/res-auto";
+        xmlns:tools="http://schemas.android.com/tools";
+        android:id="@+id/frameLayout2"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_margin="15dp"
+        tools:context=".payment.ProcessPaymentFragment">
 
     <androidx.constraintlayout.widget.ConstraintLayout
+            android:id="@+id/constraintLayout"
             android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:id="@+id/constraintLayout">
+            android:layout_height="match_parent">
 
         <Button
                 android:id="@+id/button_cancel_payment"
-                android:text="Cancel Payment"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
+                android:text="@string/payment_cancel"
                 app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintEnd_toEndOf="parent"/>
+                app:layout_constraintEnd_toEndOf="parent" />
+
         <ImageView
+                android:id="@+id/qrcode"
                 android:layout_width="269dp"
-                android:layout_height="275dp" 
tools:src="@tools:sample/backgrounds/scenic[16]"
-                android:id="@+id/qrcode" 
app:layout_constraintStart_toStartOf="parent"
+                android:layout_height="275dp"
+                android:layout_marginTop="32dp"
                 app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintTop_toTopOf="parent" 
android:layout_marginTop="32dp" />
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                tools:ignore="ContentDescription"
+                tools:src="@tools:sample/backgrounds/scenic[16]" />
+
         <TextView
-                android:text="@string/payment_intro_nfc"
+                android:id="@+id/textView2"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:id="@+id/textView2"
-                android:textSize="24sp"
                 android:layout_marginTop="15dp"
-                app:layout_constraintTop_toBottomOf="@+id/qrcode"
                 android:layout_marginBottom="15dp"
-                app:layout_constraintEnd_toEndOf="parent"
+                android:text="@string/payment_intro_nfc"
+                android:textAlignment="center"
+                android:textSize="24sp"
                 app:layout_constraintBottom_toTopOf="@+id/text_view_amount"
+                app:layout_constraintEnd_toEndOf="parent"
                 app:layout_constraintStart_toStartOf="parent"
-                android:textAlignment="center"/>
+                app:layout_constraintTop_toBottomOf="@+id/qrcode" />
+
         <TextView
-                android:text="AMOUNT"
+                android:id="@+id/text_view_amount"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:id="@+id/text_view_amount" android:textSize="30sp"
-                app:layout_constraintStart_toStartOf="parent"
                 android:layout_marginTop="39dp"
-                app:layout_constraintTop_toBottomOf="@+id/textView2"
+                android:textSize="30sp"
                 
app:layout_constraintBottom_toTopOf="@+id/text_view_order_reference"
                 app:layout_constraintEnd_toEndOf="parent"
-                tools:text="10.49 Eur"
-        />
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/textView2"
+                tools:text="10.49 Eur" />
+
         <TextView
-                android:text="Order Reference: 1234"
+                android:id="@+id/text_view_order_reference"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:id="@+id/text_view_order_reference" 
android:layout_marginTop="8dp"
-                app:layout_constraintTop_toBottomOf="@+id/text_view_amount" 
android:layout_marginBottom="8dp"
-                
app:layout_constraintBottom_toTopOf="@id/button_cancel_payment" 
app:layout_constraintStart_toStartOf="parent"
-                android:layout_marginStart="8dp" 
app:layout_constraintEnd_toEndOf="parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginTop="8dp"
                 android:layout_marginEnd="8dp"
-                android:textAlignment="center"/>
+                android:layout_marginBottom="8dp"
+                android:textAlignment="center"
+                app:layout_constraintBottom_toTopOf="@id/button_cancel_payment"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/text_view_amount"
+                tools:text="@string/payment_order_ref" />
     </androidx.constraintlayout.widget.ConstraintLayout>
 </FrameLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/history_row.xml 
b/app/src/main/res/layout/history_row.xml
index 12b93d5..22b6456 100644
--- a/app/src/main/res/layout/history_row.xml
+++ b/app/src/main/res/layout/history_row.xml
@@ -1,12 +1,13 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
-        xmlns:android="http://schemas.android.com/apk/res/android";
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android";
         xmlns:tools="http://schemas.android.com/tools";
-        android:orientation="vertical"
-        android:layout_height="wrap_content"
         android:layout_width="match_parent"
-        android:layout_marginHorizontal="15dp"
-        android:layout_marginVertical="5dp">
+        android:layout_height="wrap_content"
+        android:layout_marginStart="16dp"
+        android:layout_marginTop="8dp"
+        android:layout_marginEnd="16dp"
+        android:layout_marginBottom="8dp"
+        android:orientation="vertical">
 
     <TextView
             android:id="@+id/text_history_summary"
@@ -20,9 +21,9 @@
             android:id="@+id/text_history_amount"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="1 Euro"
             android:textSize="20sp"
-            android:textStyle="bold" />
+            android:textStyle="bold"
+            tools:text="1 Euro" />
 
     <LinearLayout
             android:layout_width="match_parent"
@@ -32,7 +33,7 @@
         <TextView
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="Received at "
+                android:text="@string/history_received_at"
                 android:textAllCaps="false"
                 android:textSize="20sp"
                 android:textStyle="italic" />
@@ -42,8 +43,8 @@
                 android:id="@+id/text_history_time"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="2019-08-31 14:25"
-                android:textSize="20sp" />
+                android:textSize="20sp"
+                tools:text="2019-08-31 14:25" />
 
     </LinearLayout>
 
@@ -56,7 +57,7 @@
         <TextView
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="Ref. No: "
+                android:text="@string/history_ref_no"
                 android:textAllCaps="false"
                 android:textSize="20sp"
                 android:textStyle="italic" />
@@ -65,10 +66,10 @@
                 android:id="@+id/text_history_order_id"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="2019.242-014B6QPFMHCTY"
                 android:textAllCaps="false"
                 android:textSize="20sp"
-                android:textStyle="italic" />
+                android:textStyle="italic"
+                tools:text="2019.242-014B6QPF1M1HC5TY" />
     </LinearLayout>
 
 </LinearLayout>
diff --git a/app/src/main/res/layout/nav_header_main.xml 
b/app/src/main/res/layout/nav_header_main.xml
index d84d107..2de58ad 100644
--- a/app/src/main/res/layout/nav_header_main.xml
+++ b/app/src/main/res/layout/nav_header_main.xml
@@ -1,39 +1,39 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
-        xmlns:android="http://schemas.android.com/apk/res/android";
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android";
         xmlns:app="http://schemas.android.com/apk/res-auto";
+        xmlns:tools="http://schemas.android.com/tools";
         android:layout_width="match_parent"
         android:layout_height="@dimen/nav_header_height"
         android:background="@drawable/side_nav_bar"
-        android:paddingBottom="@dimen/activity_vertical_margin"
+        android:gravity="bottom"
+        android:orientation="vertical"
         android:paddingLeft="@dimen/activity_horizontal_margin"
-        android:paddingRight="@dimen/activity_horizontal_margin"
         android:paddingTop="@dimen/activity_vertical_margin"
-        android:theme="@style/AppTheme"
-        android:orientation="vertical"
-        android:gravity="bottom">
+        android:paddingRight="@dimen/activity_horizontal_margin"
+        android:paddingBottom="@dimen/activity_vertical_margin"
+        android:theme="@style/AppTheme">
 
     <ImageView
+            android:id="@+id/imageView"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:paddingTop="@dimen/nav_header_vertical_spacing"
             app:srcCompat="@mipmap/ic_taler_logo_round"
-            android:contentDescription="@string/nav_header_desc"
-            android:id="@+id/imageView"/>
+            tools:ignore="ContentDescription" />
 
     <TextView
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:paddingTop="@dimen/nav_header_vertical_spacing"
-            android:textColor="#FFF"
-            android:text="GNU Taler"
-            android:textAppearance="@style/TextAppearance.AppCompat.Body1"/>
+            android:text="@string/project_name"
+            android:textAppearance="@style/TextAppearance.AppCompat.Body1"
+            android:textColor="#FFF" />
 
     <TextView
+            android:id="@+id/textView"
             android:layout_width="wrap_content"
-            android:textColor="#FFF"
             android:layout_height="wrap_content"
-            android:text="Merchant Terminal"
-            android:id="@+id/textView"/>
+            android:text="@string/app_name_short"
+            android:textColor="#FFF" />
 
 </LinearLayout>
diff --git a/app/src/main/res/menu/activity_main_drawer.xml 
b/app/src/main/res/menu/activity_main_drawer.xml
index 06f9e5c..9af7f1f 100644
--- a/app/src/main/res/menu/activity_main_drawer.xml
+++ b/app/src/main/res/menu/activity_main_drawer.xml
@@ -7,14 +7,14 @@
         <item
                 android:id="@+id/nav_order"
                 android:icon="@drawable/ic_move_money_24dp"
-                android:title="Order" />
+                android:title="@string/menu_order" />
         <item
                 android:id="@+id/nav_history"
                 android:icon="@drawable/ic_history_black_24dp"
-                android:title="History" />
+                android:title="@string/menu_history" />
         <item
                 android:id="@+id/nav_settings"
                 android:icon="@drawable/ic_menu_manage"
-                android:title="Settings" />
+                android:title="@string/menu_settings" />
     </group>
 </menu>
diff --git a/app/src/main/res/navigation/nav_graph.xml 
b/app/src/main/res/navigation/nav_graph.xml
index dc4015f..227cd3a 100644
--- a/app/src/main/res/navigation/nav_graph.xml
+++ b/app/src/main/res/navigation/nav_graph.xml
@@ -3,7 +3,8 @@
         xmlns:app="http://schemas.android.com/apk/res-auto";
         xmlns:tools="http://schemas.android.com/tools";
         android:id="@+id/nav_graph"
-        app:startDestination="@id/order">
+        app:startDestination="@id/order"
+        tools:ignore="UnusedNavigation">
 
     <fragment
             android:id="@+id/order"
diff --git a/app/src/main/res/values/dimens.xml 
b/app/src/main/res/values/dimens.xml
index 4ab4520..eedc3c6 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -1,8 +1,6 @@
 <resources>
-    <!-- Default screen margins, per the Android Design guidelines. -->
     <dimen name="activity_horizontal_margin">16dp</dimen>
     <dimen name="activity_vertical_margin">16dp</dimen>
     <dimen name="nav_header_vertical_spacing">8dp</dimen>
     <dimen name="nav_header_height">176dp</dimen>
-    <dimen name="fab_margin">16dp</dimen>
 </resources>
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml 
b/app/src/main/res/values/strings.xml
index 1a1c4ca..fe4a61b 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1,18 +1,11 @@
 <resources>
-    <string name="app_name">Taler Merchant PoS Termial</string>
-    <string name="navigation_drawer_open">Open navigation drawer</string>
-    <string name="navigation_drawer_close">Close navigation drawer</string>
-    <string name="nav_header_title">Android Studio</string>
-    <string name="nav_header_subtitle">address@hidden</string>
-    <string name="nav_header_desc">Navigation header</string>
-    <string name="action_settings">Settings</string>
+    <string name="app_name">Taler Merchant PoS Terminal</string>
+    <string name="app_name_short">Merchant Terminal</string>
+    <string name="project_name">GNU Taler</string>
 
-    <string name="menu_home">Home</string>
-    <string name="menu_gallery">Gallery</string>
-    <string name="menu_slideshow">Slideshow</string>
-    <string name="menu_tools">Tools</string>
-    <string name="menu_share">Share</string>
-    <string name="menu_send">Send</string>
+    <string name="menu_order">Order</string>
+    <string name="menu_history">History</string>
+    <string name="menu_settings">Settings</string>
 
     <string name="order_total">Total: %1$.2f</string>
     <string name="order_restart">Restart</string>
@@ -36,5 +29,12 @@
 
     <string name="payment_intro_nfc">Please scan QR Code or use NFC to 
pay</string>
     <string name="payment_intro">Please scan QR Code to pay</string>
+    <string name="payment_cancel">Cancel Payment</string>
+    <string name="payment_received">Payment Received</string>
+    <string name="payment_back_button">Go Back</string>
+    <string name="payment_order_ref">Order Reference: %s</string>
+
+    <string name="history_received_at">Received at</string>
+    <string name="history_ref_no">Ref. No:</string>
 
 </resources>
diff --git a/app/src/main/res/xml/backup_descriptor.xml 
b/app/src/main/res/xml/backup_descriptor.xml
new file mode 100644
index 0000000..6fd6103
--- /dev/null
+++ b/app/src/main/res/xml/backup_descriptor.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<full-backup-content>
+    <!-- Exclude specific shared preferences that contain GCM registration Id 
-->
+</full-backup-content>
diff --git a/app/src/test/java/net/taler/merchantpos/ExampleUnitTest.kt 
b/app/src/test/java/net/taler/merchantpos/ExampleUnitTest.kt
deleted file mode 100644
index 65b1b4e..0000000
--- a/app/src/test/java/net/taler/merchantpos/ExampleUnitTest.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-package net.taler.merchantpos
-
-import org.junit.Test
-
-import org.junit.Assert.*
-
-/**
- * Example local unit test, which will execute on the development machine 
(host).
- *
- * See [testing documentation](http://d.android.com/tools/testing).
- */
-class ExampleUnitTest {
-    @Test
-    fun addition_isCorrect() {
-        assertEquals(4, 2 + 2)
-    }
-}

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]