jamesnguyenhub / mkloader

Beautiful and smooth custom loading views
Apache License 2.0
1.38k stars 166 forks source link

onMeasure implementation is wrong #14

Open kagile opened 5 years ago

kagile commented 5 years ago

The below implementation of onMeasure is showing wrong height and width in <= 5.0 devices.

 @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        final int measuredWidth = resolveSize(loaderView.getDesiredWidth(), widthMeasureSpec);
        final int measuredHeight = resolveSize(loaderView.getDesiredHeight(), heightMeasureSpec);
        setMeasuredDimension(measuredWidth, measuredHeight);
    }