ShowcaseView icon indicating copy to clipboard operation
ShowcaseView copied to clipboard

Button positioning API

Open alexfu opened this issue 6 years ago • 0 comments

Would be nice to have an abstracted API to set the buttons position without having to know the details of the underlying layout (i.e. RelativeLayout). Ideally, I would just be able to do this:

ShowcaseView showcaseView = ShowcaseView.Builder(activity).build();
showcaseView.setButtonPosition(Gravity.TOP|Gravity.LEFT);

or something similar, as opposed to:

ShowcaseView showcaseView = ShowcaseView.Builder(activity).build();
RelativeLayout.LayoutParams lps = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
lps.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
lps.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
showcaseView.setButtonPosition(lps);

Also, if the underlying layout ever changes, then the public facing API would certainly need to change. Not exactly ideal.

alexfu avatar Dec 06 '17 14:12 alexfu