some code cleaning

This commit is contained in:
Thomas 2020-02-29 11:07:38 +01:00
parent b27d71be7c
commit 619a7ba8e4
3 changed files with 13 additions and 15 deletions

View File

@ -106,7 +106,7 @@ public class InstanceActivity extends AppCompatActivity {
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);
if( result == null ) {
if (result == null) {
View parentLayout = activity.findViewById(android.R.id.content);
Snackbar.make(parentLayout, R.string.error_message_internet, Snackbar.LENGTH_LONG).setAction(R.string.close, v -> activity.finish()).show();
return;

View File

@ -48,19 +48,19 @@ import java.util.Objects;
public class MainActivity extends AppCompatActivity {
public static final String APP_PREFS = "app_prefs";
public static final String SET_NITTER_HOST = "set_nitter_host";
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")
public static String TAG = "NitterizeMe";
public static final String SET_NITTER_HOST = "set_nitter_host";
public static String DEFAULT_NITTER_HOST = "nitter.net";
public static final String SET_INVIDIOUS_HOST = "set_invidious_host";
public static String DEFAULT_INVIDIOUS_HOST = "invidio.us";
public static String SET_INVIDIOUS_ENABLED = "set_invidious_enabled";
public static String SET_NITTER_ENABLED = "set_nitter_enabled";
public static String SET_OSM_ENABLED = "set_osm_enabled";
public static final String SET_OSM_HOST = "set_osm_host";
public static String DEFAULT_OSM_HOST = "www.openstreetmap.org";
public static String SET_BIBLIOGRAM_ENABLED = "set_bibliogram_enabled";
public static final String SET_BIBLIOGRAM_HOST = "set_bibliogram_host";
public static String DEFAULT_BIBLIOGRAM_HOST = "bibliogram.art";
public static String SET_GEO_URIS = "set_geo_uris";
//Supported domains
@ -236,7 +236,6 @@ public class MainActivity extends AppCompatActivity {
});
expand_instance_nitter.setOnClickListener(v -> {
boolean custom_instance_visibility = nitter_custom_group.getVisibility() == View.VISIBLE;
if (custom_instance_visibility) {
@ -303,7 +302,6 @@ public class MainActivity extends AppCompatActivity {
});
if (nitterHost != null) {
nitter_instance.setText(nitterHost);
current_instance_nitter.setText(nitterHost);

View File

@ -109,11 +109,11 @@
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@null"
android:contentDescription="@string/expand_instance_details"
android:scaleType="fitCenter"
android:src="@drawable/ic_expand_more"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/guide_nitter"
android:contentDescription="@string/expand_instance_details" />
app:layout_constraintTop_toTopOf="@id/guide_nitter" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier_nitter"
@ -250,11 +250,11 @@
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@null"
android:contentDescription="@string/expand_instance_details"
android:scaleType="fitCenter"
android:src="@drawable/ic_expand_more"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/guide_invidious"
android:contentDescription="@string/expand_instance_details"/>
app:layout_constraintTop_toTopOf="@id/guide_invidious" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier_invidious"
@ -391,11 +391,11 @@
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@null"
android:contentDescription="@string/expand_instance_details"
android:scaleType="fitCenter"
android:src="@drawable/ic_expand_more"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/guide_bibliogram"
android:contentDescription="@string/expand_instance_details"/>
app:layout_constraintTop_toTopOf="@id/guide_bibliogram" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier_bibliogram"
@ -532,11 +532,11 @@
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@null"
android:contentDescription="@string/expand_instance_details"
android:scaleType="fitCenter"
android:src="@drawable/ic_expand_more"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/guide_osm"
android:contentDescription="@string/expand_instance_details"/>
app:layout_constraintTop_toTopOf="@id/guide_osm" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier_osm"