0 Replies - 474 Views - Last Post: 08 June 2017 - 06:03 AM

#1 newJavaCoder  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 82
  • Joined: 15-March 15

Customer Progress Bar not showing the progress....

Posted 08 June 2017 - 06:03 AM

I could use help as I have been battling this for a LONG time now.

    @Override
    protected synchronized void onDraw(Canvas canvas) {
        canvas.save();
        canvas.translate(0, getHeight() / 2);

        float radio = getProgress() * 1.0f / getMax();
        float progressPosX = (int) (mRealWidth * radio);

        float radius = mReachedProgressBarHeight / 2;

        // draw the progress
        float endX = progressPosX;
        if (endX > -1) {
            mPaint.setColor(mReachedBarColor);
            RectF rectF = new RectF(0,  (float)20, endX, (float)20);
            canvas.drawRoundRect(rectF, 50, 50, mPaint);
        }

        if (mIfDrawCircle) {
            mPaint.setColor(mCircleColor);
            canvas.drawCircle(progressPosX - 40, 0, (float) (radius/1.7), mPaint);
        }
        canvas.restore();

    }



Right now, the progress bar doesnt display the progress. It will only display the circle
http://imgur.com/cKuWviJ

This might be hard to see show here is the dark version of the widget.
http://imgur.com/wdGm0By

This is in my XML
                <com.xxx.LegacyProgressBar
                    android:id="@+id/progress"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:progress_circle_color="#ffffff"
                    app:progress_reached_bar_height="10dp"
                    app:progress_reached_color="@color/blue" <---- THIS IS NOT BEING DISPLAYED
                    app:progress_text_size="14sp"
                    app:progress_unreached_bar_height="10dp"
                    android:visibility="visible"/>



If there is anything else I could paste in here that might help, please let me know.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1