CLean code + last improvements
This commit is contained in:
parent
b9e8d6b01b
commit
810098d40b
|
@ -1,4 +1,5 @@
|
|||
package app.fedilab.nitterizeme;
|
||||
|
||||
/* Copyright 2020 Thomas Schneider
|
||||
*
|
||||
* This file is a part of NitterizeMe
|
||||
|
@ -15,11 +16,6 @@ package app.fedilab.nitterizeme;
|
|||
* see <http://www.gnu.org/licenses>. */
|
||||
class Instance {
|
||||
|
||||
enum instanceType{
|
||||
INVIDIOUS,
|
||||
NITTER,
|
||||
BIBLIOGRAM
|
||||
}
|
||||
private String domain;
|
||||
private long latency = -1;
|
||||
private boolean checked = false;
|
||||
|
@ -56,4 +52,10 @@ class Instance {
|
|||
void setType(instanceType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
enum instanceType {
|
||||
INVIDIOUS,
|
||||
NITTER,
|
||||
BIBLIOGRAM
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
@ -60,11 +59,11 @@ public class InstanceActivity extends AppCompatActivity {
|
|||
}
|
||||
|
||||
|
||||
static class SearchInstances extends AsyncTask<Void, Void, String>{
|
||||
static class SearchInstances extends AsyncTask<Void, Void, String> {
|
||||
|
||||
private WeakReference<Activity> activityWeakReference;
|
||||
|
||||
SearchInstances(Activity activity){
|
||||
SearchInstances(Activity activity) {
|
||||
activityWeakReference = new WeakReference<>(activity);
|
||||
}
|
||||
|
||||
|
@ -103,8 +102,8 @@ public class InstanceActivity extends AppCompatActivity {
|
|||
RecyclerView invidious_instances = activity.findViewById(R.id.invidious_instances);
|
||||
RecyclerView nitter_instances = activity.findViewById(R.id.nitter_instances);
|
||||
RecyclerView bibliogram_instances = activity.findViewById(R.id.bibliogram_instances);
|
||||
Button latency_test = activity.findViewById(R.id.latency_test);
|
||||
Button close = activity.findViewById(R.id.close);
|
||||
Button latency_test = activity.findViewById(R.id.latency_test);
|
||||
Button close = activity.findViewById(R.id.close);
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(result);
|
||||
JSONArray jsonArrayInvidious = jsonObject.getJSONArray("invidious");
|
||||
|
@ -117,30 +116,30 @@ public class InstanceActivity extends AppCompatActivity {
|
|||
String defaultBibliogram = sharedpreferences.getString(SET_BIBLIOGRAM_HOST, DEFAULT_BIBLIOGRAM_HOST);
|
||||
|
||||
List<Instance> invidiousInstances = new ArrayList<>();
|
||||
for(int i = 0; i < jsonArrayInvidious.length(); i++){
|
||||
for (int i = 0; i < jsonArrayInvidious.length(); i++) {
|
||||
Instance instance = new Instance();
|
||||
instance.setDomain(jsonArrayInvidious.getString(i));
|
||||
if( instance.getDomain().compareTo(defaultInvidious) == 0 ){
|
||||
if (instance.getDomain().compareTo(defaultInvidious) == 0) {
|
||||
instance.setChecked(true);
|
||||
}
|
||||
instance.setType(Instance.instanceType.INVIDIOUS);
|
||||
invidiousInstances.add(instance);
|
||||
}
|
||||
List<Instance> nitterInstances = new ArrayList<>();
|
||||
for(int i = 0; i < jsonArrayNitter.length(); i++){
|
||||
for (int i = 0; i < jsonArrayNitter.length(); i++) {
|
||||
Instance instance = new Instance();
|
||||
instance.setDomain(jsonArrayNitter.getString(i));
|
||||
if( instance.getDomain().compareTo(defaultNitter) == 0 ){
|
||||
if (instance.getDomain().compareTo(defaultNitter) == 0) {
|
||||
instance.setChecked(true);
|
||||
}
|
||||
instance.setType(Instance.instanceType.NITTER);
|
||||
nitterInstances.add(instance);
|
||||
}
|
||||
List<Instance> bibliogramInstances = new ArrayList<>();
|
||||
for(int i = 0; i < jsonArrayBibliogram.length(); i++){
|
||||
for (int i = 0; i < jsonArrayBibliogram.length(); i++) {
|
||||
Instance instance = new Instance();
|
||||
instance.setDomain(jsonArrayBibliogram.getString(i));
|
||||
if( instance.getDomain().compareTo(defaultBibliogram) == 0 ){
|
||||
if (instance.getDomain().compareTo(defaultBibliogram) == 0) {
|
||||
instance.setChecked(true);
|
||||
}
|
||||
instance.setType(Instance.instanceType.BIBLIOGRAM);
|
||||
|
@ -163,7 +162,7 @@ public class InstanceActivity extends AppCompatActivity {
|
|||
bibliogram_instances.setLayoutManager(bLayoutManager);
|
||||
|
||||
latency_test.setOnClickListener(
|
||||
v-> {
|
||||
v -> {
|
||||
invidiousAdapter.evalLatency();
|
||||
nitterAdapter.evalLatency();
|
||||
bibliogramAdapter.evalLatency();
|
||||
|
@ -174,8 +173,7 @@ public class InstanceActivity extends AppCompatActivity {
|
|||
e.printStackTrace();
|
||||
}
|
||||
|
||||
close.setOnClickListener(v-> activity.finish());
|
||||
|
||||
close.setOnClickListener(v -> activity.finish());
|
||||
|
||||
|
||||
instance_container.setVisibility(View.VISIBLE);
|
||||
|
|
|
@ -72,18 +72,18 @@ public class InstanceAdapter extends RecyclerView.Adapter {
|
|||
|
||||
|
||||
holder.checkbox_instance.setText(instance.getDomain());
|
||||
if (instance.getLatency() == -1){
|
||||
if (instance.getLatency() == -1) {
|
||||
holder.latency.setVisibility(View.GONE);
|
||||
holder.progress.setVisibility(View.GONE);
|
||||
}else if(instance.getLatency() == 0 ){
|
||||
} else if (instance.getLatency() == 0) {
|
||||
holder.latency.setVisibility(View.GONE);
|
||||
holder.progress.setVisibility(View.VISIBLE);
|
||||
}else if(instance.getLatency() == -2 ){
|
||||
} else if (instance.getLatency() == -2) {
|
||||
holder.latency.setText(R.string.error);
|
||||
holder.latency.setVisibility(View.GONE);
|
||||
holder.progress.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
holder.latency.setText(String.format(Locale.getDefault(),"%d ms", instance.getLatency()));
|
||||
} else {
|
||||
holder.latency.setText(String.format(Locale.getDefault(), "%d ms", instance.getLatency()));
|
||||
holder.latency.setVisibility(View.VISIBLE);
|
||||
holder.progress.setVisibility(View.GONE);
|
||||
}
|
||||
|
@ -91,35 +91,35 @@ public class InstanceAdapter extends RecyclerView.Adapter {
|
|||
|
||||
holder.checkbox_instance.setChecked(instance.isChecked());
|
||||
|
||||
holder.checkbox_instance.setOnClickListener(v->{
|
||||
holder.checkbox_instance.setOnClickListener(v -> {
|
||||
|
||||
boolean isChecked = !instance.isChecked();
|
||||
for(Instance _ins: instances){
|
||||
for (Instance _ins : instances) {
|
||||
_ins.setChecked(false);
|
||||
}
|
||||
instance.setChecked(true);
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
switch (instance.getType()){
|
||||
switch (instance.getType()) {
|
||||
case INVIDIOUS:
|
||||
if( isChecked) {
|
||||
if (isChecked) {
|
||||
editor.putString(SET_INVIDIOUS_HOST, instance.getDomain().trim());
|
||||
}else{
|
||||
} else {
|
||||
editor.putString(SET_INVIDIOUS_HOST, null);
|
||||
}
|
||||
editor.apply();
|
||||
break;
|
||||
case NITTER:
|
||||
if( isChecked) {
|
||||
if (isChecked) {
|
||||
editor.putString(SET_NITTER_HOST, instance.getDomain().trim());
|
||||
}else{
|
||||
} else {
|
||||
editor.putString(SET_NITTER_HOST, null);
|
||||
}
|
||||
editor.apply();
|
||||
break;
|
||||
case BIBLIOGRAM:
|
||||
if( isChecked) {
|
||||
if (isChecked) {
|
||||
editor.putString(SET_BIBLIOGRAM_HOST, instance.getDomain().trim());
|
||||
}else{
|
||||
} else {
|
||||
editor.putString(SET_BIBLIOGRAM_HOST, null);
|
||||
}
|
||||
editor.apply();
|
||||
|
@ -131,8 +131,8 @@ public class InstanceAdapter extends RecyclerView.Adapter {
|
|||
|
||||
}
|
||||
|
||||
void evalLatency(){
|
||||
for(Instance instance: instances){
|
||||
void evalLatency() {
|
||||
for (Instance instance : instances) {
|
||||
instance.setLatency(0);
|
||||
Thread thread = new Thread() {
|
||||
@Override
|
||||
|
|
|
@ -127,6 +127,13 @@ public class MainActivity extends AppCompatActivity {
|
|||
TextInputEditText bibliogram_instance = findViewById(R.id.bibliogram_instance);
|
||||
TextInputEditText osm_instance = findViewById(R.id.osm_instance);
|
||||
|
||||
|
||||
TextInputLayout invidious_instance_container = findViewById(R.id.invidious_instance_container);
|
||||
TextInputLayout nitter_instance_container = findViewById(R.id.nitter_instance_container);
|
||||
TextInputLayout bibliogram_instance_container = findViewById(R.id.bibliogram_instance_container);
|
||||
TextInputLayout osm_instance_container = findViewById(R.id.osm_instance_container);
|
||||
|
||||
|
||||
SwitchCompat enable_nitter = findViewById(R.id.enable_nitter);
|
||||
SwitchCompat enable_invidious = findViewById(R.id.enable_invidious);
|
||||
SwitchCompat enable_bibliogram = findViewById(R.id.enable_bibliogram);
|
||||
|
@ -136,6 +143,7 @@ public class MainActivity extends AppCompatActivity {
|
|||
boolean invidious_enabled = sharedpreferences.getBoolean(SET_INVIDIOUS_ENABLED, true);
|
||||
boolean osm_enabled = sharedpreferences.getBoolean(SET_OSM_ENABLED, true);
|
||||
boolean bibliogram_enabled = sharedpreferences.getBoolean(SET_BIBLIOGRAM_ENABLED, true);
|
||||
boolean geouri_enabled = sharedpreferences.getBoolean(SET_GEO_URIS, false);
|
||||
|
||||
enable_nitter.setChecked(nitter_enabled);
|
||||
enable_invidious.setChecked(invidious_enabled);
|
||||
|
@ -150,30 +158,40 @@ public class MainActivity extends AppCompatActivity {
|
|||
String bibliogramHost = sharedpreferences.getString(SET_BIBLIOGRAM_HOST, null);
|
||||
String osmHost = sharedpreferences.getString(SET_OSM_HOST, null);
|
||||
|
||||
invidious_instance_container.setVisibility(invidious_enabled ? View.VISIBLE : View.GONE);
|
||||
nitter_instance_container.setVisibility(nitter_enabled ? View.VISIBLE : View.GONE);
|
||||
bibliogram_instance_container.setVisibility(bibliogram_enabled ? View.VISIBLE : View.GONE);
|
||||
osm_instance_container.setVisibility(osm_enabled ? View.VISIBLE : View.GONE);
|
||||
|
||||
enable_invidious.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
editor.putBoolean(SET_INVIDIOUS_ENABLED, isChecked);
|
||||
editor.apply();
|
||||
invidious_instance.setVisibility(isChecked?View.VISIBLE:View.GONE);
|
||||
invidious_instance_container.setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
});
|
||||
enable_nitter.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
editor.putBoolean(SET_NITTER_ENABLED, isChecked);
|
||||
editor.apply();
|
||||
nitter_instance.setVisibility(isChecked?View.VISIBLE:View.GONE);
|
||||
nitter_instance_container.setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
});
|
||||
enable_bibliogram.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
editor.putBoolean(SET_BIBLIOGRAM_ENABLED, isChecked);
|
||||
editor.apply();
|
||||
bibliogram_instance.setVisibility(isChecked?View.VISIBLE:View.GONE);
|
||||
bibliogram_instance_container.setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
});
|
||||
enable_osm.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
editor.putBoolean(SET_OSM_ENABLED, isChecked);
|
||||
editor.apply();
|
||||
osm_instance.setVisibility(isChecked?View.VISIBLE:View.GONE);
|
||||
enable_geo_uris.setVisibility(isChecked?View.VISIBLE:View.GONE);
|
||||
enable_geo_uris.setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
boolean geo = sharedpreferences.getBoolean(SET_GEO_URIS, false);
|
||||
if (geo) {
|
||||
osm_instance_container.setVisibility(View.GONE);
|
||||
} else {
|
||||
osm_instance_container.setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
});
|
||||
|
||||
if (nitterHost != null) {
|
||||
|
@ -188,6 +206,13 @@ public class MainActivity extends AppCompatActivity {
|
|||
if (osmHost != null) {
|
||||
osm_instance.setText(osmHost);
|
||||
}
|
||||
enable_geo_uris.setChecked(geouri_enabled);
|
||||
if (geouri_enabled) {
|
||||
osm_instance_container.setVisibility(View.GONE);
|
||||
} else {
|
||||
osm_instance_container.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
button_save.setOnClickListener(v -> {
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
if (nitter_instance.getText() != null && nitter_instance.getText().toString().trim().length() > 0) {
|
||||
|
@ -254,7 +279,6 @@ public class MainActivity extends AppCompatActivity {
|
|||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
editor.putBoolean(SET_GEO_URIS, isChecked);
|
||||
editor.apply();
|
||||
TextInputLayout osm_instance_container = findViewById(R.id.osm_instance_container);
|
||||
TextView osm_indications = findViewById(R.id.osm_indications);
|
||||
if (isChecked) {
|
||||
osm_instance_container.setVisibility(View.GONE);
|
||||
|
|
|
@ -366,7 +366,7 @@ public class TransformActivity extends Activity {
|
|||
} else {
|
||||
return url;
|
||||
}
|
||||
}else if (Arrays.asList(instagram_domains).contains(host)) {
|
||||
} else if (Arrays.asList(instagram_domains).contains(host)) {
|
||||
boolean bibliogram_enabled = sharedpreferences.getBoolean(SET_BIBLIOGRAM_ENABLED, true);
|
||||
if (bibliogram_enabled) {
|
||||
Matcher matcher = bibliogramPattern.matcher(url);
|
||||
|
|
|
@ -85,10 +85,11 @@ class Utils {
|
|||
|
||||
/**
|
||||
* Get time for reaching a domain
|
||||
*
|
||||
* @param domain String domain name
|
||||
* @return long delay
|
||||
*/
|
||||
static long ping(String domain){
|
||||
static long ping(String domain) {
|
||||
long timeDifference = -2;
|
||||
try {
|
||||
long beforeTime = System.currentTimeMillis();
|
||||
|
@ -96,7 +97,8 @@ class Utils {
|
|||
InetAddress.getByName(domain).isReachable(10000);
|
||||
long afterTime = System.currentTimeMillis();
|
||||
timeDifference = afterTime - beforeTime;
|
||||
} catch (IOException ignored) {}
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
return timeDifference;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM11,19.93c-3.95,-0.49 -7,-3.85 -7,-7.93 0,-0.62 0.08,-1.21 0.21,-1.79L9,15v1c0,1.1 0.9,2 2,2v1.93zM17.9,17.39c-0.26,-0.81 -1,-1.39 -1.9,-1.39h-1v-3c0,-0.55 -0.45,-1 -1,-1L8,12v-2h2c0.55,0 1,-0.45 1,-1L11,7h2c1.1,0 2,-0.9 2,-2v-0.41c2.93,1.19 5,4.06 5,7.41 0,2.08 -0.8,3.97 -2.1,5.39z"/>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="#FFFFFF"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM11,19.93c-3.95,-0.49 -7,-3.85 -7,-7.93 0,-0.62 0.08,-1.21 0.21,-1.79L9,15v1c0,1.1 0.9,2 2,2v1.93zM17.9,17.39c-0.26,-0.81 -1,-1.39 -1.9,-1.39h-1v-3c0,-0.55 -0.45,-1 -1,-1L8,12v-2h2c0.55,0 1,-0.45 1,-1L11,7h2c1.1,0 2,-0.9 2,-2v-0.41c2.93,1.19 5,4.06 5,7.41 0,2.08 -0.8,3.97 -2.1,5.39z" />
|
||||
</vector>
|
||||
|
|
|
@ -1,78 +1,87 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="@dimen/fab_margin">
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="0dp">
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ScrollView
|
||||
android:orientation="vertical"
|
||||
android:scrollbars="none"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/scrolling_container"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:scrollbars="none">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/instance_container"
|
||||
android:visibility="gone"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textSize="16sp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/invidious_instances"/>
|
||||
android:text="@string/invidious_instances"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/invidious_instances"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/nitter_instances"/>
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/nitter_instances"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/nitter_instances"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/bibliogram_instances"/>
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/bibliogram_instances"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/bibliogram_instances"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/loader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ProgressBar
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true" />
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:gravity="center"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/latency_test"
|
||||
style="@style/Widget.AppCompat.Button.Colored"
|
||||
|
|
|
@ -41,37 +41,40 @@
|
|||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginTop="20dp"
|
||||
android:id="@+id/nitter_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/introduction">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/nitter_indications"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/redirect_twitter_to_nitter"/>
|
||||
android:layout_weight="1"
|
||||
android:text="@string/redirect_twitter_to_nitter" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/enable_nitter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"/>
|
||||
android:layout_gravity="center" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/nitter_instance_container"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/nitter_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
android:layout_weight="1"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/nitter_container">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/nitter_instance"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -84,35 +87,37 @@
|
|||
|
||||
<LinearLayout
|
||||
android:id="@+id/invidious_container"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/nitter_instance_container"
|
||||
>
|
||||
app:layout_constraintTop_toBottomOf="@+id/nitter_instance_container">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/invidious_indications"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/redirect_youtube_to_invidious" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/enable_invidious"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"/>
|
||||
android:layout_gravity="center" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/invidious_instance_container"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/invidious_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
android:layout_weight="1"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/invidious_container">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/invidious_instance"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -123,39 +128,42 @@
|
|||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginTop="10dp"
|
||||
android:id="@+id/bibliogram_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/invidious_instance_container">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bibliogram_indications"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/redirect_instagram_to_bibliogram"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/invidious_container" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/enable_bibliogram"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/bibliogram_instance_container"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bibliogram_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
android:layout_weight="1"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bibliogram_container">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/bibliogram_instance"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -170,11 +178,12 @@
|
|||
android:id="@+id/osm_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bibliogram_instance_container">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/osm_indications"
|
||||
android:layout_width="0dp"
|
||||
|
@ -184,19 +193,22 @@
|
|||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bibliogram_container" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/enable_osm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/osm_instance_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/osm_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
app:layout_constraintTop_toBottomOf="@+id/osm_container">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/osm_instance"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -207,15 +219,14 @@
|
|||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<CheckBox
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/osm_instance_container"
|
||||
android:id="@+id/enable_geo_uris"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/use_geo_uri" />
|
||||
|
||||
android:text="@string/use_geo_uri"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/osm_instance_container" />
|
||||
|
||||
|
||||
<Button
|
||||
|
@ -224,10 +235,10 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:minWidth="100dp"
|
||||
android:drawableStart="@drawable/ic_save"
|
||||
android:drawableLeft="@drawable/ic_save"
|
||||
android:drawablePadding="5dp"
|
||||
android:minWidth="100dp"
|
||||
android:text="@string/save"
|
||||
android:textColor="@android:color/white"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
|
@ -261,8 +272,8 @@
|
|||
android:src="@drawable/ic_expand_more"
|
||||
android:textColor="@android:color/white"
|
||||
app:layout_constraintLeft_toRightOf="@+id/configure"
|
||||
app:layout_constraintTop_toBottomOf="@+id/button_save"
|
||||
app:layout_constraintRight_toLeftOf="@+id/instances"/>
|
||||
app:layout_constraintRight_toLeftOf="@+id/instances"
|
||||
app:layout_constraintTop_toBottomOf="@+id/button_save" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/instances"
|
||||
|
@ -277,8 +288,7 @@
|
|||
android:src="@drawable/ic_public"
|
||||
android:textColor="@android:color/white"
|
||||
app:layout_constraintLeft_toRightOf="@+id/button_expand"
|
||||
app:layout_constraintTop_toBottomOf="@+id/button_save"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@+id/button_save" />
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
|
|
|
@ -10,17 +10,19 @@
|
|||
android:id="@+id/checkbox_instance"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:layout_weight="1"/>
|
||||
android:layout_weight="1"
|
||||
android:singleLine="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/latency"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/latency"
|
||||
android:gravity="end"/>
|
||||
android:gravity="end" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:visibility="gone"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:id="@+id/progress"/>
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue