I am using legacy ShowcaseView for Android. I noticed that the Android 5 emulator places an OK button under the softnavigation panel, while Android <= KITKAT does not have this behavior.
See the OK button in the lower right corner: http://imgur.com/SZtIcHr
I already tried Android: fitsSystemWindows = "true", but did not succeed. Here is the relevant code in ShowcaseView.java that I found:
mEndButton = (Button) LayoutInflater.from(context).inflate(R.layout.showcase_button, null);
(Warning. Avoid skipping null as the root of the view (necessary to allow layout options on the root element of the bloated layout)) [..]
if (!mOptions.noButton && mEndButton.getParent() == null) { RelativeLayout.LayoutParams lps = (LayoutParams) generateDefaultLayoutParams(); lps.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); if (getConfigOptions().showcaseId==3) lps.addRule(RelativeLayout.ALIGN_PARENT_LEFT); else lps.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); int margin = ((Number) (metricScale * 12)).intValue(); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) // TODO: LOLLIPOP workaround lps.setMargins(margin, margin, margin, margin*5); else lps.setMargins(margin, margin, margin, margin); lps.height = LayoutParams.WRAP_CONTENT; lps.width = LayoutParams.WRAP_CONTENT; mEndButton.setLayoutParams(lps); mEndButton.setText(buttonText != null ? buttonText : getResources().getString(R.string.positive)); if (!hasCustomClickListener) mEndButton.setOnClickListener(this); addView(mEndButton);
I don't know how to change this or how Android 5 / material design caused this behavior. I would be happy for a hint! :)
source share