use of carbon.component.Component in project Carbon by ZieIony.
the class LinearLayout 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;
}
use of carbon.component.Component in project Carbon by ZieIony.
the class FrameLayout 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;
}
use of carbon.component.Component in project Carbon by ZieIony.
the class ConstraintLayout 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;
}
use of carbon.component.Component in project Carbon by ZieIony.
the class Toolbar 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;
}
use of carbon.component.Component in project Carbon by ZieIony.
the class FlowLayout 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;
}
Aggregations