diff --git a/app/src/main/java/org/schabi/newpipe/settings/services/instances/UrlMultiInstanceTypeCreator.java b/app/src/main/java/org/schabi/newpipe/settings/services/instances/UrlMultiInstanceTypeCreator.java index ba2fd23c798..2109656f46e 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/services/instances/UrlMultiInstanceTypeCreator.java +++ b/app/src/main/java/org/schabi/newpipe/settings/services/instances/UrlMultiInstanceTypeCreator.java @@ -2,6 +2,7 @@ import android.content.Context; import android.view.LayoutInflater; +import android.view.View; import android.widget.Toast; import androidx.annotation.NonNull; @@ -22,19 +23,28 @@ public class UrlMultiInstanceTypeCreator extends AbstractInstanceTypeCreator { protected final Function createNewInstanceFromUrl; + /** + * The (official) list of available instances + */ @StringRes protected final int instanceListUrl; + /** + * true if the service is free and open source software + */ + protected final boolean isFoss; public UrlMultiInstanceTypeCreator( final String instanceServiceName, final int icon, final Class createdClass, final Function createNewInstanceFromUrl, - final int instanceListUrl + final int instanceListUrl, + final boolean isFoss ) { super(instanceServiceName, icon, createdClass); this.createNewInstanceFromUrl = createNewInstanceFromUrl; this.instanceListUrl = instanceListUrl; + this.isFoss = isFoss; } @Override @@ -59,6 +69,7 @@ void showAddInstanceUrlDialog( c.getString( R.string.publicly_available_instances_help, c.getString(instanceListUrl))); + dialogBinding.fossNoticeContainer.setVisibility(isFoss ? View.VISIBLE : View.GONE); new AlertDialog.Builder(c) .setTitle(c.getString(R.string.add_instance, instanceServiceName())) diff --git a/app/src/main/java/org/schabi/newpipe/settings/services/instances/peertube/PeertubeInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/services/instances/peertube/PeertubeInstanceListFragment.java index 42f1ff95f9c..2740b4137d3 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/services/instances/peertube/PeertubeInstanceListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/services/instances/peertube/PeertubeInstanceListFragment.java @@ -26,7 +26,8 @@ public PeerTubeInstanceTypeCreator() { R.drawable.ic_placeholder_peertube, PeertubeInstance.class, PeertubeInstance::new, - R.string.peertube_instance_list_url); + R.string.peertube_instance_list_url, + true); } } } diff --git a/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java index 006b1703036..8820d7cd60b 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java @@ -66,7 +66,8 @@ public InvidiousInstanceTypeCreator() { R.drawable.ic_placeholder_invidious, InvidiousInstance.class, InvidiousInstance::new, - R.string.invidious_instance_list_url); + R.string.invidious_instance_list_url, + true); } } } diff --git a/app/src/main/res/layout/dialog_add_instance.xml b/app/src/main/res/layout/dialog_add_instance.xml index 2417723903f..384156a5a38 100644 --- a/app/src/main/res/layout/dialog_add_instance.xml +++ b/app/src/main/res/layout/dialog_add_instance.xml @@ -9,7 +9,7 @@ + tools:text="@string/publicly_available_instances_help" /> + + + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7e319e80fd1..41a854a9f7e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -135,6 +135,7 @@ A list of publicly available instances can be found on %s Add %s instance Enter instance URL + This service is provided by free and open-source software. Consider donating to the maintainers and developers or feel free to host your own instance. Could not validate instance Instance already exists Communication via HTTP is insecure. Consider using HTTPS instead