/** * Displays the dialog if it is not shown already. */ public void show() { if (isShowing()) { return; } onAttached(rootView); }
/** * Set the header view using the id of the layout resource */ public DialogPlusBuilder setHeader(int resourceId) { return setHeader(resourceId, false); }
/** * Set the footer view using the id of the layout resource */ public DialogPlusBuilder setFooter(int resourceId) { return setFooter(resourceId, false); }
/** * Create the dialog using this builder */ @NonNull public DialogPlus create() { getHolder().setBackgroundResource(getContentBackgroundResource()); return new DialogPlus(this); }
static void animateContent(final View view, int to, Animation.AnimationListener listener) { HeightAnimation animation = new HeightAnimation(view, view.getHeight(), to); animation.setAnimationListener(listener); animation.setDuration(200); view.startAnimation(animation); }
@Override public void onClick(View v) { if (onClickListener == null) { return; } onClickListener.onClick(DialogPlus.this, v); } });
public FrameLayout.LayoutParams getContentParams() { if (expanded) { params.height = getDefaultContentHeight(); } return params; }
public static ExpandTouchListener newListener(Context context, AbsListView listView, View container, int gravity, int displayHeight, int defaultContentHeight) { return new ExpandTouchListener(context, listView, container, gravity, displayHeight, defaultContentHeight); }
/** * Returns footer view if it was set. */ @Nullable public View getFooterView() { return holder.getFooter(); }
public Animation getOutAnimation() { int res = (outAnimation == INVALID) ? Utils.getAnimationResource(this.gravity, false) : outAnimation; return AnimationUtils.loadAnimation(context, res); }
/** * Use setBackgroundResource */ @Deprecated public DialogPlusBuilder setBackgroundColorResId(int resourceId) { return setContentBackgroundResource(resourceId); }
/** * Creates a new dialog builder */ public static DialogPlusBuilder newDialog(@NonNull Context context) { return new DialogPlusBuilder(context); }
/** * Returns header view if it was set. */ @Nullable public View getHeaderView() { return holder.getHeader(); }
@NonNull public Holder getHolder() { if (holder == null) { holder = new ListHolder(); } return holder; }
@Override public void onItemClick(@NonNull Object item, @NonNull View view, int position) { if (onItemClickListener == null) { return; } onItemClickListener.onItemClick(DialogPlus.this, item, view, position); } });
@Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { if (listener == null) { return; } listener.onItemClick(parent.getItemAtPosition(position), view, position); } }
/** * Set the header view using a view */ public DialogPlusBuilder setHeader(@NonNull View view) { return setHeader(view, false); }
/** * Sets the given view as footer. */ public DialogPlusBuilder setFooter(@NonNull View view) { return setFooter(view, false); }