InflationX / Calligraphy

Custom fonts in Android the easy way...
Apache License 2.0
1.09k stars 83 forks source link

CalligraphyConfig().Builder issue #56

Closed newMobileStar closed 3 years ago

newMobileStar commented 3 years ago

Hello,

I am upgrading to Calligraphy because my android app is crashing for android 10 and it was related to this library.

I added the two lines for the updated Calligraphy and Viewpump library. and Gradle sync succeeds.

when I add the below code in MyApplication.java,

ViewPump.init(ViewPump.builder()
                .addInterceptor(new CalligraphyInterceptor(
                        new CalligraphyConfig().Builder()
                                .setDefaultFontPath("fonts/HelveticaNeueLTStd_R.otf")
                                .setFontAttrId(R.attr.fontPath)
                                .build()))
                .build());

I get this error:

CalligraphyConfig(io.github.inflationx.calligraphy3.CalligraphyConfig.Builder)' has private access in 'io.github.inflationx.calligraphy3.CalligraphyConfig

How can we config the default font? and what I am doing wrong?

Please help asap! Our App live is keeping a crash from this issue.

Screen Shot 2020-10-01 at 2 29 06 PM

muthukrishnan-suresh commented 3 years ago

@newMobileStar try

new CalligraphyConfig.Builder()
                    .setDefaultFontPath("fonts/Roboto-RobotoRegular.ttf")
                    .setFontAttrId(R.attr.fontPath)
                    .build()))