Skip to content

2. Customizations

Vikram Ezhil edited this page Apr 18, 2020 · 2 revisions

Various customizations can be done to Droid Floating Search View to make it more visually pleasing to your users.

Customization examples

// Sets the search view hint
dfsView.setSearchViewHint("Your preferred hint");

// Sets the search suggestions
dfsView.setSuggestions(new ArrayList<>(Arrays.asList("The Dark Knight", "The Avengers", "Deadpool", "Superman", "Logan", "Batman Vs. Superman", "Batman Begins")));

// Sets the search view close icon
dfsView.setSearchViewCloseIcon(R.drawable.yourPrefferedIcon);

// Sets the search view clear icon
dfsView.setSearchViewClearIcon(R.drawable.yourPrefferedIcon);

// Sets the search view action icon
dfsView.setSearchViewActionIcon(R.drawable.yourPrefferedIcon);

// Sets the search view background color
dfsView.setSearchViewBgColor(Color.parseColor("#263238"));

// Sets the search view text color
dfsView.setSearchViewTextColor(Color.WHITE);

// Sets the search view icons color
dfsView.setSearchViewIconsColor(Color.WHITE);

// Sets the search view hint text color
dfsView.setSearchViewHintTextColor(Color.WHITE);

// Sets the search view overlay background color
dfsView.setSearchViewOverlayBgColor(Color.BLACK);

// Sets the search view divider color
dfsView.setDividerColor(Color.WHITE);

// Sets the search view continuous search status
dfsView.setContinuousSearch(false);

// Sets the search view close status when overlay is touched
dfsView.setCloseSearchViewOnOverlayTouch(false);

// Sets the search view show action icon status
dfsView.setShowSearchViewActionIcon(false);
Clone this wiki locally