像这样使用,第一个EmptyView使用showLoading()方法不显示
Closed this issue · 1 comments
ZjianP commented
<?xml version="1.0" encoding="utf-8"?>
<com.santalu.emptyview.EmptyView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/empty_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:emptyButtonText="@string/try_again"
app:emptyButtonTextColor="@color/colorPrimaryDark"
app:emptyDrawable="@drawable/ic_sentiment_dissatisfied"
app:emptyDrawableTint="@color/colorPrimary"
app:emptyGravity="center"
app:emptyText="@string/empty"
app:errorBackgroundColor="@color/red"
app:errorButtonBackgroundColor="@color/white"
app:errorButtonText="@string/try_again"
app:errorButtonTextColor="@color/black"
app:errorDrawable="@drawable/ic_sentiment_very_dissatisfied"
app:errorDrawableTint="@color/white"
app:errorText="@string/emptyview_error_unknown"
app:errorTextColor="@color/white"
app:loadingDrawable="@drawable/ic_sentiment_satisfied"
app:loadingStyle="circular"
app:loadingText="@string/emptyview_loading"
app:loadingTint="@color/colorPrimary">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="15dp"
android:background="#98FB98"
android:visibility="visible">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:background="#9ACD32"
android:orientation="vertical">
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:background="#9A32CD"
android:lineSpacingExtra="1dp"
android:lineSpacingMultiplier="1.2"
android:padding="16dp"
android:text="@string/lorem" />
<com.santalu.emptyview.EmptyView
android:id="@+id/empty_view1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:emptyDrawable="@drawable/ic_sentiment_dissatisfied"
app:emptyDrawableTint="@color/colorPrimary"
app:emptyGravity="center"
app:emptyText="@string/empty"
app:errorBackgroundColor="@color/red"
app:errorButtonBackgroundColor="@color/white"
app:errorButtonText="@string/try_again"
app:errorButtonTextColor="@color/black"
app:errorDrawable="@drawable/ic_sentiment_very_dissatisfied"
app:errorDrawableTint="@color/white"
app:errorText="@string/emptyview_error_unknown"
app:errorTextColor="@color/white"
app:loadingDrawable="@drawable/ic_sentiment_satisfied"
app:loadingStyle="circular"
app:loadingText="@string/emptyview_loading"
app:loadingTint="@color/colorPrimary">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="15dp"
android:background="#A4D3EE">
<TextView
android:id="@+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:background="#A0522D"
android:lineSpacingExtra="1dp"
android:lineSpacingMultiplier="1.2"
android:padding="16dp"
android:text="@string/lorem" />
</LinearLayout>
</com.santalu.emptyview.EmptyView>
</LinearLayout>
</ScrollView>
</com.santalu.emptyview.EmptyView>
santalu commented
Interesting... Why would you use this view as nested? I'll look into this as soon as i get the time. In the mean time i'd advise you to not nest emptviews.