aboutsummaryrefslogtreecommitdiff
path: root/merchant-terminal/src/main
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2020-09-16 10:21:33 -0300
committerTorsten Grote <t@grobox.de>2020-09-16 10:37:37 -0300
commitc0a8673e9f97fbeb565000fe85d2f1ce55f6e8c2 (patch)
treeafeef27bf7da0683560fb61f887c87e0be410dbc /merchant-terminal/src/main
parent85c2be5713eac244ffbe7a024ed2aa08b9816388 (diff)
downloadtaler-android-c0a8673e9f97fbeb565000fe85d2f1ce55f6e8c2.tar.gz
taler-android-c0a8673e9f97fbeb565000fe85d2f1ce55f6e8c2.tar.bz2
taler-android-c0a8673e9f97fbeb565000fe85d2f1ce55f6e8c2.zip
Make apps work on API 21+ (except cashier that needs 23+)
Diffstat (limited to 'merchant-terminal/src/main')
-rw-r--r--merchant-terminal/src/main/java/net/taler/merchantpos/history/HistoryItemAdapter.kt3
-rw-r--r--merchant-terminal/src/main/java/net/taler/merchantpos/order/Order.kt2
-rw-r--r--merchant-terminal/src/main/java/net/taler/merchantpos/refund/RefundFragment.kt2
3 files changed, 3 insertions, 4 deletions
diff --git a/merchant-terminal/src/main/java/net/taler/merchantpos/history/HistoryItemAdapter.kt b/merchant-terminal/src/main/java/net/taler/merchantpos/history/HistoryItemAdapter.kt
index 25e94fb..4643cb4 100644
--- a/merchant-terminal/src/main/java/net/taler/merchantpos/history/HistoryItemAdapter.kt
+++ b/merchant-terminal/src/main/java/net/taler/merchantpos/history/HistoryItemAdapter.kt
@@ -21,6 +21,7 @@ import android.view.View
import android.view.ViewGroup
import android.widget.ImageButton
import android.widget.TextView
+import androidx.core.content.ContextCompat.getColor
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.Adapter
import net.taler.common.toRelativeTime
@@ -73,7 +74,7 @@ internal class HistoryItemAdapter(private val listener: RefundClickListener) :
orderIdView.setTextColor(orderIdColor)
} else {
orderIdView.text = v.context.getString(R.string.history_unpaid)
- orderIdView.setTextColor(v.context.getColor(R.color.red))
+ orderIdView.setTextColor(getColor(v.context, R.color.red))
}
if (item.refundable) {
refundButton.visibility = View.VISIBLE
diff --git a/merchant-terminal/src/main/java/net/taler/merchantpos/order/Order.kt b/merchant-terminal/src/main/java/net/taler/merchantpos/order/Order.kt
index 4fc2907..0bea20c 100644
--- a/merchant-terminal/src/main/java/net/taler/merchantpos/order/Order.kt
+++ b/merchant-terminal/src/main/java/net/taler/merchantpos/order/Order.kt
@@ -84,7 +84,7 @@ data class Order(val id: Int, val currency: String, val availableCategories: Map
* Returns a map of i18n summaries for each locale present in *all* given [Category]s
* or null if there's no locale that fulfills this criteria.
*/
- val summaryI18n: Map<String, String>?
+ private val summaryI18n: Map<String, String>?
get() {
if (products.size == 1) return products[0].descriptionI18n
val categoryQuantities = getCategoryQuantities()
diff --git a/merchant-terminal/src/main/java/net/taler/merchantpos/refund/RefundFragment.kt b/merchant-terminal/src/main/java/net/taler/merchantpos/refund/RefundFragment.kt
index 5306b2f..bb98dbd 100644
--- a/merchant-terminal/src/main/java/net/taler/merchantpos/refund/RefundFragment.kt
+++ b/merchant-terminal/src/main/java/net/taler/merchantpos/refund/RefundFragment.kt
@@ -24,8 +24,6 @@ import androidx.annotation.StringRes
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.navigation.fragment.findNavController
-import com.google.android.material.snackbar.BaseTransientBottomBar.LENGTH_LONG
-import com.google.android.material.snackbar.Snackbar
import net.taler.common.fadeIn
import net.taler.common.fadeOut
import net.taler.common.navigate