diff --git a/app/src/main/java/org/fdroid/fdroid/views/AppDetailsRecyclerViewAdapter.java b/app/src/main/java/org/fdroid/fdroid/views/AppDetailsRecyclerViewAdapter.java index 19c49418e..e8ac029af 100644 --- a/app/src/main/java/org/fdroid/fdroid/views/AppDetailsRecyclerViewAdapter.java +++ b/app/src/main/java/org/fdroid/fdroid/views/AppDetailsRecyclerViewAdapter.java @@ -135,11 +135,19 @@ public class AppDetailsRecyclerViewAdapter private void setShowVersions(boolean showVersions) { this.showVersions = showVersions; - items.removeAll(versions); + boolean itemsWereRemoved = items.removeAll(versions); + int startIndex = items.indexOf(VIEWTYPE_VERSIONS) + 1; + + // When adding/removing items, be sure to only notifyItemInserted and notifyItemRemoved + // rather than notifyDatasetChanged(). If we only notify about the entire thing, then + // everything gets rebuilt, including the expandable "Versions" item. By rebuilding that + // item it will interrupt the nice material-design-style-ripple from the background. if (showVersions) { - items.addAll(items.indexOf(VIEWTYPE_VERSIONS) + 1, versions); + items.addAll(startIndex, versions); + notifyItemRangeInserted(startIndex, versions.size()); + } else if (itemsWereRemoved) { + notifyItemRangeRemoved(startIndex, versions.size()); } - notifyDataSetChanged(); } private void addItem(int item) { diff --git a/app/src/main/res/layout/app_details2_link_item.xml b/app/src/main/res/layout/app_details2_link_item.xml index 35bcba867..f157cbf4d 100644 --- a/app/src/main/res/layout/app_details2_link_item.xml +++ b/app/src/main/res/layout/app_details2_link_item.xml @@ -1,9 +1,10 @@ \ No newline at end of file + tools:text="@string/menu_website" /> \ No newline at end of file diff --git a/app/src/main/res/layout/app_details2_links.xml b/app/src/main/res/layout/app_details2_links.xml index 0ff67bbc1..11f50ce9f 100644 --- a/app/src/main/res/layout/app_details2_links.xml +++ b/app/src/main/res/layout/app_details2_links.xml @@ -14,18 +14,24 @@ android:clickable="true" android:orientation="vertical" tools:ignore="UnusedAttribute"> - + + + + + +