Officially rename error elephant to errorphant (#3922)

In honor of
https://strangeobject.space/@esther/109866090382540100
https://masto.ai/@mynotaurus/110826349670549779
This commit is contained in:
UlrichKu 2023-08-05 15:39:07 +02:00 committed by GitHub
parent 49fd2c8478
commit cb8a09d3f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 110 additions and 165 deletions

File diff suppressed because one or more lines are too long

View File

@ -174,13 +174,13 @@ class ListsActivity : BaseActivity(), Injectable, HasAndroidInjector {
INITIAL, LOADING -> binding.messageView.hide()
ERROR_NETWORK -> {
binding.messageView.show()
binding.messageView.setup(R.drawable.elephant_offline, R.string.error_network) {
binding.messageView.setup(R.drawable.errorphant_offline, R.string.error_network) {
viewModel.retryLoading()
}
}
ERROR_OTHER -> {
binding.messageView.show()
binding.messageView.setup(R.drawable.elephant_error, R.string.error_generic) {
binding.messageView.setup(R.drawable.errorphant_error, R.string.error_generic) {
viewModel.retryLoading()
}
}

View File

@ -129,7 +129,7 @@ class AnnouncementsActivity :
is Error -> {
binding.progressBar.hide()
binding.swipeRefreshLayout.isRefreshing = false
binding.errorMessageView.setup(R.drawable.elephant_error, R.string.error_generic) {
binding.errorMessageView.setup(R.drawable.errorphant_error, R.string.error_generic) {
refreshAnnouncements()
}
binding.errorMessageView.show()

View File

@ -60,13 +60,13 @@ class FiltersActivity : BaseActivity(), FiltersListener {
when (state.loadingState) {
FiltersViewModel.LoadingState.INITIAL, FiltersViewModel.LoadingState.LOADING -> binding.messageView.hide()
FiltersViewModel.LoadingState.ERROR_NETWORK -> {
binding.messageView.setup(R.drawable.elephant_offline, R.string.error_network) {
binding.messageView.setup(R.drawable.errorphant_offline, R.string.error_network) {
loadFilters()
}
binding.messageView.show()
}
FiltersViewModel.LoadingState.ERROR_OTHER -> {
binding.messageView.setup(R.drawable.elephant_error, R.string.error_generic) {
binding.messageView.setup(R.drawable.errorphant_error, R.string.error_generic) {
loadFilters()
}
binding.messageView.show()

View File

@ -418,13 +418,13 @@ class NotificationsFragment :
when ((loadState.refresh as LoadState.Error).error) {
is IOException -> {
binding.statusView.setup(
R.drawable.elephant_offline,
R.drawable.errorphant_offline,
R.string.error_network
) { adapter.retry() }
}
else -> {
binding.statusView.setup(
R.drawable.elephant_error,
R.drawable.errorphant_error,
R.string.error_generic
) { adapter.retry() }
}

View File

@ -194,7 +194,7 @@ class TrendingFragment :
binding.swipeRefreshLayout.isRefreshing = false
binding.messageView.setup(
R.drawable.elephant_offline,
R.drawable.errorphant_offline,
R.string.error_network
) { refreshContent() }
}
@ -206,7 +206,7 @@ class TrendingFragment :
binding.swipeRefreshLayout.isRefreshing = false
binding.messageView.setup(
R.drawable.elephant_error,
R.drawable.errorphant_error,
R.string.error_generic
) { refreshContent() }
}

View File

@ -30,9 +30,9 @@ fun Throwable.getServerErrorMessage(): String? {
/** @return A drawable resource to accompany the error message for this throwable */
fun Throwable.getDrawableRes(): Int = when (this) {
is IOException -> R.drawable.elephant_offline
is HttpException -> R.drawable.elephant_offline
else -> R.drawable.elephant_error
is IOException -> R.drawable.errorphant_offline
is HttpException -> R.drawable.errorphant_offline
else -> R.drawable.errorphant_error
}
/** @return A string error message for this throwable */

View File

@ -33,7 +33,7 @@ class BackgroundMessageView @JvmOverloads constructor(
orientation = VERTICAL
if (isInEditMode) {
setup(R.drawable.elephant_offline, R.string.error_network) {}
setup(R.drawable.errorphant_offline, R.string.error_network) {}
}
}

View File

@ -46,7 +46,7 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/elephant_error"
tools:src="@drawable/errorphant_error"
tools:visibility="visible" />
</FrameLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View File

@ -37,7 +37,7 @@
android:layout_gravity="center"
android:src="@android:color/transparent"
android:visibility="gone"
tools:src="@drawable/elephant_error"
tools:src="@drawable/errorphant_error"
tools:visibility="visible" />
</FrameLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View File

@ -24,7 +24,7 @@
android:src="@android:color/transparent"
android:visibility="gone"
android:layout_gravity="center"
tools:src="@drawable/elephant_error"
tools:src="@drawable/errorphant_error"
tools:visibility="visible" />
<include

View File

@ -44,7 +44,7 @@
android:layout_height="match_parent"
android:layout_gravity="center"
android:visibility="gone"
tools:src="@drawable/elephant_error"
tools:src="@drawable/errorphant_error"
tools:visibility="visible" />
</FrameLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View File

@ -39,7 +39,7 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/elephant_error"
tools:src="@drawable/errorphant_error"
tools:visibility="visible" />
<androidx.recyclerview.widget.RecyclerView
@ -53,4 +53,4 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/searchView" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -40,7 +40,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/elephant_error"
tools:src="@drawable/errorphant_error"
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -33,7 +33,7 @@
android:layout_marginTop="4dp"
android:contentDescription="@null"
android:scaleType="centerInside"
android:src="@drawable/elephant_offline" />
android:src="@drawable/errorphant_offline" />
<com.keylesspalace.tusky.view.ClickableSpanTextView
android:id="@+id/messageTextView"