2828import com .journeyapps .barcodescanner .ScanOptions ;
2929import androidx .annotation .NonNull ;
3030import androidx .annotation .Nullable ;
31- import com . google . android . material .dialog .MaterialAlertDialogBuilder ;
31+ import org . appdevforall . k2go . ui .dialog .BrandDialog ;
3232import com .google .android .material .progressindicator .LinearProgressIndicator ;
3333import androidx .core .content .ContextCompat ;
3434import androidx .core .content .FileProvider ;
@@ -420,11 +420,11 @@ private void requestMode(Mode target) {
420420 boolean sharing = (side == Side .SEND && page == Page .COPY && daemonStarted );
421421 if (target == mode || !sharing ) { setMode (target ); return ; }
422422 String label = (target == Mode .HOTSPOT ) ? "Hotspot" : "Wi-Fi" ;
423- new MaterialAlertDialogBuilder (requireContext ())
423+ new BrandDialog (requireContext ())
424424 .setTitle (getString (R .string .k2go_clone_switch_title , label ))
425- .setMessage (getString ( R .string .k2go_clone_switch_msg ) )
426- .setNegativeButton ( getString ( R .string .k2go_cancel ) , null )
427- .setPositiveButton ( getString ( R .string .k2go_clone_switch_confirm ) , (d , w ) -> setMode (target ))
425+ .setMessage (R .string .k2go_clone_switch_msg )
426+ .setNegative ( R .string .k2go_cancel , null )
427+ .setPositive ( R .string .k2go_clone_switch_confirm , () -> setMode (target ))
428428 .show ();
429429 }
430430
@@ -965,11 +965,11 @@ private String bitsLabel(int bits) {
965965 // nothing to copy — warn before probing rather than pulling an empty library.
966966 private void probeOrWarnEmpty (SyncHandshakeHelper .SyncCredentials creds ) {
967967 if (!creds .hasRootfs ) {
968- new MaterialAlertDialogBuilder (requireContext ())
969- .setTitle (getString ( R .string .k2go_clone_nolib_title ) )
970- .setMessage (getString ( R .string .k2go_clone_nolib_msg ) )
971- .setNegativeButton ( getString ( R .string .k2go_cancel ) , null )
972- .setPositiveButton ( getString ( R .string .k2go_clone_try_anyway ) , (d , w ) -> syncVm .startProbe (requireContext ().getApplicationContext (), shareConfig , creds ))
968+ new BrandDialog (requireContext ())
969+ .setTitle (R .string .k2go_clone_nolib_title )
970+ .setMessage (R .string .k2go_clone_nolib_msg )
971+ .setNegative ( R .string .k2go_cancel , null )
972+ .setPositive ( R .string .k2go_clone_try_anyway , () -> syncVm .startProbe (requireContext ().getApplicationContext (), shareConfig , creds ))
973973 .show ();
974974 return ;
975975 }
@@ -1376,10 +1376,10 @@ private void showReceiveTerminal(boolean ok, String message) {
13761376 exitStartAt = android .os .SystemClock .elapsedRealtime ();
13771377 SyncProgressRepository .get ().postIdle (); // the copy is done; drop the busy/progress state
13781378 startExitPoll ();
1379- new MaterialAlertDialogBuilder (requireContext ())
1380- .setTitle (getString ( R .string .k2go_clone_copy_complete ) )
1379+ new BrandDialog (requireContext ())
1380+ .setTitle (R .string .k2go_clone_copy_complete )
13811381 .setCancelable (false )
1382- .setPositiveButton (android .R .string .ok , (d , w ) -> {
1382+ .setPositive (android .R .string .ok , () -> {
13831383 exitAck = true ;
13841384 rStage = RStage .START ; // land on step 2, where the status zone lives
13851385 maybeStartCountdown (); // if services already answered, begin the 3-2-1 now
@@ -1399,11 +1399,11 @@ private void showReceiveTerminal(boolean ok, String message) {
13991399 // Retry re-scans (rsync resumes from the half-written tree — the maravilla Luis relies on);
14001400 // Recover goes to the hub (restore / install over internet / clone again). The Back guard has
14011401 // already turned off (FAILED is not active), so leaving the app is free too.
1402- new MaterialAlertDialogBuilder (requireContext ())
1403- .setTitle (getString ( R .string .k2go_clone_copy_stopped ) )
1402+ new BrandDialog (requireContext ())
1403+ .setTitle (R .string .k2go_clone_copy_stopped )
14041404 .setMessage (body )
1405- .setPositiveButton ( getString ( R .string .k2go_home_retry ) , (d , w ) -> { SyncProgressRepository .get ().postIdle (); renderReceive (); })
1406- .setNegativeButton ( getString ( R .string .k2go_home_recover ) , (d , w ) -> {
1405+ .setPositive ( R .string .k2go_home_retry , () -> { SyncProgressRepository .get ().postIdle (); renderReceive (); })
1406+ .setNegative ( R .string .k2go_home_recover , () -> {
14071407 SyncProgressRepository .get ().postIdle ();
14081408 SetupLibraryActivity .recover (requireContext ());
14091409 })
@@ -1456,11 +1456,11 @@ public void onDestroyView() {
14561456 }
14571457
14581458 private void confirmStop () {
1459- new MaterialAlertDialogBuilder (requireContext ())
1460- .setTitle (getString ( R .string .k2go_clone_stopshare_title ) )
1461- .setMessage (getString ( R .string .k2go_clone_stopshare_msg ) )
1462- .setNegativeButton ( getString ( R .string .k2go_cancel ) , null )
1463- .setPositiveButton ( getString ( R .string .k2go_clone_stop_confirm ) , (d , w ) -> {
1459+ new BrandDialog (requireContext ())
1460+ .setTitle (R .string .k2go_clone_stopshare_title )
1461+ .setMessage (R .string .k2go_clone_stopshare_msg )
1462+ .setNegative ( R .string .k2go_cancel , null )
1463+ .setDestructive ( R .string .k2go_clone_stop_confirm , () -> {
14641464 if (transport != null ) transport .stop ();
14651465 daemonStarted = false ;
14661466 userStopped = true ; // do not auto-restart on the next render
0 commit comments