@ -49,7 +49,7 @@ class SyncHostDialogFragment : AlertDialogFragment<PreferenceDialogAutocompletet
topMargin = binding . root . resources . getDimensionPixelOffset ( R . dimen . screen _padding )
topMargin = binding . root . resources . getDimensionPixelOffset ( R . dimen . screen _padding )
bottomMargin = topMargin
bottomMargin = topMargin
}
}
binding . message . setText ( R . string . sync _ url _description )
binding . message . setText ( R . string . sync _ host _description )
val entries = binding . root . resources . getStringArray ( R . array . sync _url _list )
val entries = binding . root . resources . getStringArray ( R . array . sync _url _list )
val editText = binding . edit
val editText = binding . edit
editText . setText ( arguments ?. getString ( KEY _SYNC _URL ) . ifNullOrEmpty { syncSettings . syncURL } )
editText . setText ( arguments ?. getString ( KEY _SYNC _URL ) . ifNullOrEmpty { syncSettings . syncURL } )
@ -66,7 +66,7 @@ class SyncHostDialogFragment : AlertDialogFragment<PreferenceDialogAutocompletet
DialogInterface . BUTTON _POSITIVE -> {
DialogInterface . BUTTON _POSITIVE -> {
val result = requireViewBinding ( ) . edit . text ?. toString ( ) . orEmpty ( )
val result = requireViewBinding ( ) . edit . text ?. toString ( ) . orEmpty ( )
var scheme = " "
var scheme = " "
if ( ! result . startsWith ( " https:// " ) && ! result . startsWith ( " http:// " ) ) {
if ( ! result . startsWith ( " https:// " ) && ! result . startsWith ( " http:// " ) ) {
scheme = " http:// "
scheme = " http:// "
}
}
syncSettings . syncURL = " $scheme $result "
syncSettings . syncURL = " $scheme $result "