From 0af7c1875061234052907906ec582133914fcab4 Mon Sep 17 00:00:00 2001 From: wsdfhjxc Date: Wed, 15 Aug 2018 22:23:13 +0200 Subject: [PATCH] Set focus on the header section if there's a changelog --- .../fdroid/fdroid/views/AppDetailsRecyclerViewAdapter.java | 4 ++++ 1 file changed, 4 insertions(+) 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 b59403ac8..eb64af686 100644 --- a/app/src/main/java/org/fdroid/fdroid/views/AppDetailsRecyclerViewAdapter.java +++ b/app/src/main/java/org/fdroid/fdroid/views/AppDetailsRecyclerViewAdapter.java @@ -437,6 +437,10 @@ public class AppDetailsRecyclerViewAdapter sbWhatsNew.append(app.whatsNew); whatsNewView.setText(sbWhatsNew); whatsNewView.setVisibility(View.VISIBLE); + + // Set focus on the header section to prevent auto scrolling to + // the changelog if its content becomes too long to fit on screen. + recyclerView.requestChildFocus(itemView, itemView); } final Spanned desc = Html.fromHtml(app.description, null, new Utils.HtmlTagHandler()); descriptionView.setMovementMethod(LinkMovementMethod.getInstance());