aboutsummaryrefslogtreecommitdiff
path: root/wallet/src/main
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2020-03-24 09:22:01 -0300
committerTorsten Grote <t@grobox.de>2020-03-24 09:22:01 -0300
commit1dbc22f1faba07331953d761097d5ad91ffff5ce (patch)
tree9e4e3fd149eeb1be758cba4104c745b0c779e513 /wallet/src/main
parent864160280872fdb400c2e0e61aaaa1b858fba3f8 (diff)
downloadtaler-android-1dbc22f1faba07331953d761097d5ad91ffff5ce.tar.gz
taler-android-1dbc22f1faba07331953d761097d5ad91ffff5ce.tar.bz2
taler-android-1dbc22f1faba07331953d761097d5ad91ffff5ce.zip
Fix Wallet QR code scanning and nightly version number display
Diffstat (limited to 'wallet/src/main')
-rw-r--r--wallet/src/main/java/net/taler/wallet/BalanceFragment.kt4
-rw-r--r--wallet/src/main/java/net/taler/wallet/history/HistoryAdapter.kt (renamed from wallet/src/main/java/net/taler/wallet/history/WalletHistoryAdapter.kt)5
-rw-r--r--wallet/src/main/java/net/taler/wallet/history/HistoryFragment.kt (renamed from wallet/src/main/java/net/taler/wallet/history/WalletHistoryFragment.kt)4
-rw-r--r--wallet/src/main/res/layout/nav_header_main.xml95
-rw-r--r--wallet/src/main/res/navigation/nav_graph.xml2
5 files changed, 57 insertions, 53 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/BalanceFragment.kt b/wallet/src/main/java/net/taler/wallet/BalanceFragment.kt
index e4ec681..93ed235 100644
--- a/wallet/src/main/java/net/taler/wallet/BalanceFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/BalanceFragment.kt
@@ -37,7 +37,7 @@ import androidx.recyclerview.widget.LinearLayoutManager.VERTICAL
import androidx.recyclerview.widget.RecyclerView.Adapter
import androidx.recyclerview.widget.RecyclerView.ViewHolder
import com.google.zxing.integration.android.IntentIntegrator
-import com.google.zxing.integration.android.IntentIntegrator.QR_CODE_TYPES
+import com.google.zxing.integration.android.IntentIntegrator.QR_CODE
import kotlinx.android.synthetic.main.fragment_show_balance.*
import net.taler.wallet.BalanceAdapter.BalanceViewHolder
@@ -92,7 +92,7 @@ class BalanceFragment : Fragment() {
setPrompt("")
setBeepEnabled(true)
setOrientationLocked(false)
- }.initiateScan(QR_CODE_TYPES)
+ }.initiateScan(listOf(QR_CODE))
}
}
diff --git a/wallet/src/main/java/net/taler/wallet/history/WalletHistoryAdapter.kt b/wallet/src/main/java/net/taler/wallet/history/HistoryAdapter.kt
index 5424b62..b177fb4 100644
--- a/wallet/src/main/java/net/taler/wallet/history/WalletHistoryAdapter.kt
+++ b/wallet/src/main/java/net/taler/wallet/history/HistoryAdapter.kt
@@ -41,12 +41,13 @@ import androidx.recyclerview.widget.RecyclerView.ViewHolder
import net.taler.common.Amount
import net.taler.wallet.BuildConfig
import net.taler.wallet.R
+import net.taler.wallet.history.HistoryAdapter.HistoryEventViewHolder
-internal class WalletHistoryAdapter(
+internal class HistoryAdapter(
private val listener: OnEventClickListener,
private var history: History = History()
-) : Adapter<WalletHistoryAdapter.HistoryEventViewHolder>() {
+) : Adapter<HistoryEventViewHolder>() {
init {
setHasStableIds(false)
diff --git a/wallet/src/main/java/net/taler/wallet/history/WalletHistoryFragment.kt b/wallet/src/main/java/net/taler/wallet/history/HistoryFragment.kt
index 45ecf37..2586ef8 100644
--- a/wallet/src/main/java/net/taler/wallet/history/WalletHistoryFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/history/HistoryFragment.kt
@@ -39,13 +39,13 @@ interface OnEventClickListener {
fun onEventClicked(event: HistoryEvent)
}
-class WalletHistoryFragment : Fragment(), OnEventClickListener {
+class HistoryFragment : Fragment(), OnEventClickListener {
private val model: WalletViewModel by activityViewModels()
private val historyManager by lazy { model.historyManager }
private lateinit var showAllItem: MenuItem
private var reloadHistoryItem: MenuItem? = null
- private val historyAdapter = WalletHistoryAdapter(this)
+ private val historyAdapter = HistoryAdapter(this)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
diff --git a/wallet/src/main/res/layout/nav_header_main.xml b/wallet/src/main/res/layout/nav_header_main.xml
index 5574c1f..6ae6419 100644
--- a/wallet/src/main/res/layout/nav_header_main.xml
+++ b/wallet/src/main/res/layout/nav_header_main.xml
@@ -15,59 +15,62 @@
-->
<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="wrap_content"
- android:background="@drawable/side_nav_bar"
- android:theme="@style/ThemeOverlay.AppCompat.Dark">
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@drawable/side_nav_bar"
+ android:theme="@style/ThemeOverlay.AppCompat.Dark">
<ImageView
- android:id="@+id/talerLogoView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_margin="16dp"
- android:contentDescription="@string/nav_header_desc"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent"
- app:srcCompat="@mipmap/ic_launcher_round" />
+ android:id="@+id/talerLogoView"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="16dp"
+ android:contentDescription="@string/nav_header_desc"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ app:srcCompat="@mipmap/ic_launcher_round" />
<TextView
- android:id="@+id/gnuView"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginStart="16dp"
- android:layout_marginTop="8dp"
- android:layout_marginEnd="16dp"
- android:text="@string/nav_header_title"
- android:textAppearance="@style/TextAppearance.AppCompat.Body1"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/talerLogoView" />
+ android:id="@+id/gnuView"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="8dp"
+ android:layout_marginEnd="16dp"
+ android:text="@string/nav_header_title"
+ android:textAppearance="@style/TextAppearance.AppCompat.Body1"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/talerLogoView" />
<TextView
- android:id="@+id/walletView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="16dp"
- android:layout_marginTop="4dp"
- android:layout_marginBottom="16dp"
- android:text="@string/nav_header_subtitle"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/gnuView" />
+ android:id="@+id/walletView"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="4dp"
+ android:layout_marginBottom="16dp"
+ android:text="@string/nav_header_subtitle"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/gnuView" />
<TextView
- android:id="@+id/versionView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="8dp"
- android:layout_marginEnd="16dp"
- app:layout_constraintBottom_toBottomOf="@+id/walletView"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintHorizontal_bias="0.0"
- app:layout_constraintStart_toEndOf="@+id/walletView"
- app:layout_constraintTop_toTopOf="@+id/walletView"
- tools:text="0.6.9-pre15" />
+ android:id="@+id/versionView"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:layout_marginEnd="16dp"
+ android:ellipsize="end"
+ android:maxLines="1"
+ android:singleLine="true"
+ app:layout_constraintBottom_toBottomOf="@+id/walletView"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.0"
+ app:layout_constraintStart_toEndOf="@+id/walletView"
+ app:layout_constraintTop_toTopOf="@+id/walletView"
+ tools:text="0.6.9-pre15 (eae45ae4e3) (1231242342352245345345345345)" />
</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/wallet/src/main/res/navigation/nav_graph.xml b/wallet/src/main/res/navigation/nav_graph.xml
index 549ca01..e1367ae 100644
--- a/wallet/src/main/res/navigation/nav_graph.xml
+++ b/wallet/src/main/res/navigation/nav_graph.xml
@@ -59,7 +59,7 @@
tools:layout="@layout/fragment_settings" />
<fragment
android:id="@+id/walletHistory"
- android:name="net.taler.wallet.history.WalletHistoryFragment"
+ android:name="net.taler.wallet.history.HistoryFragment"
android:label="@string/history_title"
tools:layout="@layout/fragment_show_history" />
<fragment