Do not ellipsize description on Android 2.X

For some reason, even when showing the entire description some words at
the end of lines and paragraphs still get cut off. This results in
little parts of the description being completely inaccessible.

Ellipsizing is just cosmetic, so ditch it on 2.X altogether. I tested
and proved that this fixes the issue with an android-10 x86 emulator,
after reproducing the bug.

Keep the ellipsizing on newer versions, as it doesn't misbehave on
those.

Fixes #510.
This commit is contained in:
Daniel Martí 2016-05-05 11:53:20 +01:00
parent 6ce94a22d3
commit 1192468015

View File

@ -33,6 +33,7 @@ import android.content.pm.PackageManager;
import android.database.ContentObserver;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
@ -1112,7 +1113,10 @@ public class AppDetails extends AppCompatActivity {
viewMorePermissions.setText(getString(R.string.less));
} else {
description.setMaxLines(MAX_LINES);
if (Build.VERSION.SDK_INT > 10) {
// ellipsizing doesn't work properly here on 2.X
description.setEllipsize(TextUtils.TruncateAt.MARQUEE);
}
viewMorePermissions.setText(R.string.more);
}
viewAllDescription ^= true;
@ -1133,7 +1137,10 @@ public class AppDetails extends AppCompatActivity {
// If description has more than five lines
if (description.getLineCount() > MAX_LINES) {
description.setMaxLines(MAX_LINES);
if (Build.VERSION.SDK_INT > 10) {
// ellipsizing doesn't work properly here on 2.X
description.setEllipsize(TextUtils.TruncateAt.MARQUEE);
}
description.setOnClickListener(expanderDescription);
viewAllDescription = true;