44import static org .schabi .newpipe .extractor .stream .StreamExtractor .NO_AGE_LIMIT ;
55import static org .schabi .newpipe .extractor .utils .Utils .isBlank ;
66import static org .schabi .newpipe .util .Localization .getAppLocale ;
7+ import static org .schabi .newpipe .util .text .TextLinkifier .SET_LINK_MOVEMENT_METHOD ;
78
89import android .os .Bundle ;
910import android .view .LayoutInflater ;
@@ -112,7 +113,10 @@ private void enableDescriptionSelection() {
112113
113114 private void disableDescriptionSelection () {
114115 // show description content again, otherwise some links are not clickable
115- loadDescriptionContent ();
116+ TextLinkifier .fromDescription (binding .detailDescriptionView ,
117+ streamInfo .getDescription (), HtmlCompat .FROM_HTML_MODE_LEGACY ,
118+ streamInfo .getService (), streamInfo .getUrl (),
119+ descriptionDisposables , SET_LINK_MOVEMENT_METHOD );
116120
117121 binding .detailDescriptionNoteView .setVisibility (View .GONE );
118122 binding .detailDescriptionView .setTextIsSelectable (false );
@@ -123,27 +127,6 @@ private void disableDescriptionSelection() {
123127 binding .detailSelectDescriptionButton .setImageResource (R .drawable .ic_select_all );
124128 }
125129
126- private void loadDescriptionContent () {
127- final Description description = streamInfo .getDescription ();
128- switch (description .getType ()) {
129- case Description .HTML :
130- TextLinkifier .createLinksFromHtmlBlock (binding .detailDescriptionView ,
131- description .getContent (), HtmlCompat .FROM_HTML_MODE_LEGACY , streamInfo ,
132- descriptionDisposables );
133- break ;
134- case Description .MARKDOWN :
135- TextLinkifier .createLinksFromMarkdownText (binding .detailDescriptionView ,
136- description .getContent (), streamInfo , descriptionDisposables );
137- break ;
138- case Description .PLAIN_TEXT :
139- default :
140- TextLinkifier .createLinksFromPlainText (binding .detailDescriptionView ,
141- description .getContent (), streamInfo , descriptionDisposables );
142- break ;
143- }
144- }
145-
146-
147130 private void setupMetadata (final LayoutInflater inflater ,
148131 final LinearLayout layout ) {
149132 addMetadataItem (inflater , layout , false , R .string .metadata_category ,
@@ -193,8 +176,8 @@ private void addMetadataItem(final LayoutInflater inflater,
193176 });
194177
195178 if (linkifyContent ) {
196- TextLinkifier .createLinksFromPlainText (itemBinding .metadataContentView , content ,
197- null , descriptionDisposables );
179+ TextLinkifier .fromPlainText (itemBinding .metadataContentView , content , null , null ,
180+ descriptionDisposables , SET_LINK_MOVEMENT_METHOD );
198181 } else {
199182 itemBinding .metadataContentView .setText (content );
200183 }
0 commit comments