Verified Commit cea22a93 authored by Sarath's avatar Sarath
Browse files

Improved Whirlpool Loading screen

parent 4a00874d
......@@ -18,6 +18,7 @@ import android.view.animation.RotateAnimation;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.google.android.material.progressindicator.ProgressIndicator;
import com.samourai.wallet.R;
import com.samourai.wallet.whirlpool.service.WhirlpoolNotificationService;
import com.samourai.whirlpool.client.wallet.AndroidWhirlpoolWalletService;
......@@ -32,7 +33,7 @@ public class WhirlPoolLoaderDialog extends BottomSheetDialogFragment {
private static final String TAG = "WhirlPoolLoaderDialog";
private TextView statusText;
private ProgressBar statusProgress;
private ProgressIndicator statusProgress;
private CompositeDisposable compositeDisposable = new CompositeDisposable();
private onInitComplete onInitComplete;
......@@ -78,7 +79,7 @@ public class WhirlPoolLoaderDialog extends BottomSheetDialogFragment {
case LOADING: {
new Handler().postDelayed(() -> {
statusText.setText("initializing whirlpool");
statusProgress.setProgress(30);
statusProgress.setProgressCompat(35,true);
}, 300);
break;
......@@ -87,18 +88,18 @@ public class WhirlPoolLoaderDialog extends BottomSheetDialogFragment {
case STARTING: {
new Handler().postDelayed(() -> {
statusText.setText("Connecting to service");
statusProgress.setProgress(60);
statusProgress.setProgressCompat(65,true);
}, 600);
break;
}
case CONNECTED: {
statusText.setText("Connected");
statusProgress.setProgress(100);
statusProgress.setProgressCompat(100,true);
new Handler().postDelayed(() -> {
dismiss();
if (onInitComplete != null)
onInitComplete.init();
}, 500);
}, 1200);
break;
}
......
......@@ -22,11 +22,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ProgressBar
<com.google.android.material.progressindicator.ProgressIndicator
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Indeterminate"
android:id="@+id/whirlpool_loader_progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="200dp"
android:layout_width="220dp"
android:layout_height="wrap_content"
app:indicatorCornerRadius="4dp"
app:indicatorSize="4dp"
app:trackColor="#373737"
app:growMode="bidirectional"
app:indicatorColor="?attr/colorAccent"
android:indeterminate="false"
android:layout_marginTop="24dp"
app:layout_constraintEnd_toEndOf="@+id/imageView8"
app:layout_constraintStart_toStartOf="@+id/imageView8"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment