From 0c5cd4c3f0e13aea5692e7e23180979fbd0089c2 Mon Sep 17 00:00:00 2001 From: pokkst Date: Thu, 10 Nov 2022 23:20:08 -0600 Subject: [PATCH] More styling changes and fixes --- .../fragment/dialog/ReceiveBottomSheetDialog.java | 5 +++-- .../fragment/transaction/TransactionFragment.java | 14 +++++++++++++- .../res/layout/add_node_bottom_sheet_dialog.xml | 2 +- .../res/layout/edit_node_bottom_sheet_dialog.xml | 2 +- .../layout/node_selection_bottom_sheet_dialog.xml | 2 +- .../res/layout/password_bottom_sheet_dialog.xml | 2 +- .../res/layout/receive_bottom_sheet_dialog.xml | 2 +- .../main/res/layout/send_bottom_sheet_dialog.xml | 2 +- .../res/layout/wallet_keys_bottom_sheet_dialog.xml | 2 +- app/src/main/res/values-night/colors.xml | 9 +++++---- app/src/main/res/values/colors.xml | 5 +++-- 11 files changed, 31 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/net/mynero/wallet/fragment/dialog/ReceiveBottomSheetDialog.java b/app/src/main/java/net/mynero/wallet/fragment/dialog/ReceiveBottomSheetDialog.java index 63ac848..ff3b897 100644 --- a/app/src/main/java/net/mynero/wallet/fragment/dialog/ReceiveBottomSheetDialog.java +++ b/app/src/main/java/net/mynero/wallet/fragment/dialog/ReceiveBottomSheetDialog.java @@ -32,6 +32,7 @@ import net.mynero.wallet.util.DayNightMode; import net.mynero.wallet.util.Helper; import net.mynero.wallet.util.NightmodeHelper; +import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; @@ -78,7 +79,7 @@ public class ReceiveBottomSheetDialog extends BottomSheetDialogFragment { public Bitmap generate(String text, int width, int height) { if ((width <= 0) || (height <= 0)) return null; Map hints = new HashMap<>(); - hints.put(EncodeHintType.CHARACTER_SET, "utf-8"); + hints.put(EncodeHintType.CHARACTER_SET, StandardCharsets.UTF_8); hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M); try { BitMatrix bitMatrix = new QRCodeWriter().encode(text, BarcodeFormat.QR_CODE, width, height, hints); @@ -89,7 +90,7 @@ public class ReceiveBottomSheetDialog extends BottomSheetDialogFragment { if (bitMatrix.get(j, i)) { pixels[i * width + j] = night ? 0xffffffff : 0x00000000; } else { - pixels[i * height + j] = getResources().getColor(R.color.oled_txBackgroundColor); + pixels[i * height + j] = getResources().getColor(R.color.oled_dialogBackgroundColor); } } } diff --git a/app/src/main/java/net/mynero/wallet/fragment/transaction/TransactionFragment.java b/app/src/main/java/net/mynero/wallet/fragment/transaction/TransactionFragment.java index fd72299..b906a6e 100644 --- a/app/src/main/java/net/mynero/wallet/fragment/transaction/TransactionFragment.java +++ b/app/src/main/java/net/mynero/wallet/fragment/transaction/TransactionFragment.java @@ -2,6 +2,7 @@ package net.mynero.wallet.fragment.transaction; import static net.mynero.wallet.util.DateHelper.DATETIME_FORMATTER; +import android.content.Context; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; @@ -11,6 +12,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProvider; @@ -87,7 +89,6 @@ public class TransactionFragment extends Fragment { txHashTextView.setText(transactionInfo.hash); txConfTextView.setText("" + transactionInfo.confirmations); txDateTextView.setText(getDateTime(transactionInfo.timestamp)); - txAmountTextView.setText(getResources().getString(R.string.tx_amount_no_prefix, Helper.getDisplayAmount(transactionInfo.amount))); if(transactionInfo.confirmations > 0) { blockHeightTextView.setText("" + transactionInfo.blockheight); blockHeightTextView.setVisibility(View.VISIBLE); @@ -96,6 +97,17 @@ public class TransactionFragment extends Fragment { blockHeightTextView.setVisibility(View.GONE); blockHeightLabelTextView.setVisibility(View.GONE); } + + Context ctx = getContext(); + if(ctx != null) { + if (transactionInfo.direction == TransactionInfo.Direction.Direction_In) { + txAmountTextView.setTextColor(ContextCompat.getColor(ctx, R.color.oled_positiveColor)); + txAmountTextView.setText(getString(R.string.tx_list_amount_positive, Helper.getDisplayAmount(transactionInfo.amount))); + } else { + txAmountTextView.setTextColor(ContextCompat.getColor(ctx, R.color.oled_negativeColor)); + txAmountTextView.setText(getString(R.string.tx_list_amount_negative, Helper.getDisplayAmount(transactionInfo.amount))); + } + } }); mViewModel.destination.observe(getViewLifecycleOwner(), s -> { diff --git a/app/src/main/res/layout/add_node_bottom_sheet_dialog.xml b/app/src/main/res/layout/add_node_bottom_sheet_dialog.xml index a2e6b02..88a8349 100644 --- a/app/src/main/res/layout/add_node_bottom_sheet_dialog.xml +++ b/app/src/main/res/layout/add_node_bottom_sheet_dialog.xml @@ -6,7 +6,7 @@ android:layout_height="match_parent" android:fillViewport="true" android:fitsSystemWindows="true" - android:background="@color/oled_txBackgroundColor" + android:background="@color/oled_dialogBackgroundColor" android:padding="24dp"> diff --git a/app/src/main/res/layout/edit_node_bottom_sheet_dialog.xml b/app/src/main/res/layout/edit_node_bottom_sheet_dialog.xml index 86664ea..388a00d 100644 --- a/app/src/main/res/layout/edit_node_bottom_sheet_dialog.xml +++ b/app/src/main/res/layout/edit_node_bottom_sheet_dialog.xml @@ -6,7 +6,7 @@ android:layout_height="match_parent" android:fillViewport="true" android:fitsSystemWindows="true" - android:background="@color/oled_txBackgroundColor" + android:background="@color/oled_dialogBackgroundColor" android:padding="24dp"> diff --git a/app/src/main/res/layout/node_selection_bottom_sheet_dialog.xml b/app/src/main/res/layout/node_selection_bottom_sheet_dialog.xml index f0c31ac..2726464 100644 --- a/app/src/main/res/layout/node_selection_bottom_sheet_dialog.xml +++ b/app/src/main/res/layout/node_selection_bottom_sheet_dialog.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true" - android:background="@color/oled_txBackgroundColor" + android:background="@color/oled_dialogBackgroundColor" android:padding="24dp"> + android:background="@color/oled_dialogBackgroundColor"> diff --git a/app/src/main/res/layout/send_bottom_sheet_dialog.xml b/app/src/main/res/layout/send_bottom_sheet_dialog.xml index 06477ce..9ce5aec 100644 --- a/app/src/main/res/layout/send_bottom_sheet_dialog.xml +++ b/app/src/main/res/layout/send_bottom_sheet_dialog.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/oled_txBackgroundColor" + android:background="@color/oled_dialogBackgroundColor" android:fitsSystemWindows="true"> diff --git a/app/src/main/res/layout/wallet_keys_bottom_sheet_dialog.xml b/app/src/main/res/layout/wallet_keys_bottom_sheet_dialog.xml index 4300a09..bc976e0 100644 --- a/app/src/main/res/layout/wallet_keys_bottom_sheet_dialog.xml +++ b/app/src/main/res/layout/wallet_keys_bottom_sheet_dialog.xml @@ -6,7 +6,7 @@ android:layout_height="match_parent" android:fillViewport="true" android:fitsSystemWindows="true" - android:background="@color/oled_txBackgroundColor" + android:background="@color/oled_dialogBackgroundColor" android:padding="24dp"> diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index 9ec2d42..b4bcae1 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -9,10 +9,10 @@ @color/oled_gradientTopColor @color/oled_gradientBottomColor #F4F4F4 - @color/oled_negativeColor + #cb5a2e #FF104E - #3FF3A5 - #cb5a2e + #19ED60 + #CB2E2E #838383 #7E37F1 @color/oled_colorBackground @@ -30,7 +30,8 @@ #ffffff #202020 #956E43 - #0E0E0E + #060606 + #0E0E0E diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index c8366f6..3e50678 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -11,7 +11,7 @@ @color/oled_colorOnBackground #FFDB72 @color/oled_favouriteColor - #27C79C + #19ED60 #f38854 #171717 #3DC2FF @@ -31,7 +31,8 @@ #CCCCCC #454545 #B5895A - #F1F1F1 + #FBFBFB + #E8E8E8