Loading screen
This commit is contained in:
parent
f0d7759958
commit
f05785d6d3
|
|
@ -8,6 +8,8 @@ import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.ScrollView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
|
@ -44,6 +46,10 @@ public class HomeFragment extends Fragment {
|
||||||
public List<InstanceInterface.WorkerStatsData> kucoinWorkersStatsData;
|
public List<InstanceInterface.WorkerStatsData> kucoinWorkersStatsData;
|
||||||
public List<InstanceInterface.WorkerStatsData> okexWorkerStatsData;
|
public List<InstanceInterface.WorkerStatsData> okexWorkerStatsData;
|
||||||
|
|
||||||
|
private ProgressBar progressBar;
|
||||||
|
private TextView progressBarText;
|
||||||
|
private ScrollView mainHomeScrollView;
|
||||||
|
|
||||||
//Tickers
|
//Tickers
|
||||||
private TextView pricePair1;
|
private TextView pricePair1;
|
||||||
private TextView pricePair124hPercentage ;
|
private TextView pricePair124hPercentage ;
|
||||||
|
|
@ -109,6 +115,7 @@ public class HomeFragment extends Fragment {
|
||||||
//binding = FragmentHomeBinding.inflate(inflater, container, false);
|
//binding = FragmentHomeBinding.inflate(inflater, container, false);
|
||||||
//View root = binding.getRoot();
|
//View root = binding.getRoot();
|
||||||
|
|
||||||
|
|
||||||
// For the cache
|
// For the cache
|
||||||
MainActivity mainActivity = (MainActivity) requireActivity();
|
MainActivity mainActivity = (MainActivity) requireActivity();
|
||||||
HomeFragment.HomeCache homeViewCache = mainActivity.getHomeViewCache();
|
HomeFragment.HomeCache homeViewCache = mainActivity.getHomeViewCache();
|
||||||
|
|
@ -116,6 +123,10 @@ public class HomeFragment extends Fragment {
|
||||||
homeViewModel = new ViewModelProvider(this).get(HomeViewModel.class);
|
homeViewModel = new ViewModelProvider(this).get(HomeViewModel.class);
|
||||||
View root = inflater.inflate(R.layout.fragment_home, container, false);
|
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
|
// Bind text views
|
||||||
// Tickers
|
// Tickers
|
||||||
pricePair1 = root.findViewById(R.id.pricesCardPrice1);
|
pricePair1 = root.findViewById(R.id.pricesCardPrice1);
|
||||||
|
|
@ -196,6 +207,7 @@ public class HomeFragment extends Fragment {
|
||||||
homeViewCache.getGateioLogs(),
|
homeViewCache.getGateioLogs(),
|
||||||
homeViewCache.getKucoinLogs(),
|
homeViewCache.getKucoinLogs(),
|
||||||
homeViewCache.getOkexLogs());
|
homeViewCache.getOkexLogs());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//Prices
|
//Prices
|
||||||
pricePair1.setText(R.string.default_price_ticker_1);
|
pricePair1.setText(R.string.default_price_ticker_1);
|
||||||
|
|
@ -712,6 +724,10 @@ public class HomeFragment extends Fragment {
|
||||||
log4Content.setText(okexLogs);
|
log4Content.setText(okexLogs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
progressBar.setVisibility(View.GONE);
|
||||||
|
progressBarText.setVisibility(View.GONE);
|
||||||
|
mainHomeScrollView.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,30 @@
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
tools:context=".ui.home.HomeFragment"
|
tools:context=".ui.home.HomeFragment"
|
||||||
android:scrollbars="vertical">
|
android:scrollbars="vertical">
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progressBar"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="visible"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/progressBarText"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/progressBar"
|
||||||
|
android:visibility="visible"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/loading_message"
|
||||||
|
android:textSize="20sp" />
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
|
android:id="@+id/mainHomeScrollView"
|
||||||
|
android:visibility="gone"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
|
||||||
|
|
@ -87,4 +87,5 @@
|
||||||
<string name="exchange_2_log_title" translatable="false">Gate.io log</string>
|
<string name="exchange_2_log_title" translatable="false">Gate.io log</string>
|
||||||
<string name="exchange_3_log_title" translatable="false">Kucoin log</string>
|
<string name="exchange_3_log_title" translatable="false">Kucoin log</string>
|
||||||
<string name="exchange_4_log_title" translatable="false">OKX log</string>
|
<string name="exchange_4_log_title" translatable="false">OKX log</string>
|
||||||
|
<string name="loading_message">Querying data sources...</string>
|
||||||
</resources>
|
</resources>
|
||||||
Loading…
Reference in New Issue