diff --git a/app/lint-baseline.xml b/app/lint-baseline.xml index 8bdb7aaec..6083e9d39 100644 --- a/app/lint-baseline.xml +++ b/app/lint-baseline.xml @@ -1,5 +1,5 @@ - + @@ -2038,7 +2038,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~"> @@ -2940,7 +2940,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~"> @@ -2951,7 +2951,7 @@ errorLine2=" ~~~~~~~"> @@ -2962,7 +2962,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~"> @@ -2973,7 +2973,7 @@ errorLine2=" ~~~~~~~"> @@ -2984,7 +2984,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~"> @@ -2995,7 +2995,7 @@ errorLine2=" ~~~~~~~"> @@ -3006,7 +3006,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~"> @@ -3015,20 +3015,86 @@ message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor" errorLine1=" onClick = {" errorLine2=" ~~~~~~~"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - @@ -3039,73 +3105,7 @@ errorLine2=" ~~~~~~~"> - - - - - - - - - - - - - - - - - - - - - - - - @@ -3116,7 +3116,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~"> @@ -3127,7 +3127,7 @@ errorLine2=" ~~~~~~~"> @@ -3138,7 +3138,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~"> @@ -3149,7 +3149,7 @@ errorLine2=" ~~~~~~~"> @@ -3160,7 +3160,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~"> @@ -3171,7 +3171,7 @@ errorLine2=" ~~~~~~~"> @@ -3182,7 +3182,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~"> @@ -3193,7 +3193,7 @@ errorLine2=" ~~~~~~~"> @@ -3204,7 +3204,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~"> @@ -3215,7 +3215,7 @@ errorLine2=" ~~~~~~~"> @@ -3226,7 +3226,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~"> @@ -3237,7 +3237,7 @@ errorLine2=" ~~~~~~~"> @@ -3248,7 +3248,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~"> @@ -3259,7 +3259,7 @@ errorLine2=" ~~~~~~~"> @@ -3270,7 +3270,7 @@ errorLine2=" ~~~~~~~"> @@ -3281,7 +3281,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3292,7 +3292,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3545,7 +3545,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -3556,7 +3556,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~"> @@ -3567,7 +3567,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~"> diff --git a/app/src/main/java/app/pachli/components/notifications/NotificationsFragment.kt b/app/src/main/java/app/pachli/components/notifications/NotificationsFragment.kt index b1331179c..87faa7d25 100644 --- a/app/src/main/java/app/pachli/components/notifications/NotificationsFragment.kt +++ b/app/src/main/java/app/pachli/components/notifications/NotificationsFragment.kt @@ -228,7 +228,7 @@ class NotificationsFragment : (activity as ActionButtonActivity).actionButton ?: binding.root, message, Snackbar.LENGTH_INDEFINITE, - ).setTextMaxLines(5) + ) error.action?.let { action -> snackbar.setAction(R.string.action_retry) { viewModel.accept(action) diff --git a/app/src/main/java/app/pachli/components/timeline/TimelineFragment.kt b/app/src/main/java/app/pachli/components/timeline/TimelineFragment.kt index 04014c72b..9f7b303dd 100644 --- a/app/src/main/java/app/pachli/components/timeline/TimelineFragment.kt +++ b/app/src/main/java/app/pachli/components/timeline/TimelineFragment.kt @@ -247,7 +247,7 @@ class TimelineFragment : (activity as? ActionButtonActivity)?.actionButton ?: binding.root, message, Snackbar.LENGTH_INDEFINITE, - ).setTextMaxLines(5) + ) error.action?.let { action -> snackbar!!.setAction(R.string.action_retry) { viewModel.accept(action) @@ -434,7 +434,6 @@ class TimelineFragment : message, Snackbar.LENGTH_INDEFINITE, ) - .setTextMaxLines(5) .setAction(R.string.action_retry) { adapter.retry() } snackbar!!.show() } else { diff --git a/app/src/main/java/app/pachli/fragment/SFragment.kt b/app/src/main/java/app/pachli/fragment/SFragment.kt index 4a6a3e572..e921d742e 100644 --- a/app/src/main/java/app/pachli/fragment/SFragment.kt +++ b/app/src/main/java/app/pachli/fragment/SFragment.kt @@ -127,7 +127,7 @@ abstract class SFragment : Fragment(), StatusActionListener ) Timber.e(msg) Snackbar.make(requireView(), msg, Snackbar.LENGTH_INDEFINITE) - .setTextMaxLines(5) + .setAction(R.string.action_retry) { serverRepository.retry() } .show() serverCanTranslate = false } diff --git a/app/src/main/java/app/pachli/fragment/ViewVideoFragment.kt b/app/src/main/java/app/pachli/fragment/ViewVideoFragment.kt index f37bd10c7..df46cb260 100644 --- a/app/src/main/java/app/pachli/fragment/ViewVideoFragment.kt +++ b/app/src/main/java/app/pachli/fragment/ViewVideoFragment.kt @@ -244,7 +244,6 @@ class ViewVideoFragment : ViewMediaFragment() { error.cause?.message ?: error.message, ) Snackbar.make(binding.root, message, Snackbar.LENGTH_INDEFINITE) - .setTextMaxLines(10) .setAction(R.string.action_retry) { player?.prepare() } .show() } diff --git a/app/src/main/java/app/pachli/network/ServerRepository.kt b/app/src/main/java/app/pachli/network/ServerRepository.kt index 523fcb257..651b0bbf1 100644 --- a/app/src/main/java/app/pachli/network/ServerRepository.kt +++ b/app/src/main/java/app/pachli/network/ServerRepository.kt @@ -74,6 +74,10 @@ class ServerRepository @Inject constructor( } } + fun retry() = externalScope.launch { + _flow.emit(getServer()) + } + /** * @return the server info or a [Server.Error] if the server info can not * be determined. diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 5b7b48717..47cb93e78 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -82,6 +82,8 @@ ?attr/isLightTheme @style/Pachli.Widget.GraphView + + @style/snackbar_text + + +