Search in sources :

Example 1 with Component

use of carbon.component.Component in project Carbon by ZieIony.

the class AppBarLayout method findComponentsById.

public List<Component> findComponentsById(int id) {
    List<Component> result = new ArrayList<>();
    List<ViewGroup> groups = new ArrayList<>();
    groups.add(this);
    while (!groups.isEmpty()) {
        ViewGroup group = groups.remove(0);
        for (int i = 0; i < group.getChildCount(); i++) {
            View child = group.getChildAt(i);
            if (child instanceof ComponentView && ((ComponentView) child).getComponent().getView().getId() == id)
                result.add(((ComponentView) child).getComponent());
            if (child instanceof ViewGroup)
                groups.add((ViewGroup) child);
        }
    }
    return result;
}
Also used : ComponentView(carbon.component.ComponentView) ViewGroup(android.view.ViewGroup) ArrayList(java.util.ArrayList) Component(carbon.component.Component) ShadowView(carbon.view.ShadowView) ComponentView(carbon.component.ComponentView) StrokeView(carbon.view.StrokeView) View(android.view.View) RippleView(carbon.drawable.ripple.RippleView) RevealView(carbon.view.RevealView) InsetView(carbon.view.InsetView) AnimatedView(carbon.animation.AnimatedView) MarginView(carbon.view.MarginView) ShapeModelView(carbon.view.ShapeModelView) MaxSizeView(carbon.view.MaxSizeView) TouchMarginView(carbon.view.TouchMarginView) VisibleView(carbon.view.VisibleView) StateAnimatorView(carbon.view.StateAnimatorView) Paint(android.graphics.Paint) SuppressLint(android.annotation.SuppressLint) Point(android.graphics.Point)

Example 2 with Component

use of carbon.component.Component in project Carbon by ZieIony.

the class CollapsingToolbarLayout method findComponentsOfType.

public List<Component> findComponentsOfType(Class type) {
    List<Component> result = new ArrayList<>();
    List<ViewGroup> groups = new ArrayList<>();
    groups.add(this);
    while (!groups.isEmpty()) {
        ViewGroup group = groups.remove(0);
        for (int i = 0; i < group.getChildCount(); i++) {
            View child = group.getChildAt(i);
            if (child instanceof ComponentView && ((ComponentView) child).getComponent().getClass().equals(type))
                result.add(((ComponentView) child).getComponent());
            if (child instanceof ViewGroup)
                groups.add((ViewGroup) child);
        }
    }
    return result;
}
Also used : ComponentView(carbon.component.ComponentView) ViewGroup(android.view.ViewGroup) ArrayList(java.util.ArrayList) Component(carbon.component.Component) ShadowView(carbon.view.ShadowView) ComponentView(carbon.component.ComponentView) StrokeView(carbon.view.StrokeView) View(android.view.View) RippleView(carbon.drawable.ripple.RippleView) RevealView(carbon.view.RevealView) TransformationView(carbon.view.TransformationView) InsetView(carbon.view.InsetView) AnimatedView(carbon.animation.AnimatedView) MarginView(carbon.view.MarginView) ShapeModelView(carbon.view.ShapeModelView) MaxSizeView(carbon.view.MaxSizeView) TouchMarginView(carbon.view.TouchMarginView) VisibleView(carbon.view.VisibleView) StateAnimatorView(carbon.view.StateAnimatorView) Paint(android.graphics.Paint) SuppressLint(android.annotation.SuppressLint) Point(android.graphics.Point)

Example 3 with Component

use of carbon.component.Component in project Carbon by ZieIony.

the class FlowLayout method findComponentsOfType.

public List<Component> findComponentsOfType(Class type) {
    List<Component> result = new ArrayList<>();
    List<ViewGroup> groups = new ArrayList<>();
    groups.add(this);
    while (!groups.isEmpty()) {
        ViewGroup group = groups.remove(0);
        for (int i = 0; i < group.getChildCount(); i++) {
            View child = group.getChildAt(i);
            if (child instanceof ComponentView && ((ComponentView) child).getComponent().getClass().equals(type))
                result.add(((ComponentView) child).getComponent());
            if (child instanceof ViewGroup)
                groups.add((ViewGroup) child);
        }
    }
    return result;
}
Also used : ComponentView(carbon.component.ComponentView) ViewGroup(android.view.ViewGroup) ArrayList(java.util.ArrayList) Component(carbon.component.Component) ShadowView(carbon.view.ShadowView) ComponentView(carbon.component.ComponentView) StrokeView(carbon.view.StrokeView) View(android.view.View) RippleView(carbon.drawable.ripple.RippleView) RevealView(carbon.view.RevealView) TransformationView(carbon.view.TransformationView) InsetView(carbon.view.InsetView) AnimatedView(carbon.animation.AnimatedView) MarginView(carbon.view.MarginView) ShapeModelView(carbon.view.ShapeModelView) BehaviorView(carbon.view.BehaviorView) MaxSizeView(carbon.view.MaxSizeView) TouchMarginView(carbon.view.TouchMarginView) VisibleView(carbon.view.VisibleView) StateAnimatorView(carbon.view.StateAnimatorView) Paint(android.graphics.Paint) SuppressLint(android.annotation.SuppressLint) Point(android.graphics.Point)

Example 4 with Component

use of carbon.component.Component in project Carbon by ZieIony.

the class DrawerLayout method findComponentsOfType.

public List<Component> findComponentsOfType(Class type) {
    List<Component> result = new ArrayList<>();
    List<ViewGroup> groups = new ArrayList<>();
    groups.add(this);
    while (!groups.isEmpty()) {
        ViewGroup group = groups.remove(0);
        for (int i = 0; i < group.getChildCount(); i++) {
            View child = group.getChildAt(i);
            if (child instanceof ComponentView && ((ComponentView) child).getComponent().getClass().equals(type))
                result.add(((ComponentView) child).getComponent());
            if (child instanceof ViewGroup)
                groups.add((ViewGroup) child);
        }
    }
    return result;
}
Also used : ComponentView(carbon.component.ComponentView) ViewGroup(android.view.ViewGroup) ArrayList(java.util.ArrayList) Component(carbon.component.Component) ShadowView(carbon.view.ShadowView) ComponentView(carbon.component.ComponentView) StrokeView(carbon.view.StrokeView) View(android.view.View) RippleView(carbon.drawable.ripple.RippleView) RevealView(carbon.view.RevealView) TransformationView(carbon.view.TransformationView) InsetView(carbon.view.InsetView) AnimatedView(carbon.animation.AnimatedView) MarginView(carbon.view.MarginView) ShapeModelView(carbon.view.ShapeModelView) BehaviorView(carbon.view.BehaviorView) MaxSizeView(carbon.view.MaxSizeView) TouchMarginView(carbon.view.TouchMarginView) VisibleView(carbon.view.VisibleView) StateAnimatorView(carbon.view.StateAnimatorView) Paint(android.graphics.Paint) SuppressLint(android.annotation.SuppressLint) Point(android.graphics.Point)

Example 5 with Component

use of carbon.component.Component in project Carbon by ZieIony.

the class ConstraintLayout method findComponentsById.

public List<Component> findComponentsById(int id) {
    List<Component> result = new ArrayList<>();
    List<ViewGroup> groups = new ArrayList<>();
    groups.add(this);
    while (!groups.isEmpty()) {
        ViewGroup group = groups.remove(0);
        for (int i = 0; i < group.getChildCount(); i++) {
            View child = group.getChildAt(i);
            if (child instanceof ComponentView && ((ComponentView) child).getComponent().getView().getId() == id)
                result.add(((ComponentView) child).getComponent());
            if (child instanceof ViewGroup)
                groups.add((ViewGroup) child);
        }
    }
    return result;
}
Also used : ComponentView(carbon.component.ComponentView) ViewGroup(android.view.ViewGroup) ArrayList(java.util.ArrayList) Component(carbon.component.Component) ShadowView(carbon.view.ShadowView) ComponentView(carbon.component.ComponentView) StrokeView(carbon.view.StrokeView) View(android.view.View) RippleView(carbon.drawable.ripple.RippleView) RevealView(carbon.view.RevealView) TransformationView(carbon.view.TransformationView) InsetView(carbon.view.InsetView) AnimatedView(carbon.animation.AnimatedView) MarginView(carbon.view.MarginView) ShapeModelView(carbon.view.ShapeModelView) BehaviorView(carbon.view.BehaviorView) MaxSizeView(carbon.view.MaxSizeView) TouchMarginView(carbon.view.TouchMarginView) VisibleView(carbon.view.VisibleView) StateAnimatorView(carbon.view.StateAnimatorView) Paint(android.graphics.Paint) SuppressLint(android.annotation.SuppressLint) Point(android.graphics.Point)

Aggregations

SuppressLint (android.annotation.SuppressLint)24 Paint (android.graphics.Paint)24 Point (android.graphics.Point)24 View (android.view.View)24 ViewGroup (android.view.ViewGroup)24 AnimatedView (carbon.animation.AnimatedView)24 Component (carbon.component.Component)24 ComponentView (carbon.component.ComponentView)24 RippleView (carbon.drawable.ripple.RippleView)24 InsetView (carbon.view.InsetView)24 MarginView (carbon.view.MarginView)24 MaxSizeView (carbon.view.MaxSizeView)24 RevealView (carbon.view.RevealView)24 ShadowView (carbon.view.ShadowView)24 ShapeModelView (carbon.view.ShapeModelView)24 StateAnimatorView (carbon.view.StateAnimatorView)24 StrokeView (carbon.view.StrokeView)24 TouchMarginView (carbon.view.TouchMarginView)24 VisibleView (carbon.view.VisibleView)24 ArrayList (java.util.ArrayList)24