mirror of
https://framagit.org/tom79/nitterizeme
synced 2025-01-25 13:38:43 +01:00
Some fixes
This commit is contained in:
parent
800a1e4316
commit
f57b7ef5a3
@ -31,7 +31,6 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@ -41,7 +40,6 @@ import app.fedilab.nitterizeme.entities.Instance;
|
||||
import app.fedilab.nitterizeme.viewmodels.SearchInstanceVM;
|
||||
|
||||
|
||||
|
||||
public class InstanceActivity extends AppCompatActivity {
|
||||
|
||||
private static String list_for_instances = "https://framagit.org/tom79/fedilab_app/-/blob/master/content/untrackme_instances/payload_2.json";
|
||||
@ -70,12 +68,12 @@ public class InstanceActivity extends AppCompatActivity {
|
||||
ArrayList<Instance> invidiousInstances = new ArrayList<>();
|
||||
ArrayList<Instance> nitterInstances = new ArrayList<>();
|
||||
ArrayList<Instance> bibliogramInstances = new ArrayList<>();
|
||||
for(Instance instance: result){
|
||||
if(instance.getType() == Instance.instanceType.INVIDIOUS){
|
||||
for (Instance instance : result) {
|
||||
if (instance.getType() == Instance.instanceType.INVIDIOUS) {
|
||||
invidiousInstances.add(instance);
|
||||
}else if(instance.getType() == Instance.instanceType.NITTER){
|
||||
} else if (instance.getType() == Instance.instanceType.NITTER) {
|
||||
nitterInstances.add(instance);
|
||||
}else if(instance.getType() == Instance.instanceType.BIBLIOGRAM){
|
||||
} else if (instance.getType() == Instance.instanceType.BIBLIOGRAM) {
|
||||
bibliogramInstances.add(instance);
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
public static final String SET_INVIDIOUS_HOST = "set_invidious_host";
|
||||
public static final String SET_OSM_HOST = "set_osm_host";
|
||||
public static final String SET_BIBLIOGRAM_HOST = "set_bibliogram_host";
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public static String TAG = "UntrackMe";
|
||||
public static String DEFAULT_NITTER_HOST = "nitter.net";
|
||||
public static String DEFAULT_INVIDIOUS_HOST = "invidious.snopyta.org";
|
||||
|
@ -217,6 +217,7 @@ public class Utils {
|
||||
String newUrl = null;
|
||||
URL url_;
|
||||
String host = null;
|
||||
url = Utils.remove_tracking_param(url);
|
||||
try {
|
||||
url_ = new URL(url);
|
||||
host = url_.getHost();
|
||||
|
@ -13,6 +13,7 @@ package app.fedilab.nitterizeme.viewmodels;
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with UntrackMe; if not,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
@ -85,7 +86,7 @@ public class SearchInstanceVM extends ViewModel {
|
||||
String defaultNitter = sharedpreferences.getString(SET_NITTER_HOST, DEFAULT_NITTER_HOST);
|
||||
String defaultBibliogram = sharedpreferences.getString(SET_BIBLIOGRAM_HOST, DEFAULT_BIBLIOGRAM_HOST);
|
||||
ArrayList<Instance> instances = new ArrayList<>();
|
||||
if( response != null) {
|
||||
if (response != null) {
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(response);
|
||||
JSONArray jsonArrayInvidious = jsonObject.getJSONArray("invidious");
|
||||
|
Loading…
x
Reference in New Issue
Block a user