Code Monkey home page Code Monkey logo

Comments (8)

mathew-kurian avatar mathew-kurian commented on July 28, 2024

I'm sorry for late reply. Are you setting the text outside of the ui thread?

from textjustify-android.

muriloandrade avatar muriloandrade commented on July 28, 2024

Hi.
No, I'm working only on the main thread. Seems like the iterator.add() at line 379 conflicts with unitIterator.next() at line 222.

from textjustify-android.

mathew-kurian avatar mathew-kurian commented on July 28, 2024

Can you provide your code that loads the data into textview? Thanks. I'll look at this tonight.

from textjustify-android.

muriloandrade avatar muriloandrade commented on July 28, 2024

Actually I made it very simple for testing purpose.

    documentView = (DocumentView) findViewById(R.id.documentView);
    documentView.getDocumentLayoutParams().setTextAlignment(TextAlignment.JUSTIFIED);
    documentView.getDocumentLayoutParams().setHyphenator(new Hyphenator(HyphenPattern.PT));
    documentView.getDocumentLayoutParams().setHyphenated(true);
    documentView.setText(getString(R.string.mancini), true);

And the string resource:
<string name="mancini">Vágner Mancini hoje é um sujeito tão angustiado quanto otimista, por mais que pareça uma contradição. O técnico do Botafogo tem a difícil missão de salvar o time do rebaixamento no Campeonato Brasileiro, apesar de todas as dificuldades que o próprio clube impõe a seu trabalho - salários atrasados, afastamento de jogadores importantes, dívidas que ameaçam até as poucas chances que ainda existem de permanência na Série A em 2015. Na manhã desta segunda-feira, Mancini falou ao blog.</string>

from textjustify-android.

mathew-kurian avatar mathew-kurian commented on July 28, 2024

@muriloandrade Good find. I have fixed the bug in the latest push. I have added a test to the sample app as well.

EDIT. Bugs persist. Let me fix.

from textjustify-android.

mathew-kurian avatar mathew-kurian commented on July 28, 2024

@muriloandrade Fixed

from textjustify-android.

muriloandrade avatar muriloandrade commented on July 28, 2024

Thank you for the fix.
But now I'm getting the text justified but not hyphenated.
I may be missing a step, so, no rush, but can you provide me an example on how to use?
Thank you again.

from textjustify-android.

mathew-kurian avatar mathew-kurian commented on July 28, 2024

@muriloandrade It does hyphenate. I have put your exact code into the the sample demo which you can download at https://play.google.com/store/apps/details?id=com.bluejamesbond.text.sample

Just click on the "Hyphenated Test"

from textjustify-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.