suwhs / wATLlib

standalone wATL library
22 stars 2 forks source link

setTypeface () don't working #5

Closed ointeractive-depot closed 6 years ago

ointeractive-depot commented 6 years ago

Thanks a lot fo this great library, but seems that MultiColumnTextViewEx setTypeface () don't working, I've tried layout.setTypeface (Typeface.create ("sans-serif", Typeface.NORMAL));, textView.setTypeface (Typeface.createFromAsset (context.getAssets (), "fonts/MyFont.ttf")); etc. with no luck.

suwhs commented 6 years ago

quick fix: use TypefaceSpan, if possible

nb: last release available https://bintray.com/suwhs/maven/wATLlib/1.4.5b - github not sycnronized yet, sorry

ointeractive-depot commented 6 years ago

Wow, thanks for quick response! So many versions was released this time) Do you provide a changelog& It'll be so interesting to see what was changed since 1.2.3 for example or lower.

Well yes, it's possible, but I hoped to use a setTypeface () because I thought that it extends a native TextView, it's more preferably than using spans.

suwhs commented 6 years ago

Do you provide a changelog

just bugfixes - crashes, incorrect rendering in some cases, etc.

because I thought that it extends a native TextView, it's more preferably than using spans.

ok,asap.

ointeractive-depot commented 6 years ago

Ah, okay)

I don't want to create other issues, so I can write it there. Another problem is that pages numbers are became zero while we scroll page more than three in updateInfo () method of ITextPagesNumber class, for example, while we flip three pages in ViewPager, it incrementing, but on the next pages it become zero and starting to increase again.

ointeractive-depot commented 6 years ago

Wow, that's so nice to see a setTypeface () implementation if it'll be possible...

suwhs commented 6 years ago

testing: setTypeface(...) works as expected for TextViewEx, MulticolumnTextViewEx, etc

and not working for pages with BaseTextViewPager

  1. 'simple textview-derived views' case - we use TextView getPaint() instance - here no problem, getPaint() used for TextLayout instance construct

  2. 'pager' case - we construct shared TextPaint, so setTypeface(), and other TextPaint-related calls with TextView.* will not works

solution: mew method added to BaseTextPagerAdapter: setTypeface(...)

wATLlib version: 1.4.6a