79165355

Date: 2024-11-07 07:13:26
Score: 0.5
Natty:
Report link

use code like this

        MenuItem searchItem = menu.findItem(R.id.action_search);
        SearchView filterPartsSearchView = (SearchView) searchItem.getActionView();

        if (searchManager != null) {
            filterPartsSearchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
        }

       filterPartsSearchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
        filterPartsSearchView.setBackgroundColor(ResourcesCompat.getColor(getResources(), android.R.color.transparent, null));
 
        View searchPlate = filterPartsSearchView.findViewById(androidx.appcompat.R.id.search_plate);
        if (searchPlate != null) {
            searchPlate.setBackgroundColor(Color.TRANSPARENT);
        }

This is Ref Image of selected text

This is Ref Image of selected text

2nd image Ref when cursor pressed and hold for highlight text while move cursor around text

nd highlight text while cursor moving around text

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Ramesh