diff --git a/app/src/main/java/org/mifos/mobilebanking/ui/fragments/ClientAccountsFragment.java b/app/src/main/java/org/mifos/mobilebanking/ui/fragments/ClientAccountsFragment.java index 26299befa..4de4d9ab6 100644 --- a/app/src/main/java/org/mifos/mobilebanking/ui/fragments/ClientAccountsFragment.java +++ b/app/src/main/java/org/mifos/mobilebanking/ui/fragments/ClientAccountsFragment.java @@ -15,6 +15,7 @@ import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.SearchView; +import android.util.DisplayMetrics; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; @@ -310,6 +311,10 @@ private void initSearch(Menu menu, final AccountType account) { search = (SearchView) menu.findItem(R.id.menu_search_share).getActionView(); } + DisplayMetrics displayMetrics = new DisplayMetrics(); + getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); + int width = displayMetrics.widthPixels; + search.setMaxWidth((int) (0.75 * width)); search.setSearchableInfo(manager.getSearchableInfo(getActivity().getComponentName())); search.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override