Search in sources :

Example 1 with ResourceValue

use of com.willowtreeapps.hyperion.attr.collectors.ResourceValue in project Hyperion-Android by willowtreeapps.

the class BottomNavigationViewAttributeCollector method collect.

@NonNull
@Override
public List<ViewAttribute> collect(BottomNavigationView view, AttributeTranslator attributeTranslator) {
    final Context context = view.getContext();
    final Resources res = context.getResources();
    List<ViewAttribute> attributes = new ArrayList<>();
    attributes.add(new ViewAttribute<>("MaxItemCount", view.getMaxItemCount()));
    attributes.add(Collectors.createColorAttribute(view, "ItemTint", view.getItemIconTintList()));
    attributes.add(Collectors.createColorAttribute(view, "ItemTextColor", view.getItemTextColor()));
    attributes.add(new ViewAttribute<>("SelectedItemId", new ResourceValue(res, view.getSelectedItemId())));
    attributes.add(new ViewAttribute<>("ItemBackgroundRes", new ResourceValue(res, view.getItemBackgroundResource())));
    attributes.addAll(Collectors.createMenuAttributes(context, view.getMenu()));
    return attributes;
}
Also used : Context(android.content.Context) ArrayList(java.util.ArrayList) ResourceValue(com.willowtreeapps.hyperion.attr.collectors.ResourceValue) Resources(android.content.res.Resources) ViewAttribute(com.willowtreeapps.hyperion.attr.ViewAttribute) NonNull(android.support.annotation.NonNull)

Aggregations

Context (android.content.Context)1 Resources (android.content.res.Resources)1 NonNull (android.support.annotation.NonNull)1 ViewAttribute (com.willowtreeapps.hyperion.attr.ViewAttribute)1 ResourceValue (com.willowtreeapps.hyperion.attr.collectors.ResourceValue)1 ArrayList (java.util.ArrayList)1