Add flavors

This commit is contained in:
Thomas 2020-05-04 17:27:41 +02:00
parent 33001db0a0
commit 645510e303
24 changed files with 105 additions and 42 deletions

View File

@ -2,6 +2,8 @@
UntrackMe once set by default to open Twitter and YouTube links will transform them into Nitter and Invidious links and delegate the action to another app.
There are two version of UntrackMe - Once handling all URLs for removing tracking parameters - Another one called "UntrackMe Lite" that will only handle Twitter, Youtube, Instagram, Google Maps and shortened URLs.
## Donate
@ -9,7 +11,9 @@ UntrackMe once set by default to open Twitter and YouTube links will transform t
## Download
[<img alt='Get it on F-Droid' src='./images/get-it-on-fdroid.png' height="80"/>](https://f-droid.org/app/app.fedilab.nitterizeme)
Full version: [<img alt='Get it on F-Droid' src='./images/get-it-on-fdroid.png' height="80"/>](https://f-droid.org/app/app.fedilab.nitterizeme)
Lite version: [<img alt='Get it on F-Droid' src='./images/get-it-on-fdroid.png' height="80"/>](https://f-droid.org/app/app.fedilab.nitterizemelite)
### What is Nitter:
@ -23,6 +27,10 @@ Github project: [/zedeus/nitter](https://github.com/zedeus/nitter)
A free and open source alternative front-end to YouTube
Github project: [/omarroth/invidious](https://github.com/omarroth/invidious)
### What is Bibliogram:
A free and open source alternative front-end to Instagram
Github project: [/cloudrac3r/bibliogram](https://github.com/cloudrac3r/bibliogram)
### Screenshots:

View File

@ -15,25 +15,24 @@ android {
checkReleaseBuilds false
abortOnError false
}
flavorDimensions "default"
productFlavors {
full {
fullLinks {
applicationId "app.fedilab.nitterizeme"
buildConfigField "boolean", "full", "true"
sourceSets {
main {
manifest.srcFile "src/full/AndroidManifest.xml"
}
}
buildConfigField "boolean", "fullLinks", "true"
flavorDimensions "default"
}
lite {
applicationId "app.fedilab.nitterizemelite"
buildConfigField "boolean", "full", "false"
sourceSets {
main {
manifest.srcFile "src/lite/AndroidManifest.xml"
}
}
buildConfigField "boolean", "fullLinks", "false"
flavorDimensions "default"
}
}
sourceSets {
lite {
manifest.srcFile "src/main/AndroidManifest.xml"
}
fullLinks {
manifest.srcFile "src/fullLinks/AndroidManifest.xml"
}
}
buildTypes {

View File

@ -15,9 +15,11 @@
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
tools:ignore="GoogleAppIndexingWarning,UnusedAttribute">
tools:ignore="GoogleAppIndexingWarning,UnusedAttribute"
tools:replace="android:label">
<activity
tools:replace="android:label"
android:name=".activities.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
@ -27,10 +29,11 @@
</intent-filter>
</activity>
<activity
<activity-alias
android:name=".activities.TransformActivity"
android:noHistory="true"
android:theme="@style/Theme.AppCompat.Translucent">
android:theme="@style/Theme.AppCompat.Translucent"
android:targetActivity=".activities.TransformActivity">
<!-- The app should handle these domains, more can be added here -->
<intent-filter>
@ -187,36 +190,42 @@
android:pathPattern="/amp/s/.*" />
</intent-filter>
</activity>
<activity
</activity-alias>
<activity-alias
android:name=".activities.AppsPickerActivity"
android:noHistory="true"
android:theme="@style/Theme.AppCompat.Translucent"/>
<activity
android:theme="@style/Theme.AppCompat.Translucent"
android:targetActivity=".activities.AppsPickerActivity" />
<activity-alias
android:name=".activities.InstanceActivity"
android:excludeFromRecents="true"
android:theme="@style/AppThemeDialog" />
<activity
android:theme="@style/AppThemeDialog"
android:targetActivity=".activities.InstanceActivity" />
<activity-alias
android:name=".activities.AboutActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:theme="@style/AppTheme" />
<activity
android:theme="@style/AppTheme"
android:targetActivity=".activities.AboutActivity" />
<activity-alias
android:name=".activities.CheckAppActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:theme="@style/AppTheme" />
<activity
android:theme="@style/AppTheme"
android:targetActivity=".activities.CheckAppActivity" />
<activity-alias
android:name=".activities.DefaultAppActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:theme="@style/AppTheme" />
<activity
android:theme="@style/AppTheme"
android:targetActivity=".activities.DefaultAppActivity" />
<activity-alias
android:name=".activities.WebviewPlayerActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask"
android:theme="@style/AppTheme" />
android:theme="@style/AppTheme"
android:targetActivity=".activities.WebviewPlayerActivity" />
</application>
</manifest>

View File

@ -8,10 +8,11 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
tools:node="replace"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:icon="@mipmap/ic_launcher_lite"
android:label="@string/app_name_lite"
android:roundIcon="@mipmap/ic_launcher_round"
android:roundIcon="@mipmap/ic_launcher_lite_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -29,6 +29,7 @@ import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import app.fedilab.nitterizeme.BuildConfig;
import app.fedilab.nitterizeme.R;
@ -63,6 +64,14 @@ public class AboutActivity extends AppCompatActivity {
startActivity(browserIntent);
});
//App Name:
TextView app_name = findViewById(R.id.app_name);
if (BuildConfig.fullLinks) {
app_name.setText(R.string.app_name);
} else {
app_name.setText(R.string.app_name_lite);
}
//Developer Github
TextView github = findViewById(R.id.github);
content = new SpannableString(github.getText().toString());

View File

@ -111,7 +111,7 @@ public class CheckAppActivity extends AppCompatActivity {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
}
if (BuildConfig.full) {
if (BuildConfig.fullLinks) {
domains = new String[twitter_domains.length + youtube_domains.length + shortener_domains.length + instagram_domains.length + invidious_instances.length + nitter_instances.length + bibliogram_instances.length];
} else {
domains = new String[twitter_domains.length + youtube_domains.length + shortener_domains.length + instagram_domains.length];
@ -133,7 +133,7 @@ public class CheckAppActivity extends AppCompatActivity {
domains[i] = host;
i++;
}
if (BuildConfig.full) {
if (BuildConfig.fullLinks) {
for (String host : invidious_instances) {
domains[i] = host;
i++;

View File

@ -512,7 +512,7 @@ public class MainActivity extends AppCompatActivity {
current_instance_bibliogram.setText(bibliogramHost);
}
ConstraintLayout display_indications = findViewById(R.id.display_indications);
if (BuildConfig.full) {
if (BuildConfig.fullLinks) {
List<ResolveInfo> resolveInfos = getPackageManager().queryIntentActivities(new Intent(Intent.ACTION_VIEW, Uri.parse("https://fedilab.app")), PackageManager.MATCH_DEFAULT_ONLY);
String thisPackageName = getApplicationContext().getPackageName();
if (resolveInfos.size() == 1 && resolveInfos.get(0).activityInfo.packageName.compareTo(thisPackageName) == 0) {

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="34.79452"
android:viewportHeight="34.79452">
<group
android:translateX="4.6972604"
android:translateY="4.6972604">
<path
android:fillColor="#c4302b"
android:pathData="m4.8102,7.35s5.9145,-2.289 7.9671,-3.4741c2.0527,1.1851 7.8124,3.4741 7.8124,3.4741 0,11.419 -7.8124,14.22 -7.8124,14.22s-7.9671,-2.8007 -7.9671,-14.22z"
android:strokeWidth="1.0583"
android:strokeColor="#1da1f2" />
<path
android:fillColor="#FF000000"
android:pathData="m13.468,11.36v-1.5362l2.6883,2.6883 -2.6883,2.6883v-1.5746c-1.9202,0 -3.2644,0.6145 -4.2245,1.9586 0.384,-1.9202 1.5362,-3.8404 4.2245,-4.2245z"
android:strokeWidth=".26458" />
</group>
</vector>

View File

@ -29,6 +29,7 @@
android:orientation="vertical">
<TextView
android:id="@+id/app_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"

View File

@ -40,17 +40,19 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:padding="2dp"
android:id="@+id/url"
android:textSize="12sp"
android:singleLine="true"
android:textColor="@color/colorAccent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
android:ellipsize="end"
app:layout_constraintTop_toTopOf="parent"/>
android:padding="2dp"
android:singleLine="true"
android:textColor="@color/colorAccent"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/indication"
android:layout_width="match_parent"

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_lite_background">#455A64</color>
</resources>