private void init(AttributeSet attrs) { inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); TypedArray typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.ProgressLayout); emptyStateImageHeight = (int) (typedArray.getDimension(R.styleable.ProgressLayout_emptyImageHeight, emptyStateImageHeight) / scaleRatio); emptyStateContentTextSize = (int) (typedArray.getDimension(R.styleable.ProgressLayout_emptyContentTextSize, emptyStateContentTextSize) / scaleRatio); emptyStateContentTextColor = typedArray.getColor(R.styleable.ProgressLayout_emptyContentTextColor, ContextCompat.getColor(getContext(), R.color.grey)); emptyStateBackgroundColor = typedArray.getColor(R.styleable.ProgressLayout_emptyBackgroundColor, Color.TRANSPARENT); errorStateContentTextSize = (int) (typedArray.getDimension(R.styleable.ProgressLayout_errorContentTextSize, errorStateContentTextSize) / scaleRatio); errorStateButtonTextSize = (int) (typedArray.getDimension(R.styleable.ProgressLayout_errorButtonTextSize, errorStateButtonTextSize) / scaleRatio); errorStateContentTextColor = typedArray.getColor(R.styleable.ProgressLayout_errorContentTextColor, ContextCompat.getColor(getContext(), R.color.grey)); errorStateButtonTextColor = typedArray.getColor(R.styleable.ProgressLayout_errorButtonTextColor, ContextCompat.getColor(getContext(), R.color.teal)); errorStateBackgroundColor = typedArray.getColor(R.styleable.ProgressLayout_errorBackgroundColor, Color.TRANSPARENT);