33import static android .text .TextUtils .isEmpty ;
44import static org .schabi .newpipe .extractor .stream .StreamExtractor .NO_AGE_LIMIT ;
55import static org .schabi .newpipe .extractor .utils .Utils .isBlank ;
6+ import static org .schabi .newpipe .util .Localization .getAppLocale ;
67
78import android .os .Bundle ;
89import android .view .LayoutInflater ;
2829import org .schabi .newpipe .util .Localization ;
2930import org .schabi .newpipe .util .NavigationHelper ;
3031import org .schabi .newpipe .util .external_communication .ShareUtils ;
31- import org .schabi .newpipe .util .external_communication .TextLinkifier ;
32+ import org .schabi .newpipe .util .text .TextLinkifier ;
3233
3334import icepick .State ;
3435import io .reactivex .rxjava3 .disposables .CompositeDisposable ;
@@ -134,7 +135,8 @@ private void loadDescriptionContent() {
134135 TextLinkifier .createLinksFromMarkdownText (binding .detailDescriptionView ,
135136 description .getContent (), streamInfo , descriptionDisposables );
136137 break ;
137- case Description .PLAIN_TEXT : default :
138+ case Description .PLAIN_TEXT :
139+ default :
138140 TextLinkifier .createLinksFromPlainText (binding .detailDescriptionView ,
139141 description .getContent (), streamInfo , descriptionDisposables );
140142 break ;
@@ -144,30 +146,30 @@ private void loadDescriptionContent() {
144146
145147 private void setupMetadata (final LayoutInflater inflater ,
146148 final LinearLayout layout ) {
147- addMetadataItem (inflater , layout , false ,
148- R . string . metadata_category , streamInfo .getCategory ());
149+ addMetadataItem (inflater , layout , false , R . string . metadata_category ,
150+ streamInfo .getCategory ());
149151
150- addMetadataItem (inflater , layout , false ,
151- R . string . metadata_licence , streamInfo .getLicence ());
152+ addMetadataItem (inflater , layout , false , R . string . metadata_licence ,
153+ streamInfo .getLicence ());
152154
153155 addPrivacyMetadataItem (inflater , layout );
154156
155157 if (streamInfo .getAgeLimit () != NO_AGE_LIMIT ) {
156- addMetadataItem (inflater , layout , false ,
157- R . string . metadata_age_limit , String .valueOf (streamInfo .getAgeLimit ()));
158+ addMetadataItem (inflater , layout , false , R . string . metadata_age_limit ,
159+ String .valueOf (streamInfo .getAgeLimit ()));
158160 }
159161
160162 if (streamInfo .getLanguageInfo () != null ) {
161- addMetadataItem (inflater , layout , false ,
162- R . string . metadata_language , streamInfo .getLanguageInfo ().getDisplayLanguage ());
163+ addMetadataItem (inflater , layout , false , R . string . metadata_language ,
164+ streamInfo .getLanguageInfo ().getDisplayLanguage (getAppLocale ( getContext ()) ));
163165 }
164166
165- addMetadataItem (inflater , layout , true ,
166- R . string . metadata_support , streamInfo .getSupportInfo ());
167- addMetadataItem (inflater , layout , true ,
168- R . string . metadata_host , streamInfo .getHost ());
169- addMetadataItem (inflater , layout , true ,
170- R . string . metadata_thumbnail_url , streamInfo .getThumbnailUrl ());
167+ addMetadataItem (inflater , layout , true , R . string . metadata_support ,
168+ streamInfo .getSupportInfo ());
169+ addMetadataItem (inflater , layout , true , R . string . metadata_host ,
170+ streamInfo .getHost ());
171+ addMetadataItem (inflater , layout , true , R . string . metadata_thumbnail_url ,
172+ streamInfo .getThumbnailUrl ());
171173
172174 addTagsMetadataItem (inflater , layout );
173175 }
@@ -191,12 +193,14 @@ private void addMetadataItem(final LayoutInflater inflater,
191193 });
192194
193195 if (linkifyContent ) {
194- TextLinkifier .createLinksFromPlainText (itemBinding .metadataContentView , content , null ,
195- descriptionDisposables );
196+ TextLinkifier .createLinksFromPlainText (itemBinding .metadataContentView , content ,
197+ null , descriptionDisposables );
196198 } else {
197199 itemBinding .metadataContentView .setText (content );
198200 }
199201
202+ itemBinding .metadataContentView .setClickable (true );
203+
200204 layout .addView (itemBinding .getRoot ());
201205 }
202206
@@ -245,14 +249,15 @@ private void addPrivacyMetadataItem(final LayoutInflater inflater, final LinearL
245249 case INTERNAL :
246250 contentRes = R .string .metadata_privacy_internal ;
247251 break ;
248- case OTHER : default :
252+ case OTHER :
253+ default :
249254 contentRes = 0 ;
250255 break ;
251256 }
252257
253258 if (contentRes != 0 ) {
254- addMetadataItem (inflater , layout , false ,
255- R . string . metadata_privacy , getString (contentRes ));
259+ addMetadataItem (inflater , layout , false , R . string . metadata_privacy ,
260+ getString (contentRes ));
256261 }
257262 }
258263 }
0 commit comments