Code Monkey home page Code Monkey logo

Comments (7)

 avatar commented on July 28, 2024

solved it adding more padding to the bottom

TextViewEx.java:81
super.setPadding(left+10, top, right+10, bottom+80);

EDIT:
Not solved, on bigger texts the problem returns... andy ideas?

from textjustify-android.

jribal avatar jribal commented on July 28, 2024

+80 use real pixels, you have to use dp to be screen independant.

DisplayMetrics metrics = getContext().getResources().getDisplayMetrics();
super.setPadding((int)((left+(metrics.density * 10))), top, (int)(right+(metrics.density * 10)), (int) (bottom+(metrics.density * 40)));

from textjustify-android.

ralf89 avatar ralf89 commented on July 28, 2024

Android match_parent doesn't actually realize that justified text occupies more height then regular text so the content is wrapped according to regular text alignment. Is there a way to tell android that the wrap content has to be made with the justified text method?

I solved it giving an actual layout_height that covers the entire justified text height but I wanted to know if it is the only solution or is it possible to tell the match_parent the actual text height putting some more code in the TextViewEx ?

from textjustify-android.

praveen-kanwar avatar praveen-kanwar commented on July 28, 2024

All You Can Do Is while setting text textViewEx.setMinLines(value); And Value Can Be Calculated Through (yourText.length()/30) considering one line contain on average 30 characters.

from textjustify-android.

praveen-kanwar avatar praveen-kanwar commented on July 28, 2024

Another Tweak Inside Your XML Put android:lineSpacingMultiplier="1.2" And Inside Your Extended TextView there is a temporary fix comment verticalOffset = horizontalFontOffset = getLineHeight(); at this line Put There verticalOffset = horizontalFontOffset = getLineHeight() - 8;

from textjustify-android.

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

Refer to the experimental version posted on README.md

from textjustify-android.

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

Refer to updated version. It has been fixed along with major optimizations.

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.