private void applyBackgroundResource()

in rides-android/src/main/java/com/uber/sdk/android/rides/RideRequestButton.java [309:332]


    private void applyBackgroundResource(TypedArray backgroundAttributes) {
        int color = Color.BLACK;
        if (backgroundAttributes.hasValue(0)) {
            int backgroundResource = backgroundAttributes.getResourceId(0, 0);
            if (backgroundResource != 0) {
                setBackgroundResource(backgroundResource);
                for (int i = 0; i < getChildCount(); i++) {
                    View childView = getChildAt(i);
                    if (!(childView instanceof LinearLayout)) {
                        childView.setBackgroundResource(backgroundResource);
                    }
                }
                return;
            } else {
                color = backgroundAttributes.getColor(0, Color.BLACK);
            }
        }

        setBackgroundColor(color);
        for (int i = 0; i < getChildCount(); i++) {
            View childView = getChildAt(i);
            childView.setBackgroundColor(color);
        }
    }