Previously, I asked a question titled: "How to paginate text in Android" on stackoverflow, which lead to a great answer that helped me so much. Now I need to port the code on the older Android API, and in case, Android API version 8, so I can run my application on mostly all Android devices, starting from Android 2.2.
The problem I come across is that some methods used in the answer are only available in Android API 16+.
mPagination = new Pagination(mText,
mTextView.getWidth(),
mTextView.getHeight(),
mTextView.getPaint(),
mTextView.getLineSpacingMultiplier(),
mTextView.getLineSpacingExtra(),
mTextView.getIncludeFontPadding());
So, I have to implement at least these methods:
TextView.getLineSpacingMultiplier()
TextView.getLineSpacingExtra()
TextView.getIncludeFontPadding()
The second one seems to be already described here as:
mTextView.getPaint().getFontSpacing()
* mTextView.getLineSpacingMultiplier() + mTextView.getLineSpacingExtra()
But I don't know if the other two are relevant in 2.2, and if they are, how to implement them in Android API version 8. There is some hint here, using the source code of Android TextView
which I could not fully understand.