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 f7b38c9..e8b36f9 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 @@ -8,6 +8,8 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; +import android.widget.ProgressBar; +import android.widget.ScrollView; import android.widget.TextView; import android.widget.Toast; @@ -44,6 +46,10 @@ public class HomeFragment extends Fragment { public List kucoinWorkersStatsData; public List okexWorkerStatsData; + private ProgressBar progressBar; + private TextView progressBarText; + private ScrollView mainHomeScrollView; + //Tickers private TextView pricePair1; private TextView pricePair124hPercentage ; @@ -109,6 +115,7 @@ public class HomeFragment extends Fragment { //binding = FragmentHomeBinding.inflate(inflater, container, false); //View root = binding.getRoot(); + // For the cache MainActivity mainActivity = (MainActivity) requireActivity(); HomeFragment.HomeCache homeViewCache = mainActivity.getHomeViewCache(); @@ -116,6 +123,10 @@ public class HomeFragment extends Fragment { homeViewModel = new ViewModelProvider(this).get(HomeViewModel.class); View root = inflater.inflate(R.layout.fragment_home, container, false); + progressBar = root.findViewById(R.id.progressBar); + progressBarText = root.findViewById(R.id.progressBarText); + mainHomeScrollView = root.findViewById(R.id.mainHomeScrollView); + // Bind text views // Tickers pricePair1 = root.findViewById(R.id.pricesCardPrice1); @@ -196,6 +207,7 @@ public class HomeFragment extends Fragment { homeViewCache.getGateioLogs(), homeViewCache.getKucoinLogs(), homeViewCache.getOkexLogs()); + } else { //Prices pricePair1.setText(R.string.default_price_ticker_1); @@ -712,6 +724,10 @@ public class HomeFragment extends Fragment { log4Content.setText(okexLogs); } + progressBar.setVisibility(View.GONE); + progressBarText.setVisibility(View.GONE); + mainHomeScrollView.setVisibility(View.VISIBLE); + } diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 827f410..acdd0be 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -7,7 +7,30 @@ xmlns:app="http://schemas.android.com/apk/res-auto" tools:context=".ui.home.HomeFragment" android:scrollbars="vertical"> + + + + Gate.io log Kucoin log OKX log + Querying data sources... \ No newline at end of file