added in version 24.1.0
belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1
belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1
ShadowOverlayHelper
public
final
class
ShadowOverlayHelper
extends Object
java.lang.Object | |
↳ | android.support.v17.leanback.widget.ShadowOverlayHelper |
ShadowOverlayHelper is a helper class for shadow, overlay color and rounded corner. There are many choices to implement Shadow, overlay color. Initialize it with ShadowOverlayHelper.Builder and it decides the best strategy based on options user choose and current platform version.
ShadowOverlayHelper mHelper = new ShadowOverlayHelper.Builder().
.needsOverlay(true).needsRoundedCorner(true).needsShadow(true)
.build();
mHelper.prepareParentForShadow(parentView); // apply optical-bounds for 9-patch shadow.
mHelper.setOverlayColor(view, Color.argb(0x80, 0x80, 0x80, 0x80));
mHelper.setShadowFocusLevel(view, 1.0f);
...
View initializeView(View view) {
if (mHelper.needsWrapper()) {
ShadowOverlayContainer wrapper = mHelper.createShadowOverlayContainer(context);
wrapper.wrap(view);
return wrapper;
} else {
mHelper.onViewCreated(view);
return view;
}
}
...