From 27716f8425d753398f8913dd26a96a91b1a3c88c Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Mon, 20 Feb 2017 21:04:48 +0100 Subject: [PATCH] Fix landscape --- .../android/ui/fragment/ExtendedListFragment.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/owncloud/android/ui/fragment/ExtendedListFragment.java b/src/com/owncloud/android/ui/fragment/ExtendedListFragment.java index dceafba73d..169a2737fc 100644 --- a/src/com/owncloud/android/ui/fragment/ExtendedListFragment.java +++ b/src/com/owncloud/android/ui/fragment/ExtendedListFragment.java @@ -62,6 +62,8 @@ import java.util.ArrayList; import third_parties.in.srain.cube.GridViewWithHeaderAndFooter; +import static android.content.res.Configuration.ORIENTATION_LANDSCAPE; + public class ExtendedListFragment extends Fragment implements OnItemClickListener, OnEnforceableRefreshListener, SearchView.OnQueryTextListener { @@ -170,7 +172,11 @@ public class ExtendedListFragment extends Fragment DisplayMetrics displaymetrics = new DisplayMetrics(); getActivity().getWindowManager().getDefaultDisplay().getMetrics(displaymetrics); int width = displaymetrics.widthPixels; - searchView.setMaxWidth((int)(width * 0.7)); + if (getResources().getConfiguration().orientation == ORIENTATION_LANDSCAPE) { + searchView.setMaxWidth((int)(width * 0.8)); + } else { + searchView.setMaxWidth((int)(width * 0.7)); + } searchView.setOnQueryTextFocusChangeListener(new View.OnFocusChangeListener() { @Override