From 6f7ac3da40e06bedf29250d1dd8c1d5ed3764ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20S=C3=A1nchez?= Date: Tue, 10 Dec 2024 19:08:31 -0300 Subject: [PATCH] today's profits placeholder --- .../dcav2gui/ui/home/HomeFragment.java | 14 +++++- .../today_this_month_card_background.xml | 7 +++ app/src/main/res/layout/fragment_home.xml | 47 +++++++++++++++++++ app/src/main/res/values/strings.xml | 5 ++ 4 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/drawable/today_this_month_card_background.xml diff --git a/app/src/main/java/com/example/dcav2gui/ui/home/HomeFragment.java b/app/src/main/java/com/example/dcav2gui/ui/home/HomeFragment.java index 7b9ea90..d63074a 100644 --- a/app/src/main/java/com/example/dcav2gui/ui/home/HomeFragment.java +++ b/app/src/main/java/com/example/dcav2gui/ui/home/HomeFragment.java @@ -23,6 +23,7 @@ public class HomeFragment extends Fragment { View root = binding.getRoot(); // Bind text views + // Tickers TextView pricePair1 = root.findViewById(R.id.pricesCardPrice1); TextView pricePair124hPercentage = root.findViewById(R.id.pricesCard24hText1); TextView pricePair17dPercentage = root.findViewById(R.id.pricesCard7dText1); @@ -38,7 +39,13 @@ public class HomeFragment extends Fragment { TextView pricePair37dPercentage = root.findViewById(R.id.pricesCard7dText3); TextView pricePair330dPercentage = root.findViewById(R.id.pricesCard30dText3); - // Set text values + // Profits today and this month + TextView profitsToday = root.findViewById(R.id.profitsTodayValue); + TextView profitsThisMonth = root.findViewById(R.id.profitsThisMonthValue); + + + // Set initial display values + // Tickers pricePair1.setText(R.string.default_price_ticker_1); pricePair124hPercentage.setText(R.string.percentage_example); pricePair17dPercentage.setText(R.string.percentage_example); @@ -52,6 +59,11 @@ public class HomeFragment extends Fragment { pricePair37dPercentage.setText(R.string.percentage_example); pricePair330dPercentage.setText(R.string.percentage_example); + // Profits today and this month + profitsToday.setText(R.string.profits_today_example); + profitsThisMonth.setText(R.string.profits_this_month_example); + + return root; } diff --git a/app/src/main/res/drawable/today_this_month_card_background.xml b/app/src/main/res/drawable/today_this_month_card_background.xml new file mode 100644 index 0000000..aebb7a7 --- /dev/null +++ b/app/src/main/res/drawable/today_this_month_card_background.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 732e2d6..97e3d31 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -4,9 +4,11 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" + xmlns:app="http://schemas.android.com/apk/res-auto" tools:context=".ui.home.HomeFragment"> + + + + + + + + + \ 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 e4a0db4..31865bd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -47,4 +47,9 @@ 7d 30d +20.30% + + Today: + $420.69 + This month: + $8392.39 \ No newline at end of file