Skip to content

Commit

Permalink
Links now work with HtmlCompat library.
Browse files Browse the repository at this point in the history
  • Loading branch information
GrenderG committed Apr 5, 2017
1 parent e62d175 commit 20904db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "com.appmatic.baseapp"
minSdkVersion 15
targetSdkVersion 25
versionCode 923
versionName "0.9.2.3"
versionCode 924
versionName "0.9.2.4"
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import android.support.v4.content.ContextCompat;
import android.support.v4.view.GravityCompat;
import android.text.method.LinkMovementMethod;
import android.text.util.Linkify;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
Expand Down Expand Up @@ -94,11 +93,10 @@ else if (isLastView)
break;
case Content.TYPE_TEXT:
newView = new TextView(context);
((TextView) newView).setMovementMethod(LinkMovementMethod.getInstance());
((TextView) newView).setText(HtmlCompat.fromHtml(context, content.getContent().replace("\n", "<br><br>").replace("</p>", "").replace("<p>", ""), 0));
((TextView) newView).setTextSize(TypedValue.COMPLEX_UNIT_SP, 16.0f);
((TextView) newView).setTextColor(ContextCompat.getColor(context, R.color.mainTextColor));
((TextView) newView).setAutoLinkMask(Linkify.ALL);
((TextView) newView).setMovementMethod(LinkMovementMethod.getInstance());
newView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));

if (isFirstView)
Expand Down

0 comments on commit 20904db

Please sign in to comment.