display no related content view when none loaded

This commit is contained in:
Akinwale Ariwodola 2020-05-01 16:52:29 +01:00
parent cfa7e07eba
commit f4b28c4d90
3 changed files with 16 additions and 1 deletions

View file

@ -411,6 +411,8 @@ public class FileViewActivity extends AppCompatActivity {
RecyclerView relatedContentList = findViewById(R.id.file_view_related_content_list);
relatedContentList.setAdapter(relatedContentAdapter);
relatedContentAdapter.notifyDataSetChanged();
Helper.setViewVisibility(findViewById(R.id.file_view_no_related_content), relatedContentAdapter.getItemCount() == 0 ? View.VISIBLE : View.GONE);
}
@Override

View file

@ -376,6 +376,18 @@
android:layout_centerVertical="true"
android:visibility="gone" />
</RelativeLayout>
<TextView
android:id="@+id/file_view_no_related_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:fontFamily="@font/inter"
android:text="@string/no_related_content"
android:textSize="14sp"
android:textFontWeight="300"
android:visibility="gone" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/file_view_related_content_list"
android:overScrollMode="never"

View file

@ -90,8 +90,9 @@
<string name="view_channel_url_desc">View the %1$s channel</string>
<!-- Search -->
<string name="search_no_results">No results found for "%1$s". Please enter a different search term.</string>
<string name="search_no_results">No results found for \'%1$s\'. Please enter a different search term.</string>
<string name="search_no_query">You can search for anything including movies, music, ebooks, software and more.</string>
<string name="no_related_content">No related content to display at this time.</string>
<!-- Wallet -->
<string name="balance">Balance</string>