title: Android searchview suggestions padding right
body: <p>I have a problem with my searchview. I'm trying to make search suggestions full width but the suggestions have a right padding.</p>
  
  <p><a href="https://i.stack.imgur.com/nGNJv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nGNJv.png" alt="my app searchview"></a></p>
  
  <p>&lt;-- language: lang-java --></p>
  
  <pre><code>public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.menu_main, menu);
  
  
      SearchManager searchManager=(SearchManager)getSystemService(Context.SEARCH_SERVICE);
      final MenuItem item=menu.findItem(R.id.procura);
  
      MenuItemCompat.setOnActionExpandListener(item, new MenuItemCompat.OnActionExpandListener() {
          @Override
          public boolean onMenuItemActionExpand(MenuItem item) {
              tbs.setVisibility(View.GONE);
              vwpgr.setVisibility(View.GONE);
              return true;
          }
  
          @Override
          public boolean onMenuItemActionCollapse(MenuItem item) {
              tbs.setVisibility(View.VISIBLE);
              vwpgr.setVisibility(View.VISIBLE);
              return true;
          }
      });
  
      searchView=(SearchView) MenuItemCompat.getActionView(item);
      searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
      searchView.setQueryHint(getResources().getString(R.string.app_hint));
      searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
          @Override
          public boolean onQueryTextSubmit(String query) {
              Intent search=new Intent(MainActivity.this,searchableactivity.class);
              search.putExtra("searchquery",query);
              startActivity(search);
              searchView.clearFocus();
              item.collapseActionView();
              return true;
          }
  
          @Override
          public boolean onQueryTextChange(String newText) {
              return false;
          }
      });
  
      final AutoCompleteTextView searchTextView = (AutoCompleteTextView) searchView.findViewById(android.support.v7.appcompat.R.id.search_src_text);
      //this remove left padding
      searchTextView.setDropDownAnchor(R.id.appbar);
      // this is not working
      searchTextView.setDropDownWidth(ViewGroup.LayoutParams.WRAP_CONTENT);
      //and i tryed this too: searchTextView.setDropDownWidth(ViewGroup.LayoutParams.MATCH_PARENT);
      try {
          Field mCursorDrawableRes = TextView.class.getDeclaredField("mCursorDrawableRes");
          mCursorDrawableRes.setAccessible(true);
          mCursorDrawableRes.set(searchTextView, R.drawable.search_cursor); //This sets the cursor resource ID to 0 or @null which will make it visible on white background
      } catch (Exception e) {
      }
  
      return true;
  }
  </code></pre>
  
  <p>my menu xml:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity"&gt;
  &lt;item
      android:id="@+id/procura"
      android:title="@string/app_hint"
      android:icon="@mipmap/ic_search_black_24dp"
      app:showAsAction="ifRoom|collapseActionView"
      app:actionViewClass="android.support.v7.widget.SearchView"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>And I tried these Stack Overflow answers:</p>
  
  <p><a href="https://stackoverflow.com/questions/30369246/implementing-searchview-as-per-the-material-design-guidelines">solution 1</a></p>
  
  <p><a href="https://stackoverflow.com/questions/35402030/android-searchview-drop-down-menu-screen-width">solution 2</a></p>
  
  <p><a href="https://stackoverflow.com/questions/32333551/searchview-width-margin-of-autocomplete-dropdown">solution 3</a></p>
  
  <p>How can I solve this?</p>