Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public class MaterialSearchBar extends FrameLayout implements View.OnClickListen

private boolean speechMode;
private int maxSuggestionCount;
private int suggestionAnimationSpeed;
private boolean navButtonEnabled;
private boolean roundedSearchBarEnabled;
private int dividerColor;
Expand Down Expand Up @@ -136,6 +137,7 @@ private void init(AttributeSet attrs) {
roundedSearchBarEnabled = array.getBoolean(R.styleable.MaterialSearchBar_mt_roundedSearchBarEnabled, false);
dividerColor = array.getColor(R.styleable.MaterialSearchBar_mt_dividerColor, ContextCompat.getColor(getContext(), R.color.searchBarDividerColor));
searchBarColor = array.getColor(R.styleable.MaterialSearchBar_mt_searchBarColor, ContextCompat.getColor(getContext(), R.color.searchBarPrimaryColor));
suggestionAnimationSpeed = array.getInteger(R.styleable.MaterialSearchBar_mt_suggestionsAnimationSpeed, 1200);

//Icon Related Attributes
menuIconRes = array.getResourceId(R.styleable.MaterialSearchBar_mt_menuIconDrawable, R.drawable.ic_dots_vertical_black_48dp);
Expand Down Expand Up @@ -484,7 +486,7 @@ private void animateSuggestions(int from, int to) {
findViewById(R.id.mt_divider).setVisibility(to > 0 ? View.VISIBLE : View.GONE);

ValueAnimator animator = ValueAnimator.ofInt(from, to);
animator.setDuration(1200);
animator.setDuration(suggestionAnimationSpeed);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
Expand Down
1 change: 1 addition & 0 deletions library/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<attr name="mt_menuDividerEnabled" format="boolean"/>
<attr name="mt_dividerColor" format="color"/>
<attr name="mt_searchBarColor" format="color"/>
<attr name="mt_suggestionsAnimationSpeed" format="integer"/>

//Icons
<attr name="mt_menuIconDrawable" format="reference"/>
Expand Down