run ktlint

This commit is contained in:
Maxence G 2021-05-29 15:42:15 +02:00
parent 075b80c01f
commit 3e08735374
No known key found for this signature in database
GPG Key ID: DC1FD9409E3FE284
1 changed files with 20 additions and 13 deletions

View File

@ -11,6 +11,9 @@ import androidx.lifecycle.Observer
import androidx.navigation.fragment.findNavController import androidx.navigation.fragment.findNavController
import com.google.android.material.switchmaterial.SwitchMaterial import com.google.android.material.switchmaterial.SwitchMaterial
import com.google.android.material.textfield.TextInputLayout import com.google.android.material.textfield.TextInputLayout
import java.io.IOException
import java.net.MalformedURLException
import java.net.URL
import org.koin.android.ext.android.inject import org.koin.android.ext.android.inject
import org.koin.androidx.viewmodel.ext.android.viewModel import org.koin.androidx.viewmodel.ext.android.viewModel
import org.moire.ultrasonic.BuildConfig import org.moire.ultrasonic.BuildConfig
@ -26,11 +29,7 @@ import org.moire.ultrasonic.util.Constants
import org.moire.ultrasonic.util.ErrorDialog import org.moire.ultrasonic.util.ErrorDialog
import org.moire.ultrasonic.util.ModalBackgroundTask import org.moire.ultrasonic.util.ModalBackgroundTask
import org.moire.ultrasonic.util.Util import org.moire.ultrasonic.util.Util
import retrofit2.Call
import timber.log.Timber import timber.log.Timber
import java.io.IOException
import java.net.MalformedURLException
import java.net.URL
/** /**
* Displays a form where server settings can be created / edited * Displays a form where server settings can be created / edited
@ -309,16 +308,16 @@ class EditServerFragment : Fragment(), OnBackPressedHandler {
fun getProgress(): String { fun getProgress(): String {
return String.format( return String.format(
""" """
|%s - ${activity.resources.getString(R.string.button_bar_chat)} |%s - ${activity.resources.getString(R.string.button_bar_chat)}
|%s - ${activity.resources.getString(R.string.button_bar_bookmarks)} |%s - ${activity.resources.getString(R.string.button_bar_bookmarks)}
|%s - ${activity.resources.getString(R.string.button_bar_shares)} |%s - ${activity.resources.getString(R.string.button_bar_shares)}
|%s - ${activity.resources.getString(R.string.button_bar_podcasts)} |%s - ${activity.resources.getString(R.string.button_bar_podcasts)}
""".trimMargin(), """.trimMargin(),
boolToMark(currentServerSetting!!.chatSupport), boolToMark(currentServerSetting!!.chatSupport),
boolToMark(currentServerSetting!!.bookmarkSupport), boolToMark(currentServerSetting!!.bookmarkSupport),
boolToMark(currentServerSetting!!.shareSupport), boolToMark(currentServerSetting!!.shareSupport),
boolToMark(currentServerSetting!!.podcastSupport) boolToMark(currentServerSetting!!.podcastSupport)
) )
} }
@ -362,28 +361,36 @@ class EditServerFragment : Fragment(), OnBackPressedHandler {
currentServerSetting!!.chatSupport = try { currentServerSetting!!.chatSupport = try {
subsonicApiClient.api.getChatMessages().execute() subsonicApiClient.api.getChatMessages().execute()
true true
} catch (e: IOException) { false } } catch (e: IOException) {
false
}
updateProgress(getProgress()) updateProgress(getProgress())
currentServerSetting!!.bookmarkSupport = try { currentServerSetting!!.bookmarkSupport = try {
subsonicApiClient.api.getBookmarks().execute() subsonicApiClient.api.getBookmarks().execute()
true true
} catch (e: IOException) { false } } catch (e: IOException) {
false
}
updateProgress(getProgress()) updateProgress(getProgress())
currentServerSetting!!.shareSupport = try { currentServerSetting!!.shareSupport = try {
subsonicApiClient.api.getShares().execute() subsonicApiClient.api.getShares().execute()
true true
} catch (e: IOException) { false } } catch (e: IOException) {
false
}
updateProgress(getProgress()) updateProgress(getProgress())
currentServerSetting!!.podcastSupport = try { currentServerSetting!!.podcastSupport = try {
subsonicApiClient.api.getPodcasts().execute() subsonicApiClient.api.getPodcasts().execute()
true true
} catch (e: IOException) { false } } catch (e: IOException) {
false
}
updateProgress(getProgress()) updateProgress(getProgress())