Commit 72f5e505 authored by Thomas's avatar Thomas
Browse files

Add Wikipedia & Medium into check app + change navigation color

parent 7c6827b4
......@@ -75,7 +75,7 @@ public class CheckAppActivity extends AppCompatActivity {
"www.medium.com"
};
public static String[] wikipedi_domains = {
public static String[] wikipedia_domains = {
"wikipedia.org",
"www.wikipedia.org"
};
......@@ -147,10 +147,29 @@ public class CheckAppActivity extends AppCompatActivity {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
}
if (BuildConfig.fullLinks) {
domains = new String[twitter_domains.length + youtube_domains.length + reddit_domains.length + shortener_domains.length + instagram_domains.length + invidious_instances.length + nitter_instances.length + bibliogram_instances.length];
domains = new String[
twitter_domains.length
+ youtube_domains.length
+ reddit_domains.length
+ shortener_domains.length
+ instagram_domains.length
+ invidious_instances.length
+ nitter_instances.length
+ bibliogram_instances.length
+ wikipedia_domains.length
+ medium_domains.length
];
} else {
domains = new String[twitter_domains.length + youtube_domains.length + reddit_domains.length + shortener_domains.length + instagram_domains.length];
domains = new String[
twitter_domains.length
+ youtube_domains.length
+ reddit_domains.length
+ shortener_domains.length
+ instagram_domains.length
+ wikipedia_domains.length
+ medium_domains.length];
}
int i = 0;
for (String host : twitter_domains) {
......@@ -169,6 +188,14 @@ public class CheckAppActivity extends AppCompatActivity {
domains[i] = host;
i++;
}
for (String host : medium_domains) {
domains[i] = host;
i++;
}
for (String host : wikipedia_domains) {
domains[i] = host;
i++;
}
for (String host : shortener_domains) {
domains[i] = host;
i++;
......@@ -256,6 +283,14 @@ public class CheckAppActivity extends AppCompatActivity {
AppInfo appInfo = new AppInfo();
appInfo.setTitle("Reddit");
appInfos.add(appInfo);
} else if (Arrays.asList(medium_domains).contains(domain)) {
AppInfo appInfo = new AppInfo();
appInfo.setTitle("Medium");
appInfos.add(appInfo);
} else if (Arrays.asList(wikipedia_domains).contains(domain)) {
AppInfo appInfo = new AppInfo();
appInfo.setTitle("Wikipedia");
appInfos.add(appInfo);
} else if (Arrays.asList(shortener_domains).contains(domain)) {
AppInfo appInfo = new AppInfo();
appInfo.setTitle(getString(R.string.shortener_services));
......
......@@ -88,7 +88,7 @@ import static app.fedilab.nitterizeme.activities.CheckAppActivity.outlook_safe_d
import static app.fedilab.nitterizeme.activities.CheckAppActivity.reddit_domains;
import static app.fedilab.nitterizeme.activities.CheckAppActivity.shortener_domains;
import static app.fedilab.nitterizeme.activities.CheckAppActivity.twitter_domains;
import static app.fedilab.nitterizeme.activities.CheckAppActivity.wikipedi_domains;
import static app.fedilab.nitterizeme.activities.CheckAppActivity.wikipedia_domains;
import static app.fedilab.nitterizeme.activities.CheckAppActivity.youtube_domains;
import static app.fedilab.nitterizeme.activities.MainActivity.SET_BIBLIOGRAM_ENABLED;
import static app.fedilab.nitterizeme.activities.MainActivity.SET_EMBEDDED_PLAYER;
......@@ -342,7 +342,7 @@ public class Utils {
} else {
return url;
}
} else if (host != null && host.endsWith(wikipedi_domains[0])) {
} else if (host != null && host.endsWith(wikipedia_domains[0])) {
boolean wikiless_enabled = sharedpreferences.getBoolean(MainActivity.SET_WIKILESS_ENABLED, true);
if (wikiless_enabled) {
String wikilessHost = sharedpreferences.getString(MainActivity.SET_WIKILESS_HOST, MainActivity.DEFAULT_WIKILESS_HOST);
......@@ -1257,7 +1257,7 @@ public class Utils {
|| Arrays.asList(instagram_domains).contains(host) || Arrays.asList(bibliogram_instances).contains(host)
|| url.contains("/maps/place") || url.contains("/amp/s/") || (host != null && host.contains(outlook_safe_domain))
|| Arrays.asList(youtube_domains).contains(host) || Arrays.asList(invidious_instances).contains(host)
|| (host != null && host.endsWith(medium_domains[0]) || (host != null && host.endsWith(wikipedi_domains[0])));
|| (host != null && host.endsWith(medium_domains[0]) || (host != null && host.endsWith(wikipedia_domains[0])));
}
public static boolean routerEnabledForHost(Context context, String url) {
......@@ -1283,7 +1283,7 @@ public class Utils {
return sharedpreferences.getBoolean(SET_TEDDIT_ENABLED, true);
} else if (host != null && host.endsWith(medium_domains[0])) {
return sharedpreferences.getBoolean(SET_SCRIBERIP_ENABLED, true);
} else if (host != null && host.endsWith(wikipedi_domains[0])) {
} else if (host != null && host.endsWith(wikipedia_domains[0])) {
return sharedpreferences.getBoolean(SET_WIKILESS_ENABLED, true);
} else
return url.contains("/amp/s/") || (host != null && host.contains(outlook_safe_domain));
......
......@@ -68,6 +68,7 @@
android:padding="2dp"
android:src="@drawable/ic_copy"
app:layout_constraintEnd_toEndOf="parent"
android:contentDescription="@string/copy_url"
app:layout_constraintTop_toTopOf="parent" />
<TextView
......@@ -76,14 +77,13 @@
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:drawableStart="@drawable/ic_app_logo"
android:drawableLeft="@drawable/ic_app_logo"
android:drawablePadding="5dp"
android:gravity="center_vertical"
android:paddingTop="5dp"
android:text="@string/continue_with"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:drawableStartCompat="@drawable/ic_app_logo"
app:layout_constraintTop_toBottomOf="@+id/scroll_url" />
<GridView
......
......@@ -144,6 +144,7 @@
<string name="invidious_help_remove"><b>Remove:</b> UntrackMe will remove the parameter from URL, if it exists</string>
<string name="invidious_help_other">If you select other values for a parameter, they will be added to the URL. If the parameter already exists, its value will be changed to your choice</string>
<string name="invidious_help_explanations">[1] \'local\' parameter is set to \'true\' by default for better privacy</string>
<string name="copy_url">Copy URL To Clipboard</string>
<string-array name="invidious_theme">
<item>Ignore</item>
<item>Remove</item>
......
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat">
......@@ -10,6 +10,9 @@
<item name="android:colorBackground">@color/colorPrimaryDark</item>
<item name="android:textColor">@color/textColor</item>
<item name="alertDialogTheme">@style/AppThemeDialog</item>
<item name="android:navigationBarColor" tools:targetApi="lollipop">@color/colorPrimary
</item>
</style>
<!-- Base application theme. -->
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment