Skip to content

Support stroke width in API or have better internals to support Kotlin #83

Description

@Tolriq

Currently the library does not support stroke width and you said you do not want to implement it. (#61)

The problem is that the current code is filled with protected / private constructors and prevent expanding the library from Kotlin to implement this.

In Java it's relatively simple to achieve, in Kotlin we need to copy and convert 90% of the code :(

To see the issue just convert:

package me.zhanghai.android.materialprogressbar;

import android.graphics.Paint;

public class SingleCircularProgressDrawable2dp extends SingleCircularProgressDrawable {

    SingleCircularProgressDrawable2dp(int style) {
        super(style);
        setShowBackground(false);
    }

    @Override
    protected void onPreparePaint(Paint paint) {
        super.onPreparePaint(paint);
        paint.setStrokeWidth(2);
    }
}

to kotlin and see all the errors about package private / protected :(

This is not cool to have to maintain java code in a full kotlin project just for this use case :(

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions