Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.InputType;
import android.text.method.LinkMovementMethod;

import androidx.core.text.HtmlCompat;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
Expand Down Expand Up @@ -84,8 +87,13 @@ public void onViewCreated(@NonNull final View rootView,
@Nullable final Bundle savedInstanceState) {
super.onViewCreated(rootView, savedInstanceState);

binding.instanceHelpTV.setText(getString(R.string.peertube_instance_url_help,
getString(R.string.peertube_instance_list_url)));
final String instanceListUrl = getString(R.string.peertube_instance_list_url);
final String helpText = getString(R.string.peertube_instance_url_help,
"<a href=\"" + instanceListUrl + "\">" + instanceListUrl + "</a>");
binding.instanceHelpTV.setText(HtmlCompat.fromHtml(helpText,
HtmlCompat.FROM_HTML_MODE_LEGACY));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one question, why legacy and not compat?

binding.instanceHelpTV.setMovementMethod(LinkMovementMethod.getInstance());
Copy link
Member

@AudricV AudricV Jan 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that if we use this way, if you set NewPipe as default app of one of the PeerTube instances registered in the Android manifest and if the app is able to open base instance URLs in the future, they will open in NewPipe, which is not what we want.

A better approach would be to use a custom LinkMovementMethod, similar to what's done in the text linkifier app classes, which would call ShareUtils.openInBrowser.

Also, sorry if you didn't do so, did you use AI to generate this PR description, while that's forbidden? Its tone seems that's the case to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your review !
I'll implement the better approach in the next few days

did you use AI to generate this PR description,

I did , my apologies if it's forbidden. I just tried to save a couple of minutes on writing the description, cause the change is trivial in my opinion, so I just clicked a copilot button to generate the description automatically.
I'm gonna rewrite it soon as well 🙏


binding.addInstanceButton.setOnClickListener(v -> showAddItemDialog(requireContext()));
binding.instances.setLayoutManager(new LinearLayoutManager(requireContext()));

Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/fragment_instance_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:autoLink="web"
android:text="@string/peertube_instance_url_help" />

<androidx.recyclerview.widget.RecyclerView
Expand Down