android.support.design.widget.CoordinatorLayout.Behavior Java Examples

The following examples show how to use android.support.design.widget.CoordinatorLayout.Behavior. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MyBottomBehavior.java    From OpenWeatherPlus-Android with Apache License 2.0 5 votes vote down vote up
public static <V extends View> MyBottomBehavior<V> from(V view) {
    LayoutParams params = view.getLayoutParams();
    if (!(params instanceof CoordinatorLayout.LayoutParams)) {
        throw new IllegalArgumentException("The view is not a child of CoordinatorLayout");
    } else {
        Behavior behavior = ((CoordinatorLayout.LayoutParams) params).getBehavior();
        if (!(behavior instanceof MyBottomBehavior)) {
            throw new IllegalArgumentException("The view is not associated with MyBottomBehavior");
        } else {
            return (MyBottomBehavior) behavior;
        }
    }
}
 
Example #2
Source File: TabContentViewParent.java    From delion with Apache License 2.0 4 votes vote down vote up
/**
 * @return The {@link Behavior} that controls how children of this class animate together.
 */
public Behavior<?> getBehavior() {
    return mBehavior;
}
 
Example #3
Source File: TabContentViewParent.java    From AndroidChromium with Apache License 2.0 4 votes vote down vote up
/**
 * @return The {@link Behavior} that controls how children of this class animate together.
 */
public Behavior<?> getBehavior() {
    return mBehavior;
}