use of carbon.recycler.Component in project Carbon by ZieIony.
the class Toolbar 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.recycler.Component in project Carbon by ZieIony.
the class DrawerLayout 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.recycler.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;
}
use of carbon.recycler.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.recycler.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;
}
Aggregations