/** * Set width for this item view. * * The default is 50dp * @param width The width value * */ public Builder setWidth(int width) { mTimoItemViewParameter.setWidth(width); return this; }
/** * Set the text string when the button is at normal-state. * @param normalText The text string of normal state. * @return The builder. * */ public Builder setNormalText(String normalText) { mTimoItemViewParameter.setNormalText(normalText); return this; }
/** * Set the text resource when the button is at highlighted-state. * @param highlightedTextRes The text resource of highlighted state. * @return The builder. * */ public Builder setHighlightedTextRes(int highlightedTextRes) { mTimoItemViewParameter.setHighlightedTextRes(highlightedTextRes); return this; }
/** * Set the text string when the button is at highlighted-state. * @param highlightedText The text string of highlighted state. * @return The builder. * */ public Builder setHighlightedText(String highlightedText) { mTimoItemViewParameter.setHighlightedText(highlightedText); return this; }
/** * Set the width of {@link ImageView} * * @param imageWidth The width value in pixel. * */ public Builder setImageWidth(int imageWidth) { mTimoItemViewParameter.setImageWidth(imageWidth); return this; }
/** * Set the background drawable for the item view {@link me.samlss.timomenu.view.TimoItemView} * * @param backgroundDrawable The background drawable. * */ public Builder setBackgroundDrawable(Drawable backgroundDrawable) { mTimoItemViewParameter.setBackgroundDrawable(backgroundDrawable); return this; }
/** * Sets the margins for menu, in pixels. * * @param menuMarginRect Will get the value of {@link Rect#left}, {@link Rect#top}, {@link Rect#right}, * {@link Rect#bottom} * */ public Builder setMenuMargin(Rect menuMarginRect) { mImpl.setMenuMarginRect(menuMarginRect); return this; }
/** * Set up the show animation & dismiss animation. <br> * But if you call {@link #showImmediately()} or {@link #dismissImmediately()}, will not start the animation. * @param show The showing animation. * @param dismiss The dismissing animation * */ public Builder setAnimation(Animation show, Animation dismiss){ mImpl.setAnimation(show, dismiss); return this; }
/** * Set the image resource when the button is at normal-state. * @param normalImageRes The image resource of normal state. * @return The builder. * */ public Builder setNormalImageRes(int normalImageRes) { mTimoItemViewParameter.setNormalImageRes(normalImageRes); return this; }
/** * Set the width of {@link android.widget.TextView} * * @param textWidth The width value in pixel. * */ public Builder setTextWidth(int textWidth) { mTimoItemViewParameter.setTextWidth(textWidth); return this; }
/** * Set the margins of {@link ImageView} * * @param imageMargin Will take the value left | top | right | bottom as the margin value. * */ public Builder setImageMargin(Rect imageMargin) { mTimoItemViewParameter.setImageMargin(imageMargin); return this; }
/** * Set the background drawable resource for the item view {@link me.samlss.timomenu.view.TimoItemView} * * @param backgroundDrawableRes The background drawable resource. * */ public Builder setBackgroundDrawableRes(int backgroundDrawableRes) { mTimoItemViewParameter.setBackgroundDrawableRes(backgroundDrawableRes); return this; }
private void checkDismissAnimationCounter(){ mAnimationCounter--; if (mAnimationCounter == 0){ dismissFinished(); } }
/** * Set the background resource of menu. * * @param menuBackgroundRes The drawable resource id. * */ public Builder setMenuBackgroundRes(int menuBackgroundRes) { mImpl.setMenuBackgroundRes(menuBackgroundRes); return this; }
/** * Set whether to use the default divider line, the default is true. * * @param use True will use the divider line, otherwise not. * */ public Builder setUseDefaultDividerLine(boolean use) { mImpl.setUseDefaultDividerLine(use); return this; }
/** * Set a header view to the menu. * * @param headerView The header view. * */ public Builder setHeaderView(View headerView){ mImpl.setHeaderView(headerView); return this; }
/** * Set a header view to the menu. * * @param headerLayoutRes The header view layout resource. * */ public Builder setHeaderLayoutRes(int headerLayoutRes) { mImpl.setHeaderLayoutRes(headerLayoutRes); return this; }
/** * Describes how this menu is positioned. Defaults to Bottom. * * @param gravity Only can be Bottom | Top | Center. * */ public Builder setGravity(int gravity){ mImpl.setGravity(gravity); return this; }
/** * Set the listener for menu, will call back the show & dismiss method.. * * @param timoMenuListener The menu listener. * */ public Builder setTimoMenuListener(TimoMenuListener timoMenuListener) { mImpl.setTimoMenuListener(timoMenuListener); return this; }
/** * Add a row into the menu with the item view. * * @param itemAnimation The animation when item is displayed, if it's null, do not need to display animation. * @param timoItemViewParameters The parameter of the item views. * */ public Builder addRow(ItemAnimation itemAnimation, List<TimoItemViewParameter> timoItemViewParameters){ mImpl.addRow(itemAnimation, timoItemViewParameters); return this; }