Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NT-1951: UI/UX – Error loading initial comments (#1284)
* added error layout * added custom error * refactored comments viewmodel * fixed tests * fixed lint errors * fixed failing tests * refactored pull refresh errors * fixed lint errors * revome redundant viewholder * revome redundant viewholder Co-authored-by: Isabel Martin <arkariang@gmail.com>
- Loading branch information
1 parent
4f9dd71
commit 3737f82
Showing
8 changed files
with
133 additions
and
32 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
app/src/main/java/com/kickstarter/libs/utils/extensions/BoolenExt.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.kickstarter.libs.utils.extensions | ||
|
||
import android.view.View | ||
|
||
fun Boolean.toVisibility(): Int { | ||
return when (this) { | ||
true -> View.VISIBLE | ||
else -> View.GONE | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
app/src/main/res/layout/comment_initial_load_error_layout.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_height="match_parent"> | ||
|
||
<androidx.appcompat.widget.AppCompatTextView | ||
android:id="@+id/error_loading_comment" | ||
android:visibility="visible" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
android:gravity="center" | ||
android:drawablePadding="@dimen/grid_2" | ||
android:drawableTop="@drawable/ic_info" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
android:layout_width="wrap_content" | ||
android:text="@string/something_went_wrong" | ||
style="@style/CalloutSecondary" | ||
android:layout_height="wrap_content"/> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters