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.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<InstanceInterface.WorkerStatsData> kucoinWorkersStatsData;
|
||||
public List<InstanceInterface.WorkerStatsData> 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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,30 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
tools:context=".ui.home.HomeFragment"
|
||||
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
|
||||
android:id="@+id/mainHomeScrollView"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<LinearLayout
|
||||
|
|
|
|||
|
|
@ -87,4 +87,5 @@
|
|||
<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_4_log_title" translatable="false">OKX log</string>
|
||||
<string name="loading_message">Querying data sources...</string>
|
||||
</resources>
|
||||
Loading…
Reference in New Issue