This commit is contained in:
Nicolás Sánchez 2024-12-10 17:57:37 -03:00
parent 1185ee3dac
commit 03d7b2b306
3 changed files with 35 additions and 37 deletions

View File

@ -8,7 +8,6 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import com.example.dcav2gui.R;
import com.example.dcav2gui.databinding.FragmentHomeBinding;
@ -19,15 +18,10 @@ public class HomeFragment extends Fragment {
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
HomeViewModel homeViewModel =
new ViewModelProvider(this).get(HomeViewModel.class);
binding = FragmentHomeBinding.inflate(inflater, container, false);
View root = binding.getRoot();
//final TextView textView = binding.textHome;
//homeViewModel.getText().observe(getViewLifecycleOwner(), textView::setText);
// Bind text views
TextView pricePair1 = root.findViewById(R.id.pricesCardPrice1);
TextView pricePair124hPercentage = root.findViewById(R.id.pricesCard24hText1);
@ -46,17 +40,17 @@ public class HomeFragment extends Fragment {
// Set text values
pricePair1.setText(R.string.default_price_ticker_1);
pricePair124hPercentage.setText("+20.30%");
pricePair17dPercentage.setText("+20.30%");
pricePair130dPercentage.setText("+20.30%");
pricePair124hPercentage.setText(R.string.percentage_example);
pricePair17dPercentage.setText(R.string.percentage_example);
pricePair130dPercentage.setText(R.string.percentage_example);
pricePair2.setText(R.string.default_price_ticker_2);
pricePair224hPercentage.setText("+20.30%");
pricePair27dPercentage.setText("+20.30%");
pricePair230dPercentage.setText("+20.30%");
pricePair224hPercentage.setText(R.string.percentage_example);
pricePair27dPercentage.setText(R.string.percentage_example);
pricePair230dPercentage.setText(R.string.percentage_example);
pricePair3.setText(R.string.default_price_ticker_3);
pricePair324hPercentage.setText("+20.30%");
pricePair37dPercentage.setText("+20.30%");
pricePair330dPercentage.setText("+20.30%");
pricePair324hPercentage.setText(R.string.percentage_example);
pricePair37dPercentage.setText(R.string.percentage_example);
pricePair330dPercentage.setText(R.string.percentage_example);
return root;
}

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<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"
@ -31,7 +31,7 @@
android:id="@+id/pricesCardPrice1"
android:layout_width="96dp"
android:layout_height="24dp"
android:text="696969.69"
android:text="@string/default_price_ticker_1"
android:textAlignment="center"
android:textSize="18sp"
android:textStyle="bold" />
@ -48,7 +48,7 @@
android:layout_width="22dp"
android:layout_height="16dp"
android:textAlignment="textEnd"
android:text="24h"
android:text="@string/h_24_title"
android:textColor="@color/secondary_text_color"
android:textSize="12sp" />
<TextView
@ -56,7 +56,7 @@
android:layout_width="56dp"
android:layout_height="16dp"
android:textAlignment="center"
android:text="+20.30%"
android:text="@string/percentage_example"
android:textColor="@color/secondary_text_color"
android:textSize="14sp" />
<TextView
@ -64,7 +64,7 @@
android:layout_width="14dp"
android:layout_height="16dp"
android:textAlignment="textEnd"
android:text="7d"
android:text="@string/d_7_title"
android:textColor="@color/secondary_text_color"
android:textSize="12sp" />
<TextView
@ -72,7 +72,7 @@
android:layout_width="56dp"
android:layout_height="16dp"
android:textAlignment="center"
android:text="+20.30%"
android:text="@string/percentage_example"
android:textColor="@color/secondary_text_color"
android:textSize="14sp" />
<TextView
@ -80,7 +80,7 @@
android:layout_width="22dp"
android:layout_height="16dp"
android:textAlignment="textEnd"
android:text="30d"
android:text="@string/d_30_title"
android:textColor="@color/secondary_text_color"
android:textSize="12sp" />
<TextView
@ -88,7 +88,7 @@
android:layout_width="56dp"
android:layout_height="16dp"
android:textAlignment="center"
android:text="+20.30%"
android:text="@string/percentage_example"
android:textColor="@color/secondary_text_color"
android:textSize="14sp" />
</LinearLayout>
@ -111,7 +111,7 @@
android:id="@+id/pricesCardPrice2"
android:layout_width="96dp"
android:layout_height="24dp"
android:text="696969.69"
android:text="@string/default_price_ticker_2"
android:textAlignment="center"
android:textSize="18sp"
android:textStyle="bold" />
@ -128,7 +128,7 @@
android:layout_width="22dp"
android:layout_height="16dp"
android:textAlignment="textEnd"
android:text="24h"
android:text="@string/h_24_title"
android:textColor="@color/secondary_text_color"
android:textSize="12sp" />
<TextView
@ -136,7 +136,7 @@
android:layout_width="56dp"
android:layout_height="16dp"
android:textAlignment="center"
android:text="+20.30%"
android:text="@string/percentage_example"
android:textColor="@color/secondary_text_color"
android:textSize="14sp" />
<TextView
@ -144,7 +144,7 @@
android:layout_width="14dp"
android:layout_height="16dp"
android:textAlignment="textEnd"
android:text="7d"
android:text="@string/d_7_title"
android:textColor="@color/secondary_text_color"
android:textSize="12sp" />
<TextView
@ -152,7 +152,7 @@
android:layout_width="56dp"
android:layout_height="16dp"
android:textAlignment="center"
android:text="+20.30%"
android:text="@string/percentage_example"
android:textColor="@color/secondary_text_color"
android:textSize="14sp" />
<TextView
@ -160,7 +160,7 @@
android:layout_width="22dp"
android:layout_height="16dp"
android:textAlignment="textEnd"
android:text="30d"
android:text="@string/d_30_title"
android:textColor="@color/secondary_text_color"
android:textSize="12sp" />
<TextView
@ -168,7 +168,7 @@
android:layout_width="56dp"
android:layout_height="16dp"
android:textAlignment="center"
android:text="+20.30%"
android:text="@string/percentage_example"
android:textColor="@color/secondary_text_color"
android:textSize="14sp" />
</LinearLayout>
@ -191,7 +191,7 @@
android:id="@+id/pricesCardPrice3"
android:layout_width="96dp"
android:layout_height="24dp"
android:text="696969.69"
android:text="@string/default_price_ticker_3"
android:textAlignment="center"
android:textSize="18sp"
android:textStyle="bold" />
@ -208,7 +208,7 @@
android:layout_width="22dp"
android:layout_height="16dp"
android:textAlignment="textEnd"
android:text="24h"
android:text="@string/h_24_title"
android:textColor="@color/secondary_text_color"
android:textSize="12sp" />
<TextView
@ -216,7 +216,7 @@
android:layout_width="56dp"
android:layout_height="16dp"
android:textAlignment="center"
android:text="+20.30%"
android:text="@string/percentage_example"
android:textColor="@color/secondary_text_color"
android:textSize="14sp" />
<TextView
@ -224,7 +224,7 @@
android:layout_width="14dp"
android:layout_height="16dp"
android:textAlignment="textEnd"
android:text="7d"
android:text="@string/d_7_title"
android:textColor="@color/secondary_text_color"
android:textSize="12sp" />
<TextView
@ -232,7 +232,7 @@
android:layout_width="56dp"
android:layout_height="16dp"
android:textAlignment="center"
android:text="+20.30%"
android:text="@string/percentage_example"
android:textColor="@color/secondary_text_color"
android:textSize="14sp" />
<TextView
@ -240,7 +240,7 @@
android:layout_width="22dp"
android:layout_height="16dp"
android:textAlignment="textEnd"
android:text="30d"
android:text="@string/d_30_title"
android:textColor="@color/secondary_text_color"
android:textSize="12sp" />
<TextView
@ -248,7 +248,7 @@
android:layout_width="56dp"
android:layout_height="16dp"
android:textAlignment="center"
android:text="+20.30%"
android:text="@string/percentage_example"
android:textColor="@color/secondary_text_color"
android:textSize="14sp" />
</LinearLayout>

View File

@ -43,4 +43,8 @@
<string name="quote_price_ticker_1">USDT</string>
<string name="quote_price_ticker_2">USDT</string>
<string name="quote_price_ticker_3">ARS</string>
<string name="h_24_title">24h</string>
<string name="d_7_title">7d</string>
<string name="d_30_title">30d</string>
<string name="percentage_example">+20.30%</string>
</resources>