Code cleaning

This commit is contained in:
Thomas 2020-02-18 12:25:20 +01:00
parent e7d19348a1
commit 59f0da81b4
26 changed files with 703 additions and 567 deletions

View File

@ -2,13 +2,13 @@ package app.fedilab.nitterizeme;
import android.content.Context; import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import static org.junit.Assert.*; import static org.junit.Assert.assertEquals;
/** /**
* Instrumented test, which will execute on an Android device. * Instrumented test, which will execute on an Android device.

View File

@ -2,6 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="app.fedilab.nitterizeme"> package="app.fedilab.nitterizeme">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<application <application
android:allowBackup="false" android:allowBackup="false"
@ -9,8 +10,8 @@
android:label="@string/app_name" android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:usesCleartextTraffic="true"
android:theme="@style/AppTheme" android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
tools:ignore="GoogleAppIndexingWarning"> tools:ignore="GoogleAppIndexingWarning">
<activity <activity
@ -25,268 +26,337 @@
<activity <activity
android:name=".TransformActivity" android:name=".TransformActivity"
android:theme="@style/Theme.AppCompat.Translucent" android:noHistory="true"
android:noHistory="true"> android:theme="@style/Theme.AppCompat.Translucent">
<!-- The app should handle these domains, more can be added here --> <!-- The app should handle these domains, more can be added here -->
<!-- SHORTENED URLs --> <!-- SHORTENED URLs -->
<!-- t.co --> <!-- t.co -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
<data
android:host="t.co" android:host="t.co"
android:pathPattern=".*"/> android:pathPattern=".*"
<data android:scheme="http" android:scheme="https" />
<data
android:host="t.co" android:host="t.co"
android:pathPattern=".*"/> android:pathPattern=".*"
android:scheme="http" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" <data
android:host="t.co" /> android:host="t.co"
android:mimeType="text/plain" />
</intent-filter> </intent-filter>
<!-- nyti.ms --> <!-- nyti.ms -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
<data
android:host="nyti.ms" android:host="nyti.ms"
android:pathPattern=".*"/> android:pathPattern=".*"
<data android:scheme="http" android:scheme="https" />
<data
android:host="nyti.ms" android:host="nyti.ms"
android:pathPattern=".*"/> android:pathPattern=".*"
android:scheme="http" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" <data
android:host="nyti.ms" /> android:host="nyti.ms"
android:mimeType="text/plain" />
</intent-filter> </intent-filter>
<!-- bit.ly --> <!-- bit.ly -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
<data
android:host="bit.ly" android:host="bit.ly"
android:pathPattern=".*"/> android:pathPattern=".*"
<data android:scheme="http" android:scheme="https" />
<data
android:host="bit.ly" android:host="bit.ly"
android:pathPattern=".*"/> android:pathPattern=".*"
android:scheme="http" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" <data
android:host="bit.ly" /> android:host="bit.ly"
android:mimeType="text/plain" />
</intent-filter> </intent-filter>
<!-- tinyurl.com --> <!-- tinyurl.com -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
<data
android:host="tinyurl.com" android:host="tinyurl.com"
android:pathPattern=".*"/> android:pathPattern=".*"
<data android:scheme="http" android:scheme="https" />
<data
android:host="tinyurl.com" android:host="tinyurl.com"
android:pathPattern=".*"/> android:pathPattern=".*"
android:scheme="http" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" <data
android:host="tinyurl.com" /> android:host="tinyurl.com"
android:mimeType="text/plain" />
</intent-filter> </intent-filter>
<!-- goo.gl --> <!-- goo.gl -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
<data
android:host="goo.gl" android:host="goo.gl"
android:pathPattern=".*"/> android:pathPattern=".*"
<data android:scheme="http" android:scheme="https" />
<data
android:host="goo.gl" android:host="goo.gl"
android:pathPattern=".*"/> android:pathPattern=".*"
android:scheme="http" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" <data
android:host="goo.gl" /> android:host="goo.gl"
android:mimeType="text/plain" />
</intent-filter> </intent-filter>
<!-- TWITTER URLs --> <!-- TWITTER URLs -->
<!-- mobile.twitter.com --> <!-- mobile.twitter.com -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
<data
android:host="mobile.twitter.com" android:host="mobile.twitter.com"
android:pathPattern=".*"/> android:pathPattern=".*"
<data android:scheme="http" android:scheme="https" />
<data
android:host="mobile.twitter.com" android:host="mobile.twitter.com"
android:pathPattern=".*"/> android:pathPattern=".*"
android:scheme="http" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" <data
android:host="mobile.twitter.com" /> android:host="mobile.twitter.com"
android:mimeType="text/plain" />
</intent-filter> </intent-filter>
<!-- www.twitter.com --> <!-- www.twitter.com -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
<data
android:host="www.twitter.com" android:host="www.twitter.com"
android:pathPattern=".*"/> android:pathPattern=".*"
<data android:scheme="http" android:scheme="https" />
<data
android:host="www.twitter.com" android:host="www.twitter.com"
android:pathPattern=".*"/> android:pathPattern=".*"
android:scheme="http" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" <data
android:host="www.twitter.com" /> android:host="www.twitter.com"
android:mimeType="text/plain" />
</intent-filter> </intent-filter>
<!-- twitter.com --> <!-- twitter.com -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
<data
android:host="twitter.com" android:host="twitter.com"
android:pathPattern=".*"/> android:pathPattern=".*"
<data android:scheme="http" android:scheme="https" />
<data
android:host="twitter.com" android:host="twitter.com"
android:pathPattern=".*"/> android:pathPattern=".*"
android:scheme="http" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:mimeType="text/plain" android:host="twitter.com"
android:host="twitter.com" /> android:mimeType="text/plain" />
</intent-filter> </intent-filter>
<!-- YOUTUBE URLs --> <!-- YOUTUBE URLs -->
<!-- www.youtube.com --> <!-- www.youtube.com -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
android:host="www.youtube.com" /> <data
<data android:scheme="http" android:host="www.youtube.com"
android:host="www.youtube.com" /> android:scheme="https" />
<data
android:host="www.youtube.com"
android:scheme="http" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" <data
android:host="www.youtube.com" /> android:host="www.youtube.com"
android:mimeType="text/plain" />
</intent-filter> </intent-filter>
<!-- m.youtube.com --> <!-- m.youtube.com -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
android:host="m.youtube.com" /> <data
<data android:scheme="http" android:host="m.youtube.com"
android:host="m.youtube.com" /> android:scheme="https" />
<data
android:host="m.youtube.com"
android:scheme="http" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" <data
android:host="m.youtube.com" /> android:host="m.youtube.com"
android:mimeType="text/plain" />
</intent-filter> </intent-filter>
<!-- youtube.com --> <!-- youtube.com -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
android:host="youtube.com" /> <data
<data android:scheme="http" android:host="youtube.com"
android:host="youtube.com" /> android:scheme="https" />
<data
android:host="youtube.com"
android:scheme="http" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" <data
android:host="youtube.com" /> android:host="youtube.com"
android:mimeType="text/plain" />
</intent-filter> </intent-filter>
<!-- youtu.be --> <!-- youtu.be -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
android:host="youtu.be" /> <data
<data android:scheme="http" android:host="youtu.be"
android:host="youtu.be" /> android:scheme="https" />
<data
android:host="youtu.be"
android:scheme="http" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" <data
android:host="youtu.be" /> android:host="youtu.be"
android:mimeType="text/plain" />
</intent-filter> </intent-filter>
<!-- youtube-nocookie.com --> <!-- youtube-nocookie.com -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
android:host="youtube-nocookie.com" /> <data
<data android:scheme="http" android:host="youtube-nocookie.com"
android:host="youtube-nocookie.com" /> android:scheme="https" />
<data
android:host="youtube-nocookie.com"
android:scheme="http" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" <data
android:host="youtube-nocookie.com" /> android:host="youtube-nocookie.com"
android:mimeType="text/plain" />
</intent-filter> </intent-filter>
<!-- MAPS URLs --> <!-- MAPS URLs -->
<!-- /maps/ --> <!-- /maps/ -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
<data
android:host="*"
android:pathPattern="/maps/place/.*" android:pathPattern="/maps/place/.*"
android:host="*" /> android:scheme="https" />
<data android:scheme="http" <data
android:host="*"
android:pathPattern="/maps/place/.*" android:pathPattern="/maps/place/.*"
android:host="*" /> android:scheme="http" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" <data
android:pathPattern="/maps/place/.*" android:host="*"
android:host="*" /> android:mimeType="text/plain"
android:pathPattern="/maps/place/.*" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity <activity
android:name=".AboutActivity" android:name=".AboutActivity"
android:label="@string/app_name"
android:configChanges="orientation|screenSize" android:configChanges="orientation|screenSize"
android:theme="@style/AppTheme"/> android:label="@string/app_name"
android:theme="@style/AppTheme" />
</application> </application>
</manifest> </manifest>

View File

@ -30,11 +30,9 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
public class AboutActivity extends AppCompatActivity { public class AboutActivity extends AppCompatActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -45,17 +43,18 @@ public class AboutActivity extends AppCompatActivity {
PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0); PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
String version = pInfo.versionName; String version = pInfo.versionName;
about_version.setText(getResources().getString(R.string.about_vesrion, version)); about_version.setText(getResources().getString(R.string.about_vesrion, version));
} catch (PackageManager.NameNotFoundException ignored) {} } catch (PackageManager.NameNotFoundException ignored) {
}
setTitle(R.string.about_the_app); setTitle(R.string.about_the_app);
if( getSupportActionBar() != null) { if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true);
} }
//Developer click for Mastodon account //Developer click for Mastodon account
TextView developer_mastodon = findViewById(R.id.developer_mastodon); TextView developer_mastodon = findViewById(R.id.developer_mastodon);
SpannableString content = new SpannableString(developer_mastodon.getText().toString()); SpannableString content = new SpannableString(developer_mastodon.getText().toString());
content.setSpan(new ForegroundColorSpan(ContextCompat.getColor(AboutActivity.this,R.color.colorAccent)), 0, content.length(), 0); content.setSpan(new ForegroundColorSpan(ContextCompat.getColor(AboutActivity.this, R.color.colorAccent)), 0, content.length(), 0);
developer_mastodon.setText(content); developer_mastodon.setText(content);
developer_mastodon.setOnClickListener(v -> { developer_mastodon.setOnClickListener(v -> {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://toot.fedilab.app/@fedilab")); Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://toot.fedilab.app/@fedilab"));
@ -112,7 +111,7 @@ public class AboutActivity extends AppCompatActivity {
TextView license = findViewById(R.id.license); TextView license = findViewById(R.id.license);
content = new SpannableString(license.getText().toString()); content = new SpannableString(license.getText().toString());
content.setSpan(new ForegroundColorSpan(ContextCompat.getColor(AboutActivity.this,R.color.colorAccent)), 0, content.length(), 0); content.setSpan(new ForegroundColorSpan(ContextCompat.getColor(AboutActivity.this, R.color.colorAccent)), 0, content.length(), 0);
content.setSpan(new UnderlineSpan(), 0, content.length(), 0); content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
license.setText(content); license.setText(content);
license.setOnClickListener(v -> { license.setOnClickListener(v -> {

View File

@ -27,7 +27,6 @@ import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
@ -57,7 +56,7 @@ public class AppInfoAdapter extends RecyclerView.Adapter {
AppInfo appInfo = appInfos.get(viewHolder.getAdapterPosition()); AppInfo appInfo = appInfos.get(viewHolder.getAdapterPosition());
Context context = holder.itemView.getContext(); Context context = holder.itemView.getContext();
holder.domain.setText(appInfo.getDomain()); holder.domain.setText(appInfo.getDomain());
if( appInfo.getApplicationInfo() != null ) { if (appInfo.getApplicationInfo() != null) {
Drawable icon = appInfo.getApplicationInfo().loadIcon(context.getPackageManager()); Drawable icon = appInfo.getApplicationInfo().loadIcon(context.getPackageManager());
try { try {
holder.app_icon.setImageDrawable(icon); holder.app_icon.setImageDrawable(icon);
@ -65,10 +64,10 @@ public class AppInfoAdapter extends RecyclerView.Adapter {
holder.app_icon.setImageResource(R.drawable.ic_android); holder.app_icon.setImageResource(R.drawable.ic_android);
} }
holder.information.setText(appInfo.getApplicationInfo().packageName); holder.information.setText(appInfo.getApplicationInfo().packageName);
if( appInfo.getApplicationInfo().packageName.compareTo(BuildConfig.APPLICATION_ID) == 0 ) { if (appInfo.getApplicationInfo().packageName.compareTo(BuildConfig.APPLICATION_ID) == 0) {
holder.valid.setImageResource(R.drawable.ic_check); holder.valid.setImageResource(R.drawable.ic_check);
holder.valid.setContentDescription(context.getString(R.string.valid)); holder.valid.setContentDescription(context.getString(R.string.valid));
}else { } else {
holder.valid.setImageResource(R.drawable.ic_error); holder.valid.setImageResource(R.drawable.ic_error);
holder.valid.setContentDescription(context.getString(R.string.error)); holder.valid.setContentDescription(context.getString(R.string.error));
} }
@ -78,7 +77,7 @@ public class AppInfoAdapter extends RecyclerView.Adapter {
intent.setData(uri); intent.setData(uri);
context.startActivity(intent); context.startActivity(intent);
}); });
}else{ } else {
holder.information.setText(R.string.no_apps); holder.information.setText(R.string.no_apps);
holder.app_icon.setImageResource(R.drawable.ic_android); holder.app_icon.setImageResource(R.drawable.ic_android);
holder.valid.setContentDescription(context.getString(R.string.warning)); holder.valid.setContentDescription(context.getString(R.string.warning));
@ -86,8 +85,8 @@ public class AppInfoAdapter extends RecyclerView.Adapter {
holder.main_container.setOnClickListener(v -> { holder.main_container.setOnClickListener(v -> {
Intent intent = new Intent(Intent.ACTION_VIEW); Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra("nitterizeme","test"); intent.putExtra("nitterizeme", "test");
String url = "https://"+appInfo.getDomain(); String url = "https://" + appInfo.getDomain();
intent.setData(Uri.parse(url)); intent.setData(Uri.parse(url));
context.startActivity(intent); context.startActivity(intent);
}); });

View File

@ -13,6 +13,7 @@ package app.fedilab.nitterizeme;
* *
* You should have received a copy of the GNU General Public License along with NitterizeMe; if not, * You should have received a copy of the GNU General Public License along with NitterizeMe; if not,
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
@ -22,14 +23,6 @@ import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo; import android.content.pm.ResolveInfo;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.SwitchCompat;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.provider.Settings; import android.provider.Settings;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
@ -39,43 +32,40 @@ import android.widget.CheckBox;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.TextView; import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.SwitchCompat;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.snackbar.Snackbar; import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.textfield.TextInputEditText; import com.google.android.material.textfield.TextInputEditText;
import com.google.android.material.textfield.TextInputLayout; import com.google.android.material.textfield.TextInputLayout;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Objects; import java.util.Objects;
public class MainActivity extends AppCompatActivity { public class MainActivity extends AppCompatActivity {
public static final String APP_PREFS = "app_prefs";
@SuppressWarnings("unused") @SuppressWarnings("unused")
public static String TAG = "NitterizeMe"; public static String TAG = "NitterizeMe";
public static String SET_NITTER_HOST = "set_nitter_host"; public static String SET_NITTER_HOST = "set_nitter_host";
public static String DEFAULT_NITTER_HOST = "nitter.net"; public static String DEFAULT_NITTER_HOST = "nitter.net";
public static String SET_INVIDIOUS_HOST = "set_invidious_host"; public static String SET_INVIDIOUS_HOST = "set_invidious_host";
public static String DEFAULT_INVIDIOUS_HOST = "invidio.us"; public static String DEFAULT_INVIDIOUS_HOST = "invidio.us";
public static String SET_INVIDIOUS_ENABLED = "set_invidious_enabled"; public static String SET_INVIDIOUS_ENABLED = "set_invidious_enabled";
public static String SET_NITTER_ENABLED = "set_nitter_enabled"; public static String SET_NITTER_ENABLED = "set_nitter_enabled";
public static String SET_OSM_ENABLED = "set_osm_enabled"; public static String SET_OSM_ENABLED = "set_osm_enabled";
public static String SET_OSM_HOST = "set_osm_host"; public static String SET_OSM_HOST = "set_osm_host";
public static String DEFAULT_OSM_HOST = "www.openstreetmap.org"; public static String DEFAULT_OSM_HOST = "www.openstreetmap.org";
public static String SET_GEO_URIS = "set_geo_uris"; public static String SET_GEO_URIS = "set_geo_uris";
public static final String APP_PREFS = "app_prefs";
private AppInfoAdapter appInfoAdapter;
private RecyclerView list_apps;
private String[] domains;
//Supported domains //Supported domains
public static String[] twitter_domains = { public static String[] twitter_domains = {
"twitter.com", "twitter.com",
"mobile.twitter.com", "mobile.twitter.com",
"www.twitter.com", "www.twitter.com",
}; };
public static String[] youtube_domains = { public static String[] youtube_domains = {
"www.youtube.com", "www.youtube.com",
"youtube.com", "youtube.com",
@ -83,7 +73,6 @@ public class MainActivity extends AppCompatActivity {
"youtu.be", "youtu.be",
"youtube-nocookie.com" "youtube-nocookie.com"
}; };
public static String[] shortener_domains = { public static String[] shortener_domains = {
"t.co", "t.co",
"nyti.ms", "nyti.ms",
@ -91,6 +80,9 @@ public class MainActivity extends AppCompatActivity {
"tinyurl.com", "tinyurl.com",
"goo.gl", "goo.gl",
}; };
private AppInfoAdapter appInfoAdapter;
private RecyclerView list_apps;
private String[] domains;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -101,17 +93,17 @@ public class MainActivity extends AppCompatActivity {
Objects.requireNonNull(getSupportActionBar()).setDisplayShowHomeEnabled(true); Objects.requireNonNull(getSupportActionBar()).setDisplayShowHomeEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
domains = new String[twitter_domains.length+youtube_domains.length+shortener_domains.length]; domains = new String[twitter_domains.length + youtube_domains.length + shortener_domains.length];
int i = 0; int i = 0;
for(String host: twitter_domains){ for (String host : twitter_domains) {
domains[i] = host; domains[i] = host;
i++; i++;
} }
for(String host: youtube_domains){ for (String host : youtube_domains) {
domains[i] = host; domains[i] = host;
i++; i++;
} }
for(String host: shortener_domains){ for (String host : shortener_domains) {
domains[i] = host; domains[i] = host;
i++; i++;
} }
@ -156,13 +148,13 @@ public class MainActivity extends AppCompatActivity {
editor.apply(); editor.apply();
}); });
if(nitterHost!=null) { if (nitterHost != null) {
nitter_instance.setText(nitterHost); nitter_instance.setText(nitterHost);
} }
if(invidiousHost!=null) { if (invidiousHost != null) {
invidious_instance.setText(invidiousHost); invidious_instance.setText(invidiousHost);
} }
if(osmHost!=null) { if (osmHost != null) {
osm_instance.setText(osmHost); osm_instance.setText(osmHost);
} }
button_save.setOnClickListener(v -> { button_save.setOnClickListener(v -> {
@ -197,20 +189,20 @@ public class MainActivity extends AppCompatActivity {
ImageButton buttonExpand = findViewById(R.id.button_expand); ImageButton buttonExpand = findViewById(R.id.button_expand);
buttonExpand.setOnClickListener(v -> { buttonExpand.setOnClickListener(v -> {
if( list_apps.getVisibility() == View.VISIBLE){ if (list_apps.getVisibility() == View.VISIBLE) {
list_apps.setVisibility(View.GONE); list_apps.setVisibility(View.GONE);
buttonExpand.setContentDescription(getString(R.string.display_supported_links)); buttonExpand.setContentDescription(getString(R.string.display_supported_links));
}else{ } else {
list_apps.setVisibility(View.VISIBLE); list_apps.setVisibility(View.VISIBLE);
buttonExpand.setContentDescription(getString(R.string.hide_supported_links)); buttonExpand.setContentDescription(getString(R.string.hide_supported_links));
} }
}); });
ArrayList<AppInfo> appInfos = new ArrayList<>(); ArrayList<AppInfo> appInfos = new ArrayList<>();
for(String domain: domains) { for (String domain : domains) {
AppInfo appInfo = new AppInfo(); AppInfo appInfo = new AppInfo();
appInfo.setDomain(domain); appInfo.setDomain(domain);
appInfo.setApplicationInfo(getDefaultApp("https://"+domain)); appInfo.setApplicationInfo(getDefaultApp("https://" + domain));
appInfos.add(appInfo); appInfos.add(appInfo);
} }
@ -221,10 +213,10 @@ public class MainActivity extends AppCompatActivity {
editor.apply(); editor.apply();
TextInputLayout osm_instance_container = findViewById(R.id.osm_instance_container); TextInputLayout osm_instance_container = findViewById(R.id.osm_instance_container);
TextView osm_indications = findViewById(R.id.osm_indications); TextView osm_indications = findViewById(R.id.osm_indications);
if( isChecked){ if (isChecked) {
osm_instance_container.setVisibility(View.GONE); osm_instance_container.setVisibility(View.GONE);
osm_indications.setText(R.string.redirect_gm_to_geo_uri); osm_indications.setText(R.string.redirect_gm_to_geo_uri);
}else{ } else {
osm_instance_container.setVisibility(View.VISIBLE); osm_instance_container.setVisibility(View.VISIBLE);
osm_indications.setText(R.string.redirect_gm_to_osm); osm_indications.setText(R.string.redirect_gm_to_osm);
} }
@ -241,6 +233,7 @@ public class MainActivity extends AppCompatActivity {
/** /**
* Allow to get info about application that opens the link by default * Allow to get info about application that opens the link by default
*
* @param url String url for test * @param url String url for test
* @return ApplicationInfo info about the application * @return ApplicationInfo info about the application
*/ */
@ -277,7 +270,7 @@ public class MainActivity extends AppCompatActivity {
Intent intent = new Intent(MainActivity.this, AboutActivity.class); Intent intent = new Intent(MainActivity.this, AboutActivity.class);
startActivity(intent); startActivity(intent);
return true; return true;
}else if(id == android.R.id.home){ } else if (id == android.R.id.home) {
finish(); finish();
} }
@ -285,14 +278,14 @@ public class MainActivity extends AppCompatActivity {
} }
@Override @Override
protected void onResume(){ protected void onResume() {
super.onResume(); super.onResume();
if( list_apps != null) { if (list_apps != null) {
ArrayList<AppInfo> appInfos = new ArrayList<>(); ArrayList<AppInfo> appInfos = new ArrayList<>();
for(String domain: domains) { for (String domain : domains) {
AppInfo appInfo = new AppInfo(); AppInfo appInfo = new AppInfo();
appInfo.setDomain(domain); appInfo.setDomain(domain);
appInfo.setApplicationInfo(getDefaultApp("https://"+domain)); appInfo.setApplicationInfo(getDefaultApp("https://" + domain));
appInfos.add(appInfo); appInfos.add(appInfo);
} }
appInfoAdapter = new AppInfoAdapter(appInfos); appInfoAdapter = new AppInfoAdapter(appInfos);

View File

@ -13,6 +13,7 @@ package app.fedilab.nitterizeme;
* *
* You should have received a copy of the GNU General Public License along with NitterizeMe; if not, * You should have received a copy of the GNU General Public License along with NitterizeMe; if not,
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
import android.app.Activity; import android.app.Activity;
import android.content.ComponentName; import android.content.ComponentName;
import android.content.Context; import android.content.Context;
@ -32,7 +33,6 @@ import android.widget.LinearLayout;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import java.net.MalformedURLException; import java.net.MalformedURLException;
@ -54,27 +54,28 @@ import static app.fedilab.nitterizeme.MainActivity.youtube_domains;
public class TransformActivity extends Activity { public class TransformActivity extends Activity {
private Thread thread;
private ArrayList<String> notShortnedURLDialog;
final Pattern youtubePattern = Pattern.compile("(www\\.|m\\.)?(youtube\\.com|youtu\\.be|youtube-nocookie\\.com)/(((?!([\"'<])).)*)"); final Pattern youtubePattern = Pattern.compile("(www\\.|m\\.)?(youtube\\.com|youtu\\.be|youtube-nocookie\\.com)/(((?!([\"'<])).)*)");
final Pattern nitterPattern = Pattern.compile("(mobile\\.|www\\.)?twitter.com([\\w-/]+)"); final Pattern nitterPattern = Pattern.compile("(mobile\\.|www\\.)?twitter.com([\\w-/]+)");
final Pattern maps = Pattern.compile("/maps/place/[^@]+@([\\d.,z]{3,}).*"); final Pattern maps = Pattern.compile("/maps/place/[^@]+@([\\d.,z]{3,}).*");
final Pattern extractPlace = Pattern.compile("/maps/place/(((?!/data).)*)"); final Pattern extractPlace = Pattern.compile("/maps/place/(((?!/data).)*)");
private Thread thread;
private ArrayList<String> notShortnedURLDialog;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(MainActivity.APP_PREFS, Context.MODE_PRIVATE); SharedPreferences sharedpreferences = getSharedPreferences(MainActivity.APP_PREFS, Context.MODE_PRIVATE);
Intent intent = getIntent(); Intent intent = getIntent();
if( intent != null && intent.getStringExtra("nitterizeme") != null ) { if (intent != null && intent.getStringExtra("nitterizeme") != null) {
finish(); finish();
return; return;
} }
notShortnedURLDialog = new ArrayList<>(); notShortnedURLDialog = new ArrayList<>();
assert intent != null; assert intent != null;
//Dealing with URLs //Dealing with URLs
if( Objects.requireNonNull(intent.getAction()).equals(Intent.ACTION_VIEW)){ if (Objects.requireNonNull(intent.getAction()).equals(Intent.ACTION_VIEW)) {
String url = Objects.requireNonNull(intent.getData()).toString(); String url = Objects.requireNonNull(intent.getData()).toString();
URL url_; URL url_;
String host = null; String host = null;
try { try {
@ -84,7 +85,7 @@ public class TransformActivity extends Activity {
e.printStackTrace(); e.printStackTrace();
} }
//Shortened URLs //Shortened URLs
if( Arrays.asList(shortener_domains).contains(host)) { if (Arrays.asList(shortener_domains).contains(host)) {
AlertDialog.Builder unshortenAlertBuilder = new AlertDialog.Builder(TransformActivity.this); AlertDialog.Builder unshortenAlertBuilder = new AlertDialog.Builder(TransformActivity.this);
unshortenAlertBuilder.setTitle(R.string.shortened_detected); unshortenAlertBuilder.setTitle(R.string.shortened_detected);
@ -92,27 +93,27 @@ public class TransformActivity extends Activity {
unshortenAlertBuilder.setView(view); unshortenAlertBuilder.setView(view);
unshortenAlertBuilder.setIcon(R.mipmap.ic_launcher); unshortenAlertBuilder.setIcon(R.mipmap.ic_launcher);
unshortenAlertBuilder.setPositiveButton(R.string.open, (dialog, id) -> { unshortenAlertBuilder.setPositiveButton(R.string.open, (dialog, id) -> {
if( notShortnedURLDialog.size() > 0){ if (notShortnedURLDialog.size() > 0) {
URL url_1; URL url_1;
String realHost = null; String realHost = null;
try { try {
url_1 = new URL(notShortnedURLDialog.get(notShortnedURLDialog.size()-1)); url_1 = new URL(notShortnedURLDialog.get(notShortnedURLDialog.size() - 1));
realHost = url_1.getHost(); realHost = url_1.getHost();
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
e.printStackTrace(); e.printStackTrace();
} }
if( Arrays.asList(twitter_domains).contains(realHost)) { if (Arrays.asList(twitter_domains).contains(realHost)) {
boolean nitter_enabled = sharedpreferences.getBoolean(SET_NITTER_ENABLED, true); boolean nitter_enabled = sharedpreferences.getBoolean(SET_NITTER_ENABLED, true);
if(nitter_enabled) { if (nitter_enabled) {
Intent delegate = new Intent(Intent.ACTION_VIEW); Intent delegate = new Intent(Intent.ACTION_VIEW);
String transformedURL = transformUrl(url); String transformedURL = transformUrl(url);
if( transformedURL != null) { if (transformedURL != null) {
delegate.setData(Uri.parse(transformUrl(url))); delegate.setData(Uri.parse(transformUrl(url)));
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (delegate.resolveActivity(getPackageManager()) != null) { if (delegate.resolveActivity(getPackageManager()) != null) {
startActivity(delegate); startActivity(delegate);
} }
}else{ } else {
forwardToBrowser(intent); forwardToBrowser(intent);
} }
} else { } else {
@ -120,18 +121,18 @@ public class TransformActivity extends Activity {
} }
} }
//Maps URLs (containing /maps/place like Google Maps links) //Maps URLs (containing /maps/place like Google Maps links)
else if( url.contains("/maps/place")) { else if (url.contains("/maps/place")) {
boolean osm_enabled = sharedpreferences.getBoolean(MainActivity.SET_OSM_ENABLED, true); boolean osm_enabled = sharedpreferences.getBoolean(MainActivity.SET_OSM_ENABLED, true);
if(osm_enabled) { if (osm_enabled) {
Intent delegate = new Intent(Intent.ACTION_VIEW); Intent delegate = new Intent(Intent.ACTION_VIEW);
String transformedURL = transformUrl(url); String transformedURL = transformUrl(url);
if( transformedURL != null) { if (transformedURL != null) {
delegate.setData(Uri.parse(transformUrl(url))); delegate.setData(Uri.parse(transformUrl(url)));
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (delegate.resolveActivity(getPackageManager()) != null) { if (delegate.resolveActivity(getPackageManager()) != null) {
startActivity(delegate); startActivity(delegate);
} }
}else { } else {
forwardToBrowser(intent); forwardToBrowser(intent);
} }
} else { } else {
@ -139,26 +140,26 @@ public class TransformActivity extends Activity {
} }
} }
//YouTube URLs //YouTube URLs
else if(Arrays.asList(youtube_domains).contains(realHost)){ //Youtube URL else if (Arrays.asList(youtube_domains).contains(realHost)) { //Youtube URL
boolean invidious_enabled = sharedpreferences.getBoolean(SET_INVIDIOUS_ENABLED, true); boolean invidious_enabled = sharedpreferences.getBoolean(SET_INVIDIOUS_ENABLED, true);
if( invidious_enabled) { if (invidious_enabled) {
Intent delegate = new Intent(Intent.ACTION_VIEW); Intent delegate = new Intent(Intent.ACTION_VIEW);
String transformedURL = transformUrl(url); String transformedURL = transformUrl(url);
if( transformedURL != null) { if (transformedURL != null) {
delegate.setData(Uri.parse(transformUrl(url))); delegate.setData(Uri.parse(transformUrl(url)));
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (delegate.resolveActivity(getPackageManager()) != null) { if (delegate.resolveActivity(getPackageManager()) != null) {
startActivity(delegate); startActivity(delegate);
} }
}else { } else {
forwardToBrowser(intent); forwardToBrowser(intent);
} }
}else{ } else {
forwardToBrowser(intent); forwardToBrowser(intent);
} }
}else { } else {
Intent delegate = new Intent(Intent.ACTION_VIEW); Intent delegate = new Intent(Intent.ACTION_VIEW);
delegate.setData(Uri.parse(notShortnedURLDialog.get(notShortnedURLDialog.size()-1))); delegate.setData(Uri.parse(notShortnedURLDialog.get(notShortnedURLDialog.size() - 1)));
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (delegate.resolveActivity(getPackageManager()) != null) { if (delegate.resolveActivity(getPackageManager()) != null) {
startActivity(delegate); startActivity(delegate);
@ -186,12 +187,12 @@ public class TransformActivity extends Activity {
Runnable myRunnable = () -> { Runnable myRunnable = () -> {
positiveButton.setEnabled(true); positiveButton.setEnabled(true);
StringBuilder message; StringBuilder message;
if( notShortnedURLDialog.size() <= 1 ) { if (notShortnedURLDialog.size() <= 1) {
message = new StringBuilder(getString(R.string.the_app_failed_shortened)); message = new StringBuilder(getString(R.string.the_app_failed_shortened));
}else { } else {
message = new StringBuilder(getString(R.string.try_to_redirect, notShortnedURLDialog.get(0), notShortnedURLDialog.get(1))); message = new StringBuilder(getString(R.string.try_to_redirect, notShortnedURLDialog.get(0), notShortnedURLDialog.get(1)));
if( notShortnedURLDialog.size() > 2 ){ if (notShortnedURLDialog.size() > 2) {
for(int i=2 ; i < notShortnedURLDialog.size(); i++){ for (int i = 2; i < notShortnedURLDialog.size(); i++) {
message.append("\n\n").append(getString(R.string.try_to_redirect_again, notShortnedURLDialog.get(i))); message.append("\n\n").append(getString(R.string.try_to_redirect_again, notShortnedURLDialog.get(i)));
} }
} }
@ -208,18 +209,18 @@ public class TransformActivity extends Activity {
thread.start(); thread.start();
} }
//Twitter URLs //Twitter URLs
else if( Arrays.asList(twitter_domains).contains(host)) { else if (Arrays.asList(twitter_domains).contains(host)) {
boolean nitter_enabled = sharedpreferences.getBoolean(SET_NITTER_ENABLED, true); boolean nitter_enabled = sharedpreferences.getBoolean(SET_NITTER_ENABLED, true);
if(nitter_enabled) { if (nitter_enabled) {
Intent delegate = new Intent(Intent.ACTION_VIEW); Intent delegate = new Intent(Intent.ACTION_VIEW);
String transformedURL = transformUrl(url); String transformedURL = transformUrl(url);
if( transformedURL != null) { if (transformedURL != null) {
delegate.setData(Uri.parse(transformUrl(url))); delegate.setData(Uri.parse(transformUrl(url)));
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (delegate.resolveActivity(getPackageManager()) != null) { if (delegate.resolveActivity(getPackageManager()) != null) {
startActivity(delegate); startActivity(delegate);
} }
}else{ } else {
forwardToBrowser(intent); forwardToBrowser(intent);
} }
} else { } else {
@ -227,18 +228,18 @@ public class TransformActivity extends Activity {
} }
} }
//Maps URLs (containing /maps/place like Google Maps links) //Maps URLs (containing /maps/place like Google Maps links)
else if( url.contains("/maps/place")) { else if (url.contains("/maps/place")) {
boolean osm_enabled = sharedpreferences.getBoolean(MainActivity.SET_OSM_ENABLED, true); boolean osm_enabled = sharedpreferences.getBoolean(MainActivity.SET_OSM_ENABLED, true);
if(osm_enabled) { if (osm_enabled) {
Intent delegate = new Intent(Intent.ACTION_VIEW); Intent delegate = new Intent(Intent.ACTION_VIEW);
String transformedURL = transformUrl(url); String transformedURL = transformUrl(url);
if( transformedURL != null) { if (transformedURL != null) {
delegate.setData(Uri.parse(transformUrl(url))); delegate.setData(Uri.parse(transformUrl(url)));
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (delegate.resolveActivity(getPackageManager()) != null) { if (delegate.resolveActivity(getPackageManager()) != null) {
startActivity(delegate); startActivity(delegate);
} }
}else { } else {
forwardToBrowser(intent); forwardToBrowser(intent);
} }
} else { } else {
@ -246,35 +247,35 @@ public class TransformActivity extends Activity {
} }
} }
//YouTube URLs //YouTube URLs
else if(Arrays.asList(youtube_domains).contains(host)){ //Youtube URL else if (Arrays.asList(youtube_domains).contains(host)) { //Youtube URL
boolean invidious_enabled = sharedpreferences.getBoolean(SET_INVIDIOUS_ENABLED, true); boolean invidious_enabled = sharedpreferences.getBoolean(SET_INVIDIOUS_ENABLED, true);
if( invidious_enabled) { if (invidious_enabled) {
Intent delegate = new Intent(Intent.ACTION_VIEW); Intent delegate = new Intent(Intent.ACTION_VIEW);
String transformedURL = transformUrl(url); String transformedURL = transformUrl(url);
if( transformedURL != null) { if (transformedURL != null) {
delegate.setData(Uri.parse(transformUrl(url))); delegate.setData(Uri.parse(transformUrl(url)));
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (delegate.resolveActivity(getPackageManager()) != null) { if (delegate.resolveActivity(getPackageManager()) != null) {
startActivity(delegate); startActivity(delegate);
} }
}else { } else {
forwardToBrowser(intent); forwardToBrowser(intent);
} }
}else{ } else {
forwardToBrowser(intent); forwardToBrowser(intent);
} }
} }
} }
//It's a sharing intent //It's a sharing intent
else if( Objects.requireNonNull(intent.getAction()).equals(Intent.ACTION_SEND)){ else if (Objects.requireNonNull(intent.getAction()).equals(Intent.ACTION_SEND)) {
share(intent.getStringExtra(Intent.EXTRA_TEXT)); share(intent.getStringExtra(Intent.EXTRA_TEXT));
} }
} }
@Override @Override
protected void onDestroy(){ protected void onDestroy() {
if( thread != null && thread.isAlive()){ if (thread != null && thread.isAlive()) {
thread.interrupt(); thread.interrupt();
} }
super.onDestroy(); super.onDestroy();
@ -282,6 +283,7 @@ public class TransformActivity extends Activity {
/** /**
* Forward the intent to a browser * Forward the intent to a browser
*
* @param i original intent * @param i original intent
*/ */
private void forwardToBrowser(Intent i) { private void forwardToBrowser(Intent i) {
@ -314,6 +316,7 @@ public class TransformActivity extends Activity {
/** /**
* Transform the URL to a Nitter, Invidious or OSM ones * Transform the URL to a Nitter, Invidious or OSM ones
*
* @param url String original URL * @param url String original URL
* @return String transformed URL * @return String transformed URL
*/ */
@ -329,9 +332,9 @@ public class TransformActivity extends Activity {
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
e.printStackTrace(); e.printStackTrace();
} }
if(Arrays.asList(twitter_domains).contains(host)) { if (Arrays.asList(twitter_domains).contains(host)) {
boolean nitter_enabled = sharedpreferences.getBoolean(SET_NITTER_ENABLED, true); boolean nitter_enabled = sharedpreferences.getBoolean(SET_NITTER_ENABLED, true);
if(nitter_enabled) { if (nitter_enabled) {
Matcher matcher = nitterPattern.matcher(url); Matcher matcher = nitterPattern.matcher(url);
while (matcher.find()) { while (matcher.find()) {
final String nitter_directory = matcher.group(2); final String nitter_directory = matcher.group(2);
@ -342,46 +345,46 @@ public class TransformActivity extends Activity {
} else { } else {
return url; return url;
} }
}else if( url.contains("/maps/place")) { } else if (url.contains("/maps/place")) {
boolean osm_enabled = sharedpreferences.getBoolean(MainActivity.SET_OSM_ENABLED, true); boolean osm_enabled = sharedpreferences.getBoolean(MainActivity.SET_OSM_ENABLED, true);
if(osm_enabled) { if (osm_enabled) {
Matcher matcher = maps.matcher(url); Matcher matcher = maps.matcher(url);
while (matcher.find()) { while (matcher.find()) {
final String localization = matcher.group(1); final String localization = matcher.group(1);
assert localization != null; assert localization != null;
String[] data = localization.split(","); String[] data = localization.split(",");
if( data.length > 2 ){ if (data.length > 2) {
String zoom; String zoom;
String[] details = data[2].split("\\."); String[] details = data[2].split("\\.");
if( details.length > 0 ) { if (details.length > 0) {
zoom = details[0]; zoom = details[0];
}else { } else {
zoom = data[2]; zoom = data[2];
} }
String osmHost = sharedpreferences.getString(MainActivity.SET_OSM_HOST, MainActivity.DEFAULT_OSM_HOST).toLowerCase(); String osmHost = sharedpreferences.getString(MainActivity.SET_OSM_HOST, MainActivity.DEFAULT_OSM_HOST).toLowerCase();
boolean geo_uri_enabled = sharedpreferences.getBoolean(MainActivity.SET_GEO_URIS, false); boolean geo_uri_enabled = sharedpreferences.getBoolean(MainActivity.SET_GEO_URIS, false);
if(! geo_uri_enabled) { if (!geo_uri_enabled) {
newUrl = "https://" + osmHost + "/#map=" + zoom + "/" + data[0] + "/" + data[1]; newUrl = "https://" + osmHost + "/#map=" + zoom + "/" + data[0] + "/" + data[1];
}else{ } else {
newUrl = "geo:0,0?q="+data[0]+","+data[1]+",z="+zoom; newUrl = "geo:0,0?q=" + data[0] + "," + data[1] + ",z=" + zoom;
} }
} }
} }
if( newUrl == null && url.contains("/data=")) { if (newUrl == null && url.contains("/data=")) {
matcher = extractPlace.matcher(url); matcher = extractPlace.matcher(url);
while (matcher.find()) { while (matcher.find()) {
final String search = matcher.group(1); final String search = matcher.group(1);
newUrl = "geo:0,0?q="+search; newUrl = "geo:0,0?q=" + search;
} }
} }
return newUrl; return newUrl;
} else { } else {
return url; return url;
} }
}else if(Arrays.asList(youtube_domains).contains(host)){ //Youtube URL } else if (Arrays.asList(youtube_domains).contains(host)) { //Youtube URL
boolean invidious_enabled = sharedpreferences.getBoolean(SET_INVIDIOUS_ENABLED, true); boolean invidious_enabled = sharedpreferences.getBoolean(SET_INVIDIOUS_ENABLED, true);
if( invidious_enabled) { if (invidious_enabled) {
Matcher matcher = youtubePattern.matcher(url); Matcher matcher = youtubePattern.matcher(url);
while (matcher.find()) { while (matcher.find()) {
final String youtubeId = matcher.group(3); final String youtubeId = matcher.group(3);
@ -393,7 +396,7 @@ public class TransformActivity extends Activity {
} }
} }
return newUrl; return newUrl;
}else{ } else {
return url; return url;
} }
} }
@ -403,6 +406,7 @@ public class TransformActivity extends Activity {
/** /**
* Transform URL inside the shared content without modifying the whole content * Transform URL inside the shared content without modifying the whole content
*
* @param extraText String the new extra text * @param extraText String the new extra text
*/ */
private void share(String extraText) { private void share(String extraText) {
@ -432,7 +436,7 @@ public class TransformActivity extends Activity {
e.printStackTrace(); e.printStackTrace();
} }
String newUrl = null; String newUrl = null;
if( url == null){ if (url == null) {
Intent sendIntent = new Intent(); Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND); sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, extraText); sendIntent.putExtra(Intent.EXTRA_TEXT, extraText);
@ -441,9 +445,9 @@ public class TransformActivity extends Activity {
return; return;
} }
if( Arrays.asList(twitter_domains).contains(host) ) { if (Arrays.asList(twitter_domains).contains(host)) {
boolean nitter_enabled = sharedpreferences.getBoolean(SET_NITTER_ENABLED, true); boolean nitter_enabled = sharedpreferences.getBoolean(SET_NITTER_ENABLED, true);
if(nitter_enabled) { if (nitter_enabled) {
Matcher matcher = nitterPattern.matcher(url); Matcher matcher = nitterPattern.matcher(url);
while (matcher.find()) { while (matcher.find()) {
final String nitter_directory = matcher.group(2); final String nitter_directory = matcher.group(2);
@ -451,30 +455,30 @@ public class TransformActivity extends Activity {
newUrl = "https://" + nitterHost + nitter_directory; newUrl = "https://" + nitterHost + nitter_directory;
} }
} }
}else if( url.contains("/maps/place/")) { } else if (url.contains("/maps/place/")) {
boolean osm_enabled = sharedpreferences.getBoolean(MainActivity.SET_OSM_ENABLED, true); boolean osm_enabled = sharedpreferences.getBoolean(MainActivity.SET_OSM_ENABLED, true);
if(osm_enabled) { if (osm_enabled) {
Matcher matcher = maps.matcher(url); Matcher matcher = maps.matcher(url);
while (matcher.find()) { while (matcher.find()) {
final String localization = matcher.group(1); final String localization = matcher.group(1);
assert localization != null; assert localization != null;
String[] data = localization.split(","); String[] data = localization.split(",");
if( data.length > 2 ){ if (data.length > 2) {
String zoom; String zoom;
String[] details = data[2].split("\\."); String[] details = data[2].split("\\.");
if( details.length > 0 ) { if (details.length > 0) {
zoom = details[0]; zoom = details[0];
}else { } else {
zoom = data[2]; zoom = data[2];
} }
String osmHost = sharedpreferences.getString(MainActivity.SET_OSM_HOST, MainActivity.DEFAULT_OSM_HOST).toLowerCase(); String osmHost = sharedpreferences.getString(MainActivity.SET_OSM_HOST, MainActivity.DEFAULT_OSM_HOST).toLowerCase();
newUrl = "https://"+osmHost+"/#map="+zoom+"/"+data[0]+"/"+data[1]; newUrl = "https://" + osmHost + "/#map=" + zoom + "/" + data[0] + "/" + data[1];
} }
} }
} }
}else if(Arrays.asList(youtube_domains).contains(host)){ //Youtube URL } else if (Arrays.asList(youtube_domains).contains(host)) { //Youtube URL
boolean invidious_enabled = sharedpreferences.getBoolean(SET_INVIDIOUS_ENABLED, true); boolean invidious_enabled = sharedpreferences.getBoolean(SET_INVIDIOUS_ENABLED, true);
if( invidious_enabled) { if (invidious_enabled) {
Matcher matcher = youtubePattern.matcher(url); Matcher matcher = youtubePattern.matcher(url);
while (matcher.find()) { while (matcher.find()) {
final String youtubeId = matcher.group(3); final String youtubeId = matcher.group(3);
@ -486,8 +490,7 @@ public class TransformActivity extends Activity {
} }
} }
} }
} } else if (Arrays.asList(shortener_domains).contains(host)) {
else if(Arrays.asList(shortener_domains).contains(host)) {
String finalUrl = url; String finalUrl = url;
String finalExtraText = extraText; String finalExtraText = extraText;
Thread thread = new Thread() { Thread thread = new Thread() {
@ -499,7 +502,7 @@ public class TransformActivity extends Activity {
URL url_; URL url_;
String host = null; String host = null;
try { try {
url_ = new URL(notShortnedURLDialog.get(notShortnedURLDialog.size()-1)); url_ = new URL(notShortnedURLDialog.get(notShortnedURLDialog.size() - 1));
host = url_.getHost(); host = url_.getHost();
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
e.printStackTrace(); e.printStackTrace();
@ -508,9 +511,9 @@ public class TransformActivity extends Activity {
boolean nitter_enabled = sharedpreferences.getBoolean(SET_NITTER_ENABLED, true); boolean nitter_enabled = sharedpreferences.getBoolean(SET_NITTER_ENABLED, true);
boolean invidious_enabled = sharedpreferences.getBoolean(SET_INVIDIOUS_ENABLED, true); boolean invidious_enabled = sharedpreferences.getBoolean(SET_INVIDIOUS_ENABLED, true);
boolean osm_enabled = sharedpreferences.getBoolean(MainActivity.SET_OSM_ENABLED, true); boolean osm_enabled = sharedpreferences.getBoolean(MainActivity.SET_OSM_ENABLED, true);
if(nitter_enabled && Arrays.asList(twitter_domains).contains(host)) { if (nitter_enabled && Arrays.asList(twitter_domains).contains(host)) {
Matcher matcher = nitterPattern.matcher(notShortnedURLDialog.get(notShortnedURLDialog.size()-1)); Matcher matcher = nitterPattern.matcher(notShortnedURLDialog.get(notShortnedURLDialog.size() - 1));
String newUrlFinal = notShortnedURLDialog.get(notShortnedURLDialog.size()-1); String newUrlFinal = notShortnedURLDialog.get(notShortnedURLDialog.size() - 1);
while (matcher.find()) { while (matcher.find()) {
final String nitter_directory = matcher.group(2); final String nitter_directory = matcher.group(2);
String nitterHost = sharedpreferences.getString(MainActivity.SET_NITTER_HOST, MainActivity.DEFAULT_NITTER_HOST).toLowerCase(); String nitterHost = sharedpreferences.getString(MainActivity.SET_NITTER_HOST, MainActivity.DEFAULT_NITTER_HOST).toLowerCase();
@ -522,9 +525,9 @@ public class TransformActivity extends Activity {
sendIntent.putExtra(Intent.EXTRA_TEXT, newExtraText); sendIntent.putExtra(Intent.EXTRA_TEXT, newExtraText);
sendIntent.setType("text/plain"); sendIntent.setType("text/plain");
startActivity(sendIntent); startActivity(sendIntent);
}else if( invidious_enabled && Arrays.asList(youtube_domains).contains(host)) { } else if (invidious_enabled && Arrays.asList(youtube_domains).contains(host)) {
Matcher matcher = youtubePattern.matcher(notShortnedURLDialog.get(notShortnedURLDialog.size()-1)); Matcher matcher = youtubePattern.matcher(notShortnedURLDialog.get(notShortnedURLDialog.size() - 1));
String newUrlFinal = notShortnedURLDialog.get(notShortnedURLDialog.size()-1); String newUrlFinal = notShortnedURLDialog.get(notShortnedURLDialog.size() - 1);
while (matcher.find()) { while (matcher.find()) {
final String youtubeId = matcher.group(3); final String youtubeId = matcher.group(3);
String invidiousHost = sharedpreferences.getString(MainActivity.SET_INVIDIOUS_HOST, MainActivity.DEFAULT_INVIDIOUS_HOST).toLowerCase(); String invidiousHost = sharedpreferences.getString(MainActivity.SET_INVIDIOUS_HOST, MainActivity.DEFAULT_INVIDIOUS_HOST).toLowerCase();
@ -540,23 +543,23 @@ public class TransformActivity extends Activity {
sendIntent.putExtra(Intent.EXTRA_TEXT, newExtraText); sendIntent.putExtra(Intent.EXTRA_TEXT, newExtraText);
sendIntent.setType("text/plain"); sendIntent.setType("text/plain");
startActivity(sendIntent); startActivity(sendIntent);
}else if( osm_enabled && notShortnedURLDialog.get(notShortnedURLDialog.size()-1).contains("/maps/place/")) { } else if (osm_enabled && notShortnedURLDialog.get(notShortnedURLDialog.size() - 1).contains("/maps/place/")) {
String newUrlFinal = notShortnedURLDialog.get(notShortnedURLDialog.size()-1); String newUrlFinal = notShortnedURLDialog.get(notShortnedURLDialog.size() - 1);
Matcher matcher = maps.matcher(notShortnedURLDialog.get(notShortnedURLDialog.size()-1)); Matcher matcher = maps.matcher(notShortnedURLDialog.get(notShortnedURLDialog.size() - 1));
while (matcher.find()) { while (matcher.find()) {
final String localization = matcher.group(1); final String localization = matcher.group(1);
assert localization != null; assert localization != null;
String[] data = localization.split(","); String[] data = localization.split(",");
if( data.length > 2 ){ if (data.length > 2) {
String zoom; String zoom;
String[] details = data[2].split("\\."); String[] details = data[2].split("\\.");
if( details.length > 0 ) { if (details.length > 0) {
zoom = details[0]; zoom = details[0];
}else { } else {
zoom = data[2]; zoom = data[2];
} }
String osmHost = sharedpreferences.getString(MainActivity.SET_OSM_HOST, MainActivity.DEFAULT_OSM_HOST).toLowerCase(); String osmHost = sharedpreferences.getString(MainActivity.SET_OSM_HOST, MainActivity.DEFAULT_OSM_HOST).toLowerCase();
newUrlFinal = "https://"+osmHost+"/#map="+zoom+"/"+data[0]+"/"+data[1]; newUrlFinal = "https://" + osmHost + "/#map=" + zoom + "/" + data[0] + "/" + data[1];
} }
} }
String newExtraText = finalExtraText.replaceAll(Pattern.quote(finalUrl), Matcher.quoteReplacement(newUrlFinal)); String newExtraText = finalExtraText.replaceAll(Pattern.quote(finalUrl), Matcher.quoteReplacement(newUrlFinal));
@ -565,8 +568,8 @@ public class TransformActivity extends Activity {
sendIntent.putExtra(Intent.EXTRA_TEXT, newExtraText); sendIntent.putExtra(Intent.EXTRA_TEXT, newExtraText);
sendIntent.setType("text/plain"); sendIntent.setType("text/plain");
startActivity(sendIntent); startActivity(sendIntent);
}else{ } else {
String newExtraText = finalExtraText.replaceAll(Pattern.quote(finalUrl), Matcher.quoteReplacement(notShortnedURLDialog.get(notShortnedURLDialog.size()-1))); String newExtraText = finalExtraText.replaceAll(Pattern.quote(finalUrl), Matcher.quoteReplacement(notShortnedURLDialog.get(notShortnedURLDialog.size() - 1)));
Intent sendIntent = new Intent(); Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND); sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, newExtraText); sendIntent.putExtra(Intent.EXTRA_TEXT, newExtraText);
@ -578,7 +581,7 @@ public class TransformActivity extends Activity {
thread.start(); thread.start();
return; return;
} }
if( newUrl != null) { if (newUrl != null) {
extraText = extraText.replaceAll(Pattern.quote(url), Matcher.quoteReplacement(newUrl)); extraText = extraText.replaceAll(Pattern.quote(url), Matcher.quoteReplacement(newUrl));
} }
Intent sendIntent = new Intent(); Intent sendIntent = new Intent();

View File

@ -36,16 +36,17 @@ class Utils {
/** /**
* Returns the unshortened URL * Returns the unshortened URL
* @param urls ArrayList<String> URL to check *
* @param urls ArrayList<String> URL to check
*/ */
static void checkUrl(ArrayList<String> urls){ static void checkUrl(ArrayList<String> urls) {
URL url; URL url;
String newURL = null; String newURL = null;
String comingURl; String comingURl;
try { try {
comingURl = urls.get(urls.size()-1); comingURl = urls.get(urls.size() - 1);
if( comingURl.startsWith("http://")){ if (comingURl.startsWith("http://")) {
comingURl = comingURl.replace("http://", "https://"); comingURl = comingURl.replace("http://", "https://");
} }
url = new URL(comingURl); url = new URL(comingURl);
@ -53,7 +54,7 @@ class Utils {
httpsURLConnection.setRequestProperty("http.keepAlive", "false"); httpsURLConnection.setRequestProperty("http.keepAlive", "false");
httpsURLConnection.setInstanceFollowRedirects(false); httpsURLConnection.setInstanceFollowRedirects(false);
httpsURLConnection.setRequestMethod("HEAD"); httpsURLConnection.setRequestMethod("HEAD");
if( httpsURLConnection.getResponseCode() == 301) { if (httpsURLConnection.getResponseCode() == 301) {
Map<String, List<String>> map = httpsURLConnection.getHeaderFields(); Map<String, List<String>> map = httpsURLConnection.getHeaderFields();
for (Map.Entry<String, List<String>> entry : map.entrySet()) { for (Map.Entry<String, List<String>> entry : map.entrySet()) {
if (entry.toString().toLowerCase().startsWith("location")) { if (entry.toString().toLowerCase().startsWith("location")) {
@ -66,12 +67,12 @@ class Utils {
} }
} }
httpsURLConnection.getInputStream().close(); httpsURLConnection.getInputStream().close();
if (newURL != null && newURL.compareTo(comingURl)!=0){ if (newURL != null && newURL.compareTo(comingURl) != 0) {
URL redirectURL = new URL(newURL); URL redirectURL = new URL(newURL);
String host = redirectURL.getHost(); String host = redirectURL.getHost();
String protocol = redirectURL.getProtocol(); String protocol = redirectURL.getProtocol();
if( protocol != null && host != null){ if (protocol != null && host != null) {
if( Arrays.asList(shortener_domains).contains(host)) { if (Arrays.asList(shortener_domains).contains(host)) {
checkUrl(urls); checkUrl(urls);
} }
} }

View File

@ -1,5 +1,10 @@
<vector android:height="24dp" android:tint="#78909C" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="24dp"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> android:height="24dp"
<path android:fillColor="#FF000000" android:pathData="M6,18c0,0.55 0.45,1 1,1h1v3.5c0,0.83 0.67,1.5 1.5,1.5s1.5,-0.67 1.5,-1.5L11,19h2v3.5c0,0.83 0.67,1.5 1.5,1.5s1.5,-0.67 1.5,-1.5L16,19h1c0.55,0 1,-0.45 1,-1L18,8L6,8v10zM3.5,8C2.67,8 2,8.67 2,9.5v7c0,0.83 0.67,1.5 1.5,1.5S5,17.33 5,16.5v-7C5,8.67 4.33,8 3.5,8zM20.5,8c-0.83,0 -1.5,0.67 -1.5,1.5v7c0,0.83 0.67,1.5 1.5,1.5s1.5,-0.67 1.5,-1.5v-7c0,-0.83 -0.67,-1.5 -1.5,-1.5zM15.53,2.16l1.3,-1.3c0.2,-0.2 0.2,-0.51 0,-0.71 -0.2,-0.2 -0.51,-0.2 -0.71,0l-1.48,1.48C13.85,1.23 12.95,1 12,1c-0.96,0 -1.86,0.23 -2.66,0.63L7.85,0.15c-0.2,-0.2 -0.51,-0.2 -0.71,0 -0.2,0.2 -0.2,0.51 0,0.71l1.31,1.31C6.97,3.26 6,5.01 6,7h12c0,-1.99 -0.97,-3.75 -2.47,-4.84zM10,5L9,5L9,4h1v1zM15,5h-1L14,4h1v1z"/> android:tint="#78909C"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M6,18c0,0.55 0.45,1 1,1h1v3.5c0,0.83 0.67,1.5 1.5,1.5s1.5,-0.67 1.5,-1.5L11,19h2v3.5c0,0.83 0.67,1.5 1.5,1.5s1.5,-0.67 1.5,-1.5L16,19h1c0.55,0 1,-0.45 1,-1L18,8L6,8v10zM3.5,8C2.67,8 2,8.67 2,9.5v7c0,0.83 0.67,1.5 1.5,1.5S5,17.33 5,16.5v-7C5,8.67 4.33,8 3.5,8zM20.5,8c-0.83,0 -1.5,0.67 -1.5,1.5v7c0,0.83 0.67,1.5 1.5,1.5s1.5,-0.67 1.5,-1.5v-7c0,-0.83 -0.67,-1.5 -1.5,-1.5zM15.53,2.16l1.3,-1.3c0.2,-0.2 0.2,-0.51 0,-0.71 -0.2,-0.2 -0.51,-0.2 -0.71,0l-1.48,1.48C13.85,1.23 12.95,1 12,1c-0.96,0 -1.86,0.23 -2.66,0.63L7.85,0.15c-0.2,-0.2 -0.51,-0.2 -0.71,0 -0.2,0.2 -0.2,0.51 0,0.71l1.31,1.31C6.97,3.26 6,5.01 6,7h12c0,-1.99 -0.97,-3.75 -2.47,-4.84zM10,5L9,5L9,4h1v1zM15,5h-1L14,4h1v1z" />
</vector> </vector>

View File

@ -1,5 +1,10 @@
<vector android:height="24dp" android:tint="#388E3C" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="24dp"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> android:height="24dp"
<path android:fillColor="#FF000000" android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"/> android:tint="#388E3C"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z" />
</vector> </vector>

View File

@ -1,5 +1,10 @@
<vector android:height="24dp" android:tint="#E64A19" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="24dp"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> android:height="24dp"
<path android:fillColor="#FF000000" android:pathData="M11,15h2v2h-2zM11,7h2v6h-2zM11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8z"/> android:tint="#E64A19"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M11,15h2v2h-2zM11,7h2v6h-2zM11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8z" />
</vector> </vector>

View File

@ -1,5 +1,10 @@
<vector android:height="24dp" android:tint="#FFFFFF" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="24dp"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> android:height="24dp"
<path android:fillColor="#FF000000" android:pathData="M12,8l-6,6 1.41,1.41L12,10.83l4.59,4.58L18,14z"/> android:tint="#FFFFFF"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,8l-6,6 1.41,1.41L12,10.83l4.59,4.58L18,14z" />
</vector> </vector>

View File

@ -1,5 +1,10 @@
<vector android:height="24dp" android:tint="#FFFFFF" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="24dp"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> android:height="24dp"
<path android:fillColor="#FF000000" android:pathData="M16.59,8.59L12,13.17 7.41,8.59 6,10l6,6 6,-6z"/> android:tint="#FFFFFF"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M16.59,8.59L12,13.17 7.41,8.59 6,10l6,6 6,-6z" />
</vector> </vector>

View File

@ -1,5 +1,10 @@
<vector android:height="24dp" android:tint="#FFFFFF" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="24dp"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> android:height="24dp"
<path android:fillColor="#FF000000" android:pathData="M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z"/> android:tint="#FFFFFF"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z" />
</vector> </vector>

View File

@ -3,55 +3,56 @@
android:height="108dp" android:height="108dp"
android:viewportWidth="461.9709" android:viewportWidth="461.9709"
android:viewportHeight="461.9709"> android:viewportHeight="461.9709">
<group android:translateX="85.464615" <group
android:translateY="85.464615"> android:translateX="85.464615"
<path android:translateY="85.464615">
android:pathData="m225.488,243.526l-28.999,0c0,-21.664 0.127,-24.35 0.127,-38.663L196.617,58.066l28.871,26.326z" <path
android:strokeWidth="0.26458332" android:fillAlpha="1"
android:fillColor="#fe1f17" android:fillColor="#fe1f17"
android:strokeColor="#00000000" android:pathData="m225.488,243.526l-28.999,0c0,-21.664 0.127,-24.35 0.127,-38.663L196.617,58.066l28.871,26.326z"
android:fillAlpha="1"/> android:strokeWidth="0.26458332"
<path android:strokeColor="#00000000" />
android:pathData="m196.49,243.526 l-54.216,-68.404 18.2,-15.716 36.143,45.456c0,11.176 -0.127,18.188 -0.127,38.663z" <path
android:strokeWidth="0.22750032" android:fillAlpha="1"
android:fillColor="#cf0601" android:fillColor="#cf0601"
android:strokeColor="#00000000" android:pathData="m196.49,243.526 l-54.216,-68.404 18.2,-15.716 36.143,45.456c0,11.176 -0.127,18.188 -0.127,38.663z"
android:fillAlpha="1"/> android:strokeWidth="0.22750032"
<path android:strokeColor="#00000000" />
android:pathData="m68.91,58.019l28.999,-0c-0,21.664 -0.127,24.35 -0.127,38.663L97.782,243.479l-28.871,-0z" <path
android:strokeWidth="0.26458332" android:fillAlpha="1"
android:fillColor="#1da1f2" android:fillColor="#1da1f2"
android:strokeColor="#00000000" android:pathData="m68.91,58.019l28.999,-0c-0,21.664 -0.127,24.35 -0.127,38.663L97.782,243.479l-28.871,-0z"
android:fillAlpha="1"/> android:strokeWidth="0.26458332"
<path android:strokeColor="#00000000" />
android:pathData="m134.425,113.04 l19.502,-15.28 0.048,51.744 -50.231,-12.423 19.502,-15.28c7.634,-6.107 6.069,-4.756 11.18,-8.76z" <path
android:strokeWidth="0.17480077" android:fillAlpha="1"
android:fillColor="#0b6daa" android:fillColor="#0b6daa"
android:fillAlpha="1"/> android:pathData="m134.425,113.04 l19.502,-15.28 0.048,51.744 -50.231,-12.423 19.502,-15.28c7.634,-6.107 6.069,-4.756 11.18,-8.76z"
<path android:strokeWidth="0.17480077" />
android:pathData="m97.909,58.019 l54.216,68.403 -18.2,15.716 -36.143,-45.456c0,-11.176 0.127,-18.188 0.127,-38.663z" <path
android:strokeWidth="0.22750032" android:fillAlpha="1"
android:fillColor="#0b6daa" android:fillColor="#0b6daa"
android:strokeColor="#00000000" android:pathData="m97.909,58.019 l54.216,68.403 -18.2,15.716 -36.143,-45.456c0,-11.176 0.127,-18.188 0.127,-38.663z"
android:fillAlpha="1"/> android:strokeWidth="0.22750032"
<path android:strokeColor="#00000000" />
android:pathData="m97.909,58.018c-12.376,-8.427 -37.795,-7.915 -45.772,-17.703 -1.389,2.391 -2.19,5.168 -2.19,8.131 0,5.612 4.459,12.438 8.802,15.336 -2.654,-0.082 -5.147,-0.811 -7.326,-2.023 -0.002,0.068 -0.002,0.134 -0.002,0.207 0,7.834 5.576,14.375 12.978,15.858 -1.359,0.371 -2.79,0.569 -4.266,0.569 -1.041,0 -2.055,-0.102 -3.04,-0.292 2.059,6.428 3.488,10.036 15.112,11.236" <path
android:fillColor="#1da1f2" android:fillAlpha="1"
android:strokeColor="#00000000" android:fillColor="#1da1f2"
android:fillType="nonZero" android:fillType="nonZero"
android:fillAlpha="1"/> android:pathData="m97.909,58.018c-12.376,-8.427 -37.795,-7.915 -45.772,-17.703 -1.389,2.391 -2.19,5.168 -2.19,8.131 0,5.612 4.459,12.438 8.802,15.336 -2.654,-0.082 -5.147,-0.811 -7.326,-2.023 -0.002,0.068 -0.002,0.134 -0.002,0.207 0,7.834 5.576,14.375 12.978,15.858 -1.359,0.371 -2.79,0.569 -4.266,0.569 -1.041,0 -2.055,-0.102 -3.04,-0.292 2.059,6.428 3.488,10.036 15.112,11.236"
<path android:strokeColor="#00000000" />
android:pathData="m156.399,187.204 l-19.502,15.28 -0.048,-51.744 50.231,12.424 -19.502,15.28c-7.634,6.107 -6.069,4.756 -11.18,8.76z" <path
android:strokeAlpha="1" android:fillAlpha="1"
android:strokeWidth="1.47500002" android:fillColor="#cf0601"
android:fillColor="#cf0601" android:pathData="m156.399,187.204 l-19.502,15.28 -0.048,-51.744 50.231,12.424 -19.502,15.28c-7.634,6.107 -6.069,4.756 -11.18,8.76z"
android:strokeColor="#00000000" android:strokeWidth="1.47500002"
android:fillAlpha="1"/> android:strokeAlpha="1"
<path android:strokeColor="#00000000" />
android:pathData="M196.617,115.009L196.617,58.066l28.871,26.192z" <path
android:strokeWidth="0.26458332" android:fillAlpha="1"
android:fillColor="#ffffff" android:fillColor="#ffffff"
android:strokeColor="#00000000" android:pathData="M196.617,115.009L196.617,58.066l28.871,26.192z"
android:fillAlpha="1"/> android:strokeWidth="0.26458332"
</group> android:strokeColor="#00000000" />
</group>
</vector> </vector>

View File

@ -1,5 +1,10 @@
<vector android:height="24dp" android:tint="#FFFFFF" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="24dp"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> android:height="24dp"
<path android:fillColor="#FF000000" android:pathData="M17,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,7l-4,-4zM12,19c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3 3,1.34 3,3 -1.34,3 -3,3zM15,9L5,9L5,5h10v4z"/> android:tint="#FFFFFF"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M17,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,7l-4,-4zM12,19c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3 3,1.34 3,3 -1.34,3 -3,3zM15,9L5,9L5,5h10v4z" />
</vector> </vector>

View File

@ -1,5 +1,10 @@
<vector android:height="24dp" android:tint="#FFFFFF" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:viewportHeight="24" android:viewportWidth="24" android:width="24dp"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> android:height="24dp"
<path android:fillColor="#FF000000" android:pathData="M19.1,12.9a2.8,2.8 0,0 0,0.1 -0.9,2.8 2.8,0 0,0 -0.1,-0.9l2.1,-1.6a0.7,0.7 0,0 0,0.1 -0.6L19.4,5.5a0.7,0.7 0,0 0,-0.6 -0.2l-2.4,1a6.5,6.5 0,0 0,-1.6 -0.9l-0.4,-2.6a0.5,0.5 0,0 0,-0.5 -0.4H10.1a0.5,0.5 0,0 0,-0.5 0.4L9.3,5.4a5.6,5.6 0,0 0,-1.7 0.9l-2.4,-1a0.4,0.4 0,0 0,-0.5 0.2l-2,3.4c-0.1,0.2 0,0.4 0.2,0.6l2,1.6a2.8,2.8 0,0 0,-0.1 0.9,2.8 2.8,0 0,0 0.1,0.9L2.8,14.5a0.7,0.7 0,0 0,-0.1 0.6l1.9,3.4a0.7,0.7 0,0 0,0.6 0.2l2.4,-1a6.5,6.5 0,0 0,1.6 0.9l0.4,2.6a0.5,0.5 0,0 0,0.5 0.4h3.8a0.5,0.5 0,0 0,0.5 -0.4l0.3,-2.6a5.6,5.6 0,0 0,1.7 -0.9l2.4,1a0.4,0.4 0,0 0,0.5 -0.2l2,-3.4c0.1,-0.2 0,-0.4 -0.2,-0.6ZM12,15.6A3.6,3.6 0,1 1,15.6 12,3.6 3.6,0 0,1 12,15.6Z"/> android:tint="#FFFFFF"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M19.1,12.9a2.8,2.8 0,0 0,0.1 -0.9,2.8 2.8,0 0,0 -0.1,-0.9l2.1,-1.6a0.7,0.7 0,0 0,0.1 -0.6L19.4,5.5a0.7,0.7 0,0 0,-0.6 -0.2l-2.4,1a6.5,6.5 0,0 0,-1.6 -0.9l-0.4,-2.6a0.5,0.5 0,0 0,-0.5 -0.4H10.1a0.5,0.5 0,0 0,-0.5 0.4L9.3,5.4a5.6,5.6 0,0 0,-1.7 0.9l-2.4,-1a0.4,0.4 0,0 0,-0.5 0.2l-2,3.4c-0.1,0.2 0,0.4 0.2,0.6l2,1.6a2.8,2.8 0,0 0,-0.1 0.9,2.8 2.8,0 0,0 0.1,0.9L2.8,14.5a0.7,0.7 0,0 0,-0.1 0.6l1.9,3.4a0.7,0.7 0,0 0,0.6 0.2l2.4,-1a6.5,6.5 0,0 0,1.6 0.9l0.4,2.6a0.5,0.5 0,0 0,0.5 0.4h3.8a0.5,0.5 0,0 0,0.5 -0.4l0.3,-2.6a5.6,5.6 0,0 0,1.7 -0.9l2.4,1a0.4,0.4 0,0 0,0.5 -0.2l2,-3.4c0.1,-0.2 0,-0.4 -0.2,-0.6ZM12,15.6A3.6,3.6 0,1 1,15.6 12,3.6 3.6,0 0,1 12,15.6Z" />
</vector> </vector>

View File

@ -1,5 +1,10 @@
<vector android:height="24dp" android:tint="#FBC02D" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="24dp"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> android:height="24dp"
<path android:fillColor="#FF000000" android:pathData="M1,21h22L12,2 1,21zM13,18h-2v-2h2v2zM13,14h-2v-4h2v4z"/> android:tint="#FBC02D"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M1,21h22L12,2 1,21zM13,18h-2v-2h2v2zM13,14h-2v-4h2v4z" />
</vector> </vector>

View File

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?><!--
<!--
/* Copyright 2020 Thomas Schneider /* Copyright 2020 Thomas Schneider
* *
* This file is a part of NitterizeMe * This file is a part of NitterizeMe
@ -17,69 +16,73 @@
--> -->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/main_layout"
android:scrollbars="none"
android:layout_margin="@dimen/fab_margin" android:layout_margin="@dimen/fab_margin"
android:scrollbars="none"
tools:context=".AboutActivity"> tools:context=".AboutActivity">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<TextView
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:text="@string/app_name"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView <TextView
android:layout_marginTop="10dp"
android:id="@+id/about_version"
android:textSize="16sp"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_margin="5dp"
android:textStyle="bold"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:gravity="center_horizontal"
android:text="@string/app_name"
android:textSize="20sp" />
<TextView
android:id="@+id/about_version"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:gravity="center_horizontal"
android:textSize="16sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:gravity="center" android:gravity="center"
android:text="@string/developer" android:text="@string/developer"
/> android:textStyle="bold" />
<!-- Developer info --> <!-- Developer info -->
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="10dp" android:layout_marginTop="10dp"
android:layout_marginTop="10dp"> android:layout_marginBottom="10dp">
<LinearLayout <LinearLayout
android:padding="5dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:baselineAligned="false"
android:orientation="horizontal" android:orientation="horizontal"
android:baselineAligned="false"> android:padding="5dp">
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" android:orientation="vertical"
tools:ignore="UseCompoundDrawables"> tools:ignore="UseCompoundDrawables">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="tom79" android:text="tom79"
android:textSize="16sp" android:textSize="16sp"
tools:ignore="HardcodedText" /> tools:ignore="HardcodedText" />
<ImageView <ImageView
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
@ -89,45 +92,50 @@
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="3"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="3"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:textSize="16sp"
android:id="@+id/developer_mastodon" android:id="@+id/developer_mastodon"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold"
android:text="\@fedilab@toot.fedilab.org" android:text="\@fedilab@toot.fedilab.org"
android:textSize="16sp"
android:textStyle="bold"
tools:ignore="HardcodedText" /> tools:ignore="HardcodedText" />
<LinearLayout <LinearLayout
android:layout_marginTop="10dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:textSize="16sp"
android:id="@+id/framagit" android:id="@+id/framagit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Framagit" android:text="Framagit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
tools:ignore="HardcodedText" />
<TextView
android:textSize="16sp" android:textSize="16sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/github" android:id="@+id/github"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Github" android:text="Github"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
tools:ignore="HardcodedText" />
<TextView
android:textSize="16sp" android:textSize="16sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/codeberg" android:id="@+id/codeberg"
android:text="Codeberg"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text="Codeberg"
android:textSize="16sp"
tools:ignore="HardcodedText" /> tools:ignore="HardcodedText" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
@ -138,38 +146,39 @@
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/Donate"/> android:text="@string/Donate" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginBottom="20dp" android:layout_marginBottom="20dp"
android:gravity="center"
android:orientation="horizontal"> android:orientation="horizontal">
<Button
style="@style/Widget.AppCompat.Button.Colored"
android:textColor="@android:color/white"
android:layout_marginTop="10dp"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Paypal"
android:id="@+id/donate_paypal"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
tools:ignore="HardcodedText"
/>
<Button <Button
android:id="@+id/donate_paypal"
style="@style/Widget.AppCompat.Button.Colored" style="@style/Widget.AppCompat.Button.Colored"
android:textColor="@android:color/white"
android:layout_marginTop="10dp"
android:layout_gravity="center"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Liberapay" android:layout_gravity="center"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:text="Paypal"
android:textColor="@android:color/white"
tools:ignore="HardcodedText" />
<Button
android:id="@+id/donate_liberapay" android:id="@+id/donate_liberapay"
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:text="Liberapay"
android:textColor="@android:color/white"
tools:ignore="HardcodedText" /> tools:ignore="HardcodedText" />
</LinearLayout> </LinearLayout>
@ -181,104 +190,105 @@
tools:ignore="HardcodedText" /> tools:ignore="HardcodedText" />
<Button <Button
android:id="@+id/how_to"
style="@style/Widget.AppCompat.Button.Colored" style="@style/Widget.AppCompat.Button.Colored"
android:textColor="@android:color/white"
android:layout_marginTop="10dp"
android:layout_gravity="center"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/how_to" android:layout_gravity="center"
android:paddingRight="30dp"
android:paddingStart="30dp"
android:paddingEnd="30dp"
android:paddingLeft="30dp"
android:id="@+id/how_to"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="20dp" android:layout_marginBottom="20dp"
/> android:paddingStart="30dp"
android:paddingLeft="30dp"
android:paddingEnd="30dp"
android:paddingRight="30dp"
android:text="@string/how_to"
android:textColor="@android:color/white" />
<!-- About the app --> <!-- About the app -->
<TextView <TextView
android:layout_margin="10dp"
android:textStyle="bold"
android:textSize="16sp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="10dp"
android:gravity="center" android:gravity="center"
android:text="@string/about_the_app" android:text="@string/about_the_app"
/> android:textSize="16sp"
android:textStyle="bold" />
<!-- Code info --> <!-- Code info -->
<LinearLayout <LinearLayout
android:layout_marginTop="10dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/source_code" android:text="@string/source_code" />
/>
<TextView <TextView
android:layout_marginStart="5dp"
android:id="@+id/source_code" android:id="@+id/source_code"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_weight="3" android:layout_weight="3"
android:autoLink="web" android:autoLink="web"
android:text="https://framagit.org/tom79/nitterizeme" android:text="https://framagit.org/tom79/nitterizeme"
tools:ignore="HardcodedText" tools:ignore="HardcodedText" />
android:layout_marginLeft="5dp" />
</LinearLayout> </LinearLayout>
<!-- Support info --> <!-- Support info -->
<LinearLayout <LinearLayout
android:layout_marginTop="10dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/issue_tracker" android:text="@string/issue_tracker" />
/>
<TextView <TextView
android:layout_marginStart="5dp"
android:id="@+id/issue_tracker" android:id="@+id/issue_tracker"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_weight="3" android:layout_weight="3"
android:autoLink="web" android:autoLink="web"
android:text="https://framagit.org/tom79/nitterizeme/issues" android:text="https://framagit.org/tom79/nitterizeme/issues"
tools:ignore="HardcodedText" tools:ignore="HardcodedText" />
android:layout_marginLeft="5dp" />
</LinearLayout> </LinearLayout>
<!-- License info --> <!-- License info -->
<LinearLayout <LinearLayout
android:layout_marginTop="10dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/license" android:text="@string/license" />
/>
<TextView <TextView
android:layout_marginStart="5dp"
android:id="@+id/license" android:id="@+id/license"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_weight="3" android:layout_weight="3"
android:text="GPL3" android:text="GPL3"
tools:ignore="HardcodedText" tools:ignore="HardcodedText" />
android:layout_marginLeft="5dp" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>

View File

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?><!--
<!--
/* Copyright 2020 Thomas Schneider /* Copyright 2020 Thomas Schneider
* *
* This file is a part of NitterizeMe * This file is a part of NitterizeMe

View File

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?><!--
<!--
/* Copyright 2020 Thomas Schneider /* Copyright 2020 Thomas Schneider
* *
* This file is a part of NitterizeMe * This file is a part of NitterizeMe
@ -21,49 +20,51 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:scrollbars="none"
app:layout_behavior="@string/appbar_scrolling_view_behavior" app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".MainActivity" tools:context=".MainActivity"
tools:showIn="@layout/activity_main" tools:showIn="@layout/activity_main"
android:scrollbars="none"
> >
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/fab_margin" android:layout_margin="@dimen/fab_margin"
android:animateLayoutChanges="true" android:animateLayoutChanges="true">
>
<TextView <TextView
android:id="@+id/introduction" android:id="@+id/introduction"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/nitter_indications"
android:layout_marginTop="30dp"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/introduction" app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/nitter_indications"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="@string/redirect_twitter_to_nitter" android:text="@string/redirect_twitter_to_nitter"
/> app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/introduction" />
<LinearLayout <LinearLayout
android:id="@+id/nitter_container" android:id="@+id/nitter_container"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/nitter_indications" app:layout_constraintTop_toBottomOf="@+id/nitter_indications">
android:orientation="horizontal">
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:layout_weight="1"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
> android:layout_weight="1">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/nitter_instance" android:id="@+id/nitter_instance"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -72,37 +73,40 @@
android:inputType="textUri" android:inputType="textUri"
android:maxLines="1" /> android:maxLines="1" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
android:layout_margin="5dp" android:id="@+id/enable_nitter"
android:layout_gravity="center"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/enable_nitter"/> android:layout_gravity="center"
android:layout_margin="5dp" />
</LinearLayout> </LinearLayout>
<TextView <TextView
android:id="@+id/invidious_indications" android:id="@+id/invidious_indications"
android:layout_marginTop="30dp"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="@string/redirect_youtube_to_invidious"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/nitter_container" app:layout_constraintTop_toBottomOf="@+id/nitter_container" />
android:text="@string/redirect_youtube_to_invidious"
/>
<LinearLayout <LinearLayout
android:id="@+id/invidious_container" android:id="@+id/invidious_container"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/invidious_indications" app:layout_constraintTop_toBottomOf="@+id/invidious_indications">
android:orientation="horizontal">
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:layout_weight="1"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:layout_weight="1">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/invidious_instance" android:id="@+id/invidious_instance"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -111,44 +115,47 @@
android:inputType="textUri" android:inputType="textUri"
android:maxLines="1" /> android:maxLines="1" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
android:layout_margin="5dp" android:id="@+id/enable_invidious"
android:layout_gravity="center"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/enable_invidious"/> android:layout_gravity="center"
android:layout_margin="5dp" />
</LinearLayout> </LinearLayout>
<TextView <TextView
android:id="@+id/osm_indications" android:id="@+id/osm_indications"
android:layout_marginTop="30dp"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="@string/redirect_gm_to_osm"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/invidious_container" app:layout_constraintTop_toBottomOf="@+id/invidious_container" />
android:text="@string/redirect_gm_to_osm"
/>
<LinearLayout <LinearLayout
android:layout_marginTop="5dp"
android:id="@+id/osm_container" android:id="@+id/osm_container"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/osm_indications" app:layout_constraintTop_toBottomOf="@+id/osm_indications">
android:orientation="horizontal">
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"> android:orientation="vertical">
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/osm_instance_container" android:id="@+id/osm_instance_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/osm_instance" android:id="@+id/osm_instance"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -157,82 +164,83 @@
android:inputType="textUri" android:inputType="textUri"
android:maxLines="1" /> android:maxLines="1" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<CheckBox <CheckBox
android:text="@string/use_geo_uri" android:id="@+id/enable_geo_uris"
android:layout_gravity="center"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/enable_geo_uris"/> android:layout_gravity="center"
android:text="@string/use_geo_uri" />
</LinearLayout> </LinearLayout>
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
android:layout_margin="5dp" android:id="@+id/enable_osm"
android:layout_gravity="center"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/enable_osm"/> android:layout_gravity="center"
android:layout_margin="5dp" />
</LinearLayout> </LinearLayout>
<Button <Button
style="@style/Widget.AppCompat.Button.Colored"
android:textColor="@android:color/white"
android:id="@+id/configure" android:id="@+id/configure"
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:drawableStart="@drawable/ic_settings" android:drawableStart="@drawable/ic_settings"
android:drawableLeft="@drawable/ic_settings" android:drawableLeft="@drawable/ic_settings"
android:drawablePadding="5dp"
android:drawablePadding="5dp"
android:text="@string/configure"
android:textColor="@android:color/white"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/button_save" app:layout_constraintRight_toLeftOf="@+id/button_save"
app:layout_constraintTop_toBottomOf="@+id/osm_container" app:layout_constraintTop_toBottomOf="@+id/osm_container" />
android:text="@string/configure"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button <Button
style="@style/Widget.AppCompat.Button.Colored"
android:textColor="@android:color/white"
android:drawableStart="@drawable/ic_save"
android:drawableLeft="@drawable/ic_save"
android:drawablePadding="5dp"
android:id="@+id/button_save" android:id="@+id/button_save"
android:layout_marginTop="20dp"
app:layout_constraintLeft_toRightOf="@+id/configure"
app:layout_constraintRight_toRightOf="@+id/button_expand"
app:layout_constraintTop_toBottomOf="@+id/osm_container"
android:text="@string/save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ImageButton
style="@style/Widget.AppCompat.Button.Colored" style="@style/Widget.AppCompat.Button.Colored"
android:textColor="@android:color/white"
android:drawableStart="@drawable/ic_save"
android:drawableLeft="@drawable/ic_save"
android:drawablePadding="5dp"
android:id="@+id/button_expand"
android:layout_marginTop="20dp"
app:layout_constraintLeft_toRightOf="@+id/button_save"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/osm_container"
android:src="@drawable/ic_expand_more"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:contentDescription="@string/display_supported_links" /> android:layout_marginTop="20dp"
android:drawableStart="@drawable/ic_save"
android:drawableLeft="@drawable/ic_save"
android:drawablePadding="5dp"
android:text="@string/save"
android:textColor="@android:color/white"
app:layout_constraintLeft_toRightOf="@+id/configure"
app:layout_constraintRight_toRightOf="@+id/button_expand"
app:layout_constraintTop_toBottomOf="@+id/osm_container" />
<ImageButton
android:id="@+id/button_expand"
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:contentDescription="@string/display_supported_links"
android:drawableStart="@drawable/ic_save"
android:drawableLeft="@drawable/ic_save"
android:drawablePadding="5dp"
android:src="@drawable/ic_expand_more"
android:textColor="@android:color/white"
app:layout_constraintLeft_toRightOf="@+id/button_save"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/osm_container" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:visibility="gone" android:id="@+id/list_apps"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/button_save" app:layout_constraintTop_toBottomOf="@+id/button_save" />
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="20dp"
android:id="@+id/list_apps"
/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView> </ScrollView>

View File

@ -1,34 +1,40 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal" android:layout_width="match_parent"
android:id="@+id/main_container" android:id="@+id/main_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/fab_margin" android:layout_marginStart="@dimen/fab_margin"
android:layout_marginEnd="@dimen/fab_margin"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_height="wrap_content"> android:layout_marginEnd="@dimen/fab_margin"
android:orientation="horizontal">
<ImageView <ImageView
android:id="@+id/app_icon"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:id="@+id/app_icon"
android:contentDescription="@string/icon_of_the_app" /> android:contentDescription="@string/icon_of_the_app" />
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/fab_margin" android:layout_marginStart="@dimen/fab_margin"
android:layout_marginEnd="@dimen/fab_margin" android:layout_marginEnd="@dimen/fab_margin"
android:layout_weight="1"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:textStyle="bold" android:id="@+id/domain"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/domain"/> android:textStyle="bold" />
<TextView <TextView
android:id="@+id/information"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
android:id="@+id/information"/>
</LinearLayout> </LinearLayout>
<ImageView <ImageView
android:id="@+id/valid" android:id="@+id/valid"
android:layout_width="30dp" android:layout_width="30dp"

View File

@ -1,30 +1,32 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:padding="@dimen/fab_margin" android:layout_height="wrap_content"
android:layout_height="wrap_content"> android:padding="@dimen/fab_margin">
<RelativeLayout <RelativeLayout
android:id="@+id/progress" android:id="@+id/progress"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<ProgressBar <ProgressBar
android:layout_width="wrap_content"
android:id="@+id/loading" android:id="@+id/loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true" />
/>
<TextView <TextView
android:layout_marginTop="10dp" android:layout_width="match_parent"
android:gravity="center" android:layout_height="wrap_content"
android:layout_width="match_parent" android:layout_below="@+id/loading"
android:layout_height="wrap_content" android:layout_marginTop="10dp"
android:layout_below="@+id/loading" android:gravity="center"
android:text="@string/resolving_shortened"/> android:text="@string/resolving_shortened" />
</RelativeLayout> </RelativeLayout>
<TextView <TextView
android:id="@+id/indications"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/indications" android:visibility="gone" />
android:visibility="gone"/>
</RelativeLayout> </RelativeLayout>

View File

@ -4,8 +4,8 @@
tools:context="app.fedilab.nitterizeme.MainActivity"> tools:context="app.fedilab.nitterizeme.MainActivity">
<item <item
android:id="@+id/action_about" android:id="@+id/action_about"
android:orderInCategory="100"
android:icon="@drawable/ic_info_outline" android:icon="@drawable/ic_info_outline"
android:orderInCategory="100"
android:title="@string/action_about" android:title="@string/action_about"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
</menu> </menu>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/> <background android:drawable="@color/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground"/> <foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon> </adaptive-icon>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/> <background android:drawable="@color/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground"/> <foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon> </adaptive-icon>

View File

@ -2,7 +2,7 @@ package app.fedilab.nitterizeme;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*; import static org.junit.Assert.assertEquals;
/** /**
* Example local unit test, which will execute on the development machine (host). * Example local unit test, which will execute on the development machine (host).