Add footer to wikivoyage search list

This commit is contained in:
Alex Sytnyk 2018-04-02 14:37:31 +03:00
parent 7327976170
commit 8df9966f42
3 changed files with 57 additions and 39 deletions

View file

@ -30,6 +30,8 @@
android:id="@+id/recycler_view" android:id="@+id/recycler_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingBottom="@dimen/map_markers_recycler_view_padding_bottom"
android:scrollbars="vertical"/> android:scrollbars="vertical"/>
</LinearLayout> </LinearLayout>

View file

@ -2,6 +2,11 @@
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/wikivoyage_card_bg_color" android:background="?attr/wikivoyage_card_bg_color"
@ -61,4 +66,12 @@
android:background="?attr/wikivoyage_card_divider_color" android:background="?attr/wikivoyage_card_divider_color"
android:focusable="false"/> android:focusable="false"/>
</LinearLayout>
<include
android:id="@+id/shadow"
layout="@layout/card_bottom_divider"
android:visibility="gone"
tools:visibility="visible"/>
</LinearLayout> </LinearLayout>

View file

@ -51,6 +51,7 @@ public class SearchRecyclerViewAdapter extends RecyclerView.Adapter<SearchRecycl
holder.title.setText(item.getArticleTitle().toString()); holder.title.setText(item.getArticleTitle().toString());
holder.description.setText(item.getLang().toString()); holder.description.setText(item.getLang().toString());
holder.divider.setVisibility(lastItem ? View.GONE : View.VISIBLE); holder.divider.setVisibility(lastItem ? View.GONE : View.VISIBLE);
holder.shadow.setVisibility(lastItem ? View.VISIBLE : View.GONE);
} }
@Override @Override
@ -77,6 +78,7 @@ public class SearchRecyclerViewAdapter extends RecyclerView.Adapter<SearchRecycl
final TextView title; final TextView title;
final TextView description; final TextView description;
final View divider; final View divider;
final View shadow;
public ViewHolder(View itemView) { public ViewHolder(View itemView) {
super(itemView); super(itemView);
@ -84,6 +86,7 @@ public class SearchRecyclerViewAdapter extends RecyclerView.Adapter<SearchRecycl
title = (TextView) itemView.findViewById(R.id.title); title = (TextView) itemView.findViewById(R.id.title);
description = (TextView) itemView.findViewById(R.id.description); description = (TextView) itemView.findViewById(R.id.description);
divider = itemView.findViewById(R.id.divider); divider = itemView.findViewById(R.id.divider);
shadow = itemView.findViewById(R.id.shadow);
} }
} }
} }