Merge branch 'develop'

This commit is contained in:
Thomas 2021-01-20 12:05:28 +01:00
commit a962f90cde
549 changed files with 13276 additions and 9572 deletions

3
.gitignore vendored
View File

@ -9,3 +9,6 @@
/gradle.properties
/app/playstore/release/
/app/lite/release/
/app/fdroid/release/

View File

@ -4,10 +4,10 @@ android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
minSdkVersion 19
minSdkVersion 21
targetSdkVersion 29
versionCode 376
versionName "2.36.2"
versionCode 379
versionName "2.37.0"
multiDexEnabled true
renderscriptTargetApi 28 as int
renderscriptSupportModeEnabled true
@ -26,6 +26,8 @@ android {
pseudoLocalesEnabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
@ -38,12 +40,46 @@ android {
fdroid {
applicationId "fr.gouv.etalab.mastodon"
buildConfigField "boolean", "DONATIONS", "true"
buildConfigField "boolean", "lite", "false"
resValue "string", "app_name", "Fedilab"
}
lite {
minSdkVersion 21
applicationId "app.fedilab.lite"
buildConfigField "boolean", "DONATIONS", "true"
buildConfigField "boolean", "lite", "true"
resValue "string", "app_name", "Fedilab Lite"
}
playstore {
applicationId "app.fedilab.android"
buildConfigField "boolean", "DONATIONS", "false"
buildConfigField "boolean", "lite", "false"
resValue "string", "app_name", "Fedilab"
}
}
sourceSets {
playstore {
manifest.srcFile "src/common/AndroidManifest.xml"
assets.srcDirs = ['/src/mains/assets', 'src/common/assets']
java.srcDirs = ['src/main/java', 'src/playstore/java','src/common/java']
res.srcDirs = ['src/main/res', 'src/playstore/res','src/common/res']
}
fdroid {
manifest.srcFile "src/common/AndroidManifest.xml"
assets.srcDirs = ['/src/mains/assets', 'src/common/assets']
java.srcDirs = ['src/main/java', 'src/fdroid/java','src/common/java']
res.srcDirs = ['src/main/res', 'src/fdroid/res','src/common/res']
}
lite {
manifest.srcFile "src/lite/AndroidManifest.xml"
assets.srcDirs = ['/src/mains/assets']
java.srcDirs = ['src/main/java', 'src/lite/java']
res.srcDirs = ['src/main/res', 'src/lite/res']
}
}
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
}
@ -61,11 +97,15 @@ allprojects {
task copyAllReleaseNotes(type: Copy) {
from "$buildDir/../src/main/assets/changelogs/"
include "*.txt"
into "$buildDir/../../fastlane/metadata/android/en-US/changelogs/"
into "$buildDir/../../src/fdroid/fastlane/metadata/android/en-US/changelogs/"
from "$buildDir/../src/main/assets/changelogs/"
include "*.txt"
into "$buildDir/../../src/lite/fastlane/metadata/android/en-US/changelogs/"
}
task gitPushReleaseNotes(type: Exec, dependsOn: 'copyAllReleaseNotes') {
['sh', '-c', "git add $buildDir/../../fastlane/metadata/android/en-US/changelogs/*"].execute().text.trim()
['sh', '-c', "git add $buildDir/../../src/fdroid/fastlane/metadata/android/en-US/changelogs/*"].execute().text.trim()
['sh', '-c', "git add $buildDir/../../src/lite/fastlane/metadata/android/en-US/changelogs/*"].execute().text.trim()
['sh', '-c', "git commit -m 'copy release notes'"].execute().text.trim()
['sh', '-c', "git push"].execute().text.trim()
}
@ -73,13 +113,13 @@ task gitPushReleaseNotes(type: Exec, dependsOn: 'copyAllReleaseNotes') {
dependencies {
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.exifinterface:exifinterface:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.0.2'
implementation 'androidx.browser:browser:1.3.0'
implementation 'androidx.exifinterface:exifinterface:1.3.2'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation "com.github.bumptech.glide:glide:4.11.0"
implementation ("com.github.bumptech.glide:recyclerview-integration:4.11.0") {
// Excludes the support library because it's already included by Glide.
@ -87,17 +127,15 @@ dependencies {
}
annotationProcessor "com.github.bumptech.glide:compiler:4.11.0"
annotationProcessor 'com.android.support:support-annotations:28.0.0'
implementation "org.conscrypt:conscrypt-android:2.4.0"
implementation "com.evernote:android-job:1.2.6"
implementation "com.google.code.gson:gson:2.8.6"
implementation "com.google.guava:guava:28.2-android"
implementation "com.github.chrisbanes:PhotoView:2.3.0"
implementation 'com.r0adkll:slidableactivity:2.1.0'
implementation 'com.github.stom79:country-picker-android:1.2.0'
implementation 'com.github.stom79:mytransl:2.0'
implementation 'com.github.stom79:mytransl:3.0'
implementation 'com.github.stom79:SparkButton:1.0.13'
implementation "com.koushikdutta.async:androidasync:2.+"
implementation 'com.vanniktech:emoji-one:0.6.0'
implementation "com.koushikdutta.async:androidasync:3.+"
implementation 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
implementation 'com.github.franmontiel:LocaleChanger:0.9.2'
implementation 'com.github.GrenderG:Toasty:1.4.2'
@ -108,28 +146,45 @@ dependencies {
implementation 'com.github.mabbas007:TagsEditText:1.0.5'
implementation "com.tonyodev.fetch2:fetch2:2.3.6"
implementation 'jp.wasabeef:glide-transformations:4.0.0'
playstoreImplementation "io.github.kobakei:ratethisapp:1.2.0"
implementation 'ja.burhanrashid52:photoeditor:0.4.0'
api 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
implementation 'com.jaredrummler:cyanea:1.0.2'
implementation "net.gotev:uploadservice:3.5.2"
implementation "net.gotev:uploadservice-okhttp:3.5.2"
implementation "info.guardianproject.netcipher:netcipher:2.0.0-alpha1"
implementation "info.guardianproject.netcipher:netcipher-okhttp3:2.0.0-alpha1"
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.github.adrielcafe:AndroidAudioRecorder:0.3.0'
implementation 'yogesh.firzen:MukkiyaSevaigal:1.0.6'
implementation 'com.iceteck.silicompressorr:silicompressor:2.2.2'
implementation "ch.acra:acra-mail:5.5.0"
implementation "ch.acra:acra-limiter:5.5.0"
implementation "ch.acra:acra-notification:5.5.0"
implementation 'com.github.stom79:Android-WYSIWYG-Editor:3.2.1'
implementation 'com.github.duanhong169:colorpicker:1.1.6'
implementation 'com.github.penfeizhou.android.animation:glide-plugin:2.2.0'
implementation 'com.github.stom79:Android-WYSIWYG-Editor:3.2.1'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation 'com.github.smarteist:autoimageslider:1.3.2'
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.2'
implementation 'com.jaredrummler:cyanea:1.0.2'
implementation 'com.huangyz0918:androidwm-light:0.1.2'
//Flavors
//Playstore
playstoreApi 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
playstoreImplementation "io.github.kobakei:ratethisapp:1.2.0"
playstoreImplementation "org.conscrypt:conscrypt-android:2.4.0"
playstoreImplementation 'com.github.stom79:country-picker-android:1.2.0'
playstoreImplementation 'com.vanniktech:emoji-one:0.6.0'
playstoreImplementation 'ja.burhanrashid52:photoeditor:0.4.0'
//Fdroid
fdroidApi 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
fdroidImplementation "org.conscrypt:conscrypt-android:2.4.0"
fdroidImplementation 'com.github.stom79:country-picker-android:1.2.0'
fdroidImplementation 'com.vanniktech:emoji-one:0.6.0'
fdroidImplementation 'ja.burhanrashid52:photoeditor:0.4.0'
}

View File

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?><!--
Copyright 2017 Thomas Schneider
This file is a part of Fedilab
This program is free software; you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation; either version 3 of the
License, or (at your option) any later version.
Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with Fedilab; if not,
see <http://www.gnu.org/licenses>
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="app.fedilab.android"
android:installLocation="auto">
<application
android:name="app.fedilab.android.activities.MainApplication"
android:requestLegacyExternalStorage="true"
android:allowBackup="false"
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_launcher_bubbles"
android:label="@string/app_name"
android:largeHeap="true"
android:roundIcon="@mipmap/ic_launcher_bubbles_round"
android:supportsRtl="true"
android:theme="@style/AppThemeDark"
android:usesCleartextTraffic="true"
tools:replace="android:allowBackup">
<activity-alias
android:name=".activities.MainActivity.Bubbles"
android:enabled="true"
android:icon="@mipmap/ic_launcher_bubbles"
android:roundIcon="@mipmap/ic_launcher_bubbles_round"
android:targetActivity=".activities.MainActivity">
<meta-data
android:name="icon"
android:value="bubbles" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>
<activity
android:name="app.fedilab.android.activities.PhotoEditorActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name" />
<activity
android:name="app.fedilab.android.activities.OwnerStatusActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask"
android:theme="@style/AppThemeDark_NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.OwnerNotificationChartsActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.OwnerChartsActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.OwnerNotificationActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask"
android:theme="@style/AppThemeDark_NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
android:theme="@style/Base.Theme.AppCompat" />
</application>
</manifest>

View File

Before

Width:  |  Height:  |  Size: 156 KiB

After

Width:  |  Height:  |  Size: 156 KiB

View File

Before

Width:  |  Height:  |  Size: 153 KiB

After

Width:  |  Height:  |  Size: 153 KiB

View File

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 136 KiB

View File

Before

Width:  |  Height:  |  Size: 158 KiB

After

Width:  |  Height:  |  Size: 158 KiB

View File

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 152 KiB

View File

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

View File

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 79 KiB

View File

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 148 KiB

View File

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 162 KiB

View File

Before

Width:  |  Height:  |  Size: 156 KiB

After

Width:  |  Height:  |  Size: 156 KiB

View File

Before

Width:  |  Height:  |  Size: 156 KiB

After

Width:  |  Height:  |  Size: 156 KiB

View File

Before

Width:  |  Height:  |  Size: 155 KiB

After

Width:  |  Height:  |  Size: 155 KiB

View File

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

View File

Before

Width:  |  Height:  |  Size: 150 KiB

After

Width:  |  Height:  |  Size: 150 KiB

View File

Before

Width:  |  Height:  |  Size: 156 KiB

After

Width:  |  Height:  |  Size: 156 KiB

View File

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

View File

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

View File

Before

Width:  |  Height:  |  Size: 156 KiB

After

Width:  |  Height:  |  Size: 156 KiB

View File

Before

Width:  |  Height:  |  Size: 157 KiB

After

Width:  |  Height:  |  Size: 157 KiB

View File

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 114 KiB

View File

Before

Width:  |  Height:  |  Size: 156 KiB

After

Width:  |  Height:  |  Size: 156 KiB

View File

Before

Width:  |  Height:  |  Size: 159 KiB

After

Width:  |  Height:  |  Size: 159 KiB

View File

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 82 KiB

View File

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 154 KiB

View File

@ -2,21 +2,19 @@ package app.fedilab.android.activities;
import android.annotation.SuppressLint;
import androidx.appcompat.app.AppCompatActivity;
import com.vanniktech.emoji.EmojiManager;
import com.vanniktech.emoji.one.EmojiOneProvider;
import app.fedilab.android.helper.Helper;
/**
* Created by Thomas on 16/05/2020.
* Fragment base activity which updates security provider
* Created by Thomas on 12/12/2017.
* Base activity which updates security provider
*/
@SuppressLint("Registered")
public class BaseFragmentActivity extends AppCompatActivity {
public class BaseActivity extends AllBaseActivity {
static {
Helper.installProvider();

View File

@ -0,0 +1,29 @@
package app.fedilab.android.activities;
import com.vanniktech.emoji.EmojiManager;
import com.vanniktech.emoji.one.EmojiOneProvider;
import app.fedilab.android.helper.Helper;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class BaseFragmentActivity extends MainBaseFragmentActivity {
static {
Helper.installProvider();
EmojiManager.install(new EmojiOneProvider());
}
}

View File

@ -22,7 +22,6 @@ import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.MenuItem;
@ -88,7 +87,7 @@ public class OwnerChartsActivity extends BaseActivity implements OnRetrieveChart
private int theme;
private RelativeLayout loader;
private ImageButton validate;
private DatePickerDialog.OnDateSetListener iniDateSetListener =
private final DatePickerDialog.OnDateSetListener iniDateSetListener =
new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year,
@ -100,7 +99,7 @@ public class OwnerChartsActivity extends BaseActivity implements OnRetrieveChart
}
};
private DatePickerDialog.OnDateSetListener endDateSetListener =
private final DatePickerDialog.OnDateSetListener endDateSetListener =
new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year,
@ -257,7 +256,7 @@ public class OwnerChartsActivity extends BaseActivity implements OnRetrieveChart
chart.setVisibility(View.GONE);
loader.setVisibility(View.VISIBLE);
validate.setEnabled(false);
new RetrieveChartsAsyncTask(OwnerChartsActivity.this, dateIni, dateEnd, OwnerChartsActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveChartsAsyncTask(OwnerChartsActivity.this, dateIni, dateEnd, OwnerChartsActivity.this);
}
@ -397,7 +396,7 @@ public class OwnerChartsActivity extends BaseActivity implements OnRetrieveChart
@SuppressLint("ViewConstructor")
public static class CustomMarkerView extends MarkerView {
private TextView tvContent;
private final TextView tvContent;
private MPPointF mOffset;
public CustomMarkerView(Context context, int layoutResource) {
@ -424,8 +423,8 @@ public class OwnerChartsActivity extends BaseActivity implements OnRetrieveChart
}
public static class MyXAxisValueFormatter extends ValueFormatter {
private DateFormat mDataFormat;
private Date mDate;
private final DateFormat mDataFormat;
private final Date mDate;
MyXAxisValueFormatter() {
this.mDataFormat = new SimpleDateFormat("dd.MM", Locale.getDefault());

View File

@ -23,7 +23,6 @@ import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.drawable.ColorDrawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
@ -101,7 +100,7 @@ public class OwnerNotificationActivity extends BaseActivity implements OnRetriev
private Date dateIni, dateEnd;
private View statsDialogView;
private StatisticsNotification statistics;
private DatePickerDialog.OnDateSetListener iniDateSetListener =
private final DatePickerDialog.OnDateSetListener iniDateSetListener =
new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year,
@ -113,7 +112,7 @@ public class OwnerNotificationActivity extends BaseActivity implements OnRetriev
}
};
private DatePickerDialog.OnDateSetListener endDateSetListener =
private final DatePickerDialog.OnDateSetListener endDateSetListener =
new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year,
@ -126,14 +125,14 @@ public class OwnerNotificationActivity extends BaseActivity implements OnRetriev
}
};
private BroadcastReceiver backupFinishedReceiver = new BroadcastReceiver() {
private final BroadcastReceiver backupFinishedReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
max_id = null;
firstLoad = true;
flag_loading = true;
swiped = true;
new RetrieveNotificationsCacheAsyncTask(OwnerNotificationActivity.this, filterNotifications, null, OwnerNotificationActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveNotificationsCacheAsyncTask(OwnerNotificationActivity.this, filterNotifications, null, OwnerNotificationActivity.this);
}
};
@ -222,13 +221,13 @@ public class OwnerNotificationActivity extends BaseActivity implements OnRetriev
swipeRefreshLayout.setColorSchemeColors(
c1, c2, c1
);
new RetrieveNotificationsCacheAsyncTask(OwnerNotificationActivity.this, filterNotifications, null, OwnerNotificationActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveNotificationsCacheAsyncTask(OwnerNotificationActivity.this, filterNotifications, null, OwnerNotificationActivity.this);
swipeRefreshLayout.setOnRefreshListener(() -> {
max_id = null;
firstLoad = true;
flag_loading = true;
swiped = true;
new RetrieveNotificationsCacheAsyncTask(OwnerNotificationActivity.this, filterNotifications, null, OwnerNotificationActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveNotificationsCacheAsyncTask(OwnerNotificationActivity.this, filterNotifications, null, OwnerNotificationActivity.this);
});
lv_notifications.addOnScrollListener(new RecyclerView.OnScrollListener() {
@ -240,7 +239,7 @@ public class OwnerNotificationActivity extends BaseActivity implements OnRetriev
if (firstVisibleItem + visibleItemCount == totalItemCount) {
if (!flag_loading) {
flag_loading = true;
new RetrieveNotificationsCacheAsyncTask(OwnerNotificationActivity.this, filterNotifications, max_id, OwnerNotificationActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveNotificationsCacheAsyncTask(OwnerNotificationActivity.this, filterNotifications, max_id, OwnerNotificationActivity.this);
nextElementLoader.setVisibility(View.VISIBLE);
}
} else {
@ -289,7 +288,7 @@ public class OwnerNotificationActivity extends BaseActivity implements OnRetriev
.setPositiveButton(R.string.close, (dialog, which) -> dialog.dismiss());
dialogBuilder.create().show();
if (statistics == null) {
new RetrieveNotificationStatsAsyncTask(OwnerNotificationActivity.this, OwnerNotificationActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveNotificationStatsAsyncTask(OwnerNotificationActivity.this, OwnerNotificationActivity.this);
} else {
displayStats();
}
@ -376,7 +375,7 @@ public class OwnerNotificationActivity extends BaseActivity implements OnRetriev
firstLoad = true;
flag_loading = true;
swiped = true;
new RetrieveNotificationsCacheAsyncTask(OwnerNotificationActivity.this, filterNotifications, null, OwnerNotificationActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveNotificationsCacheAsyncTask(OwnerNotificationActivity.this, filterNotifications, null, OwnerNotificationActivity.this);
dialog.dismiss();
})
.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());

View File

@ -22,7 +22,6 @@ import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.MenuItem;
@ -91,7 +90,7 @@ public class OwnerNotificationChartsActivity extends BaseActivity implements OnR
private RelativeLayout loader;
private ImageButton validate;
private String status_id;
private DatePickerDialog.OnDateSetListener iniDateSetListener =
private final DatePickerDialog.OnDateSetListener iniDateSetListener =
new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year,
@ -103,7 +102,7 @@ public class OwnerNotificationChartsActivity extends BaseActivity implements OnR
}
};
private DatePickerDialog.OnDateSetListener endDateSetListener =
private final DatePickerDialog.OnDateSetListener endDateSetListener =
new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year,
@ -473,7 +472,7 @@ public class OwnerNotificationChartsActivity extends BaseActivity implements OnR
chart.setVisibility(View.GONE);
loader.setVisibility(View.VISIBLE);
validate.setEnabled(false);
new RetrieveNotificationChartsAsyncTask(OwnerNotificationChartsActivity.this, status_id, dateIni, dateEnd, OwnerNotificationChartsActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveNotificationChartsAsyncTask(OwnerNotificationChartsActivity.this, status_id, dateIni, dateEnd, OwnerNotificationChartsActivity.this);
}
@ -484,7 +483,7 @@ public class OwnerNotificationChartsActivity extends BaseActivity implements OnR
@SuppressLint("ViewConstructor")
public static class CustomMarkerView extends MarkerView {
private TextView tvContent;
private final TextView tvContent;
private MPPointF mOffset;
public CustomMarkerView(Context context, int layoutResource) {
@ -511,8 +510,8 @@ public class OwnerNotificationChartsActivity extends BaseActivity implements OnR
}
public class MyXAxisValueFormatter extends ValueFormatter {
private DateFormat mDataFormat;
private Date mDate;
private final DateFormat mDataFormat;
private final Date mDate;
MyXAxisValueFormatter() {
if (status_id == null) {

View File

@ -23,7 +23,6 @@ import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.drawable.ColorDrawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
@ -106,7 +105,7 @@ public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeeds
private Date dateIni, dateEnd;
private View statsDialogView;
private Statistics statistics;
private DatePickerDialog.OnDateSetListener iniDateSetListener =
private final DatePickerDialog.OnDateSetListener iniDateSetListener =
new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year,
@ -118,7 +117,7 @@ public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeeds
}
};
private DatePickerDialog.OnDateSetListener endDateSetListener =
private final DatePickerDialog.OnDateSetListener endDateSetListener =
new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year,
@ -131,14 +130,14 @@ public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeeds
}
};
private BroadcastReceiver backupFinishedReceiver = new BroadcastReceiver() {
private final BroadcastReceiver backupFinishedReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
max_id = null;
firstLoad = true;
flag_loading = true;
swiped = true;
new RetrieveFeedsAsyncTask(OwnerStatusActivity.this, filterToots, null, OwnerStatusActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveFeedsAsyncTask(OwnerStatusActivity.this, filterToots, null, OwnerStatusActivity.this);
}
};
@ -231,13 +230,13 @@ public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeeds
swipeRefreshLayout.setColorSchemeColors(
c1, c2, c1
);
new RetrieveFeedsAsyncTask(OwnerStatusActivity.this, filterToots, null, OwnerStatusActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveFeedsAsyncTask(OwnerStatusActivity.this, filterToots, null, OwnerStatusActivity.this);
swipeRefreshLayout.setOnRefreshListener(() -> {
max_id = null;
firstLoad = true;
flag_loading = true;
swiped = true;
new RetrieveFeedsAsyncTask(OwnerStatusActivity.this, filterToots, null, OwnerStatusActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveFeedsAsyncTask(OwnerStatusActivity.this, filterToots, null, OwnerStatusActivity.this);
});
lv_status.addOnScrollListener(new RecyclerView.OnScrollListener() {
@ -249,7 +248,7 @@ public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeeds
if (firstVisibleItem + visibleItemCount == totalItemCount) {
if (!flag_loading) {
flag_loading = true;
new RetrieveFeedsAsyncTask(OwnerStatusActivity.this, filterToots, max_id, OwnerStatusActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveFeedsAsyncTask(OwnerStatusActivity.this, filterToots, max_id, OwnerStatusActivity.this);
nextElementLoader.setVisibility(View.VISIBLE);
}
} else {
@ -298,7 +297,7 @@ public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeeds
.setPositiveButton(R.string.close, (dialog, which) -> dialog.dismiss());
dialogBuilder.create().show();
if (statistics == null) {
new RetrieveStatsAsyncTask(OwnerStatusActivity.this, OwnerStatusActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveStatsAsyncTask(OwnerStatusActivity.this, OwnerStatusActivity.this);
} else {
displayStats();
}
@ -409,7 +408,7 @@ public class OwnerStatusActivity extends BaseActivity implements OnRetrieveFeeds
firstLoad = true;
flag_loading = true;
swiped = true;
new RetrieveFeedsAsyncTask(OwnerStatusActivity.this, filterToots, null, OwnerStatusActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveFeedsAsyncTask(OwnerStatusActivity.this, filterToots, null, OwnerStatusActivity.this);
dialog.dismiss();
})
.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());

View File

@ -0,0 +1,38 @@
package app.fedilab.android.activities;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class PixelfedComposeActivity extends BasePixelfedComposeActivity {
@Override
protected void launchPhotoEditor(Uri uri) {
Intent intent = new Intent(PixelfedComposeActivity.this, PhotoEditorActivity.class);
Bundle b = new Bundle();
intent.putExtra("imageUri", uri.toString());
intent.putExtras(b);
startActivity(intent);
}
@Override
protected void displayEmojiPopup() {
}
}

View File

@ -0,0 +1,210 @@
package app.fedilab.android.activities;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;
import com.github.stom79.localepicker.CountryPicker;
import com.github.stom79.mytransl.MyTransL;
import com.github.stom79.mytransl.client.HttpsConnectionException;
import com.github.stom79.mytransl.translate.Translate;
import com.vanniktech.emoji.EmojiPopup;
import java.util.Date;
import java.util.concurrent.TimeUnit;
import app.fedilab.android.R;
import app.fedilab.android.helper.Helper;
import es.dmoral.toasty.Toasty;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class TootActivity extends BaseTootActivity {
private AlertDialog dialogTrans;
@Override
protected boolean actionTranslateClick() {
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
final CountryPicker picker = CountryPicker.newInstance(getString(R.string.which_language)); // dialog title
if (theme == Helper.THEME_LIGHT) {
picker.setStyle(DialogFragment.STYLE_NO_TITLE, R.style.Dialog);
} else {
picker.setStyle(DialogFragment.STYLE_NO_TITLE, R.style.DialogDark);
}
if (toot_content.getText().length() == 0 && toot_cw_content.getText().length() == 0)
return true;
String dateString = sharedpreferences.getString(Helper.LAST_TRANSLATION_TIME, null);
if (dateString != null) {
Date dateCompare = Helper.stringToDate(TootActivity.this, dateString);
Date date = new Date();
if (date.before(dateCompare)) {
Toasty.info(TootActivity.this, getString(R.string.please_wait), Toast.LENGTH_SHORT).show();
return true;
}
}
picker.setListener((name, locale, flagDrawableResID) -> {
picker.dismiss();
AlertDialog.Builder transAlert = new AlertDialog.Builder(TootActivity.this, style);
transAlert.setTitle(R.string.translate_toot);
View popup_trans = getLayoutInflater().inflate(R.layout.popup_translate, new LinearLayout(TootActivity.this), false);
transAlert.setView(popup_trans);
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putString(Helper.LAST_TRANSLATION_TIME, Helper.dateToString(new Date(System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(Helper.SECONDES_BETWEEN_TRANSLATE))));
editor.apply();
TextView yandex_translate = popup_trans.findViewById(R.id.yandex_translate);
yandex_translate.setOnClickListener(v -> {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://translate.yandex.com/"));
startActivity(browserIntent);
});
MyTransL myTransL = MyTransL.getInstance(MyTransL.translatorEngine.YANDEX);
myTransL.setYandexAPIKey(Helper.YANDEX_KEY);
myTransL.setObfuscation(true);
myTransL.setTimeout(60);
if (toot_cw_content.getText().toString().length() > 0)
myTransL.translate(toot_cw_content.getText().toString(), locale, new com.github.stom79.mytransl.client.Results() {
@Override
public void onSuccess(Translate translate) {
try {
if (translate.getTranslatedContent() == null)
return;
ProgressBar trans_progress_cw = popup_trans.findViewById(R.id.trans_progress_cw);
ProgressBar trans_progress_toot = popup_trans.findViewById(R.id.trans_progress_toot);
if (trans_progress_cw != null)
trans_progress_cw.setVisibility(View.GONE);
LinearLayout trans_container = popup_trans.findViewById(R.id.trans_container);
if (trans_container != null) {
TextView cw_trans = popup_trans.findViewById(R.id.cw_trans);
if (cw_trans != null) {
cw_trans.setVisibility(View.VISIBLE);
cw_trans.setText(translate.getTranslatedContent());
}
} else {
Toasty.error(TootActivity.this, getString(R.string.toast_error_translate), Toast.LENGTH_LONG).show();
}
if (trans_progress_cw != null && trans_progress_toot != null && trans_progress_cw.getVisibility() == View.GONE && trans_progress_toot.getVisibility() == View.GONE)
if (dialogTrans.getButton(DialogInterface.BUTTON_NEGATIVE) != null)
dialogTrans.getButton(DialogInterface.BUTTON_NEGATIVE).setEnabled(true);
} catch (IllegalArgumentException e) {
Toasty.error(TootActivity.this, getString(R.string.toast_error_translate), Toast.LENGTH_LONG).show();
}
}
@Override
public void onFail(HttpsConnectionException e) {
e.printStackTrace();
}
});
else {
ProgressBar trans_progress_cw = popup_trans.findViewById(R.id.trans_progress_cw);
trans_progress_cw.setVisibility(View.GONE);
}
if (toot_content.getText().toString().length() > 0)
myTransL.translate(toot_content.getText().toString(), locale, new com.github.stom79.mytransl.client.Results() {
@Override
public void onSuccess(Translate translate) {
try {
if (translate.getTranslatedContent() == null)
return;
ProgressBar trans_progress_cw = popup_trans.findViewById(R.id.trans_progress_cw);
ProgressBar trans_progress_toot = popup_trans.findViewById(R.id.trans_progress_toot);
if (trans_progress_toot != null)
trans_progress_toot.setVisibility(View.GONE);
LinearLayout trans_container = popup_trans.findViewById(R.id.trans_container);
if (trans_container != null) {
TextView toot_trans = popup_trans.findViewById(R.id.toot_trans);
if (toot_trans != null) {
toot_trans.setVisibility(View.VISIBLE);
toot_trans.setText(translate.getTranslatedContent());
}
} else {
Toasty.error(TootActivity.this, getString(R.string.toast_error_translate), Toast.LENGTH_LONG).show();
}
if (trans_progress_cw != null && trans_progress_toot != null && trans_progress_cw.getVisibility() == View.GONE && trans_progress_toot.getVisibility() == View.GONE)
if (dialogTrans.getButton(DialogInterface.BUTTON_NEGATIVE) != null)
dialogTrans.getButton(DialogInterface.BUTTON_NEGATIVE).setEnabled(true);
} catch (IllegalArgumentException e) {
Toasty.error(TootActivity.this, getString(R.string.toast_error_translate), Toast.LENGTH_LONG).show();
}
}
@Override
public void onFail(HttpsConnectionException e) {
e.printStackTrace();
}
});
transAlert.setPositiveButton(R.string.close, (dialog, whichButton) -> dialog.dismiss());
transAlert.setNegativeButton(R.string.validate, (dialog, whichButton) -> {
TextView toot_trans = popup_trans.findViewById(R.id.toot_trans);
TextView cw_trans = popup_trans.findViewById(R.id.cw_trans);
if (toot_trans != null) {
toot_content.setText(toot_trans.getText().toString());
toot_content.setSelection(toot_content.getText().length());
}
if (cw_trans != null)
toot_cw_content.setText(cw_trans.getText().toString());
dialog.dismiss();
});
dialogTrans = transAlert.create();
transAlert.show();
dialogTrans.setOnShowListener(dialog -> {
Button negativeButton = ((AlertDialog) dialog)
.getButton(AlertDialog.BUTTON_NEGATIVE);
if (negativeButton != null)
negativeButton.setEnabled(false);
});
});
picker.show(getSupportFragmentManager(), "COUNTRY_PICKER");
return true;
}
@Override
protected void launchPhotoEditor(Uri uri) {
Intent intent = new Intent(TootActivity.this, PhotoEditorActivity.class);
Bundle b = new Bundle();
intent.putExtra("imageUri", uri.toString());
intent.putExtras(b);
startActivity(intent);
}
@Override
protected void displayEmojiPopup() {
final EmojiPopup emojiPopup = EmojiPopup.Builder.fromRootView(drawer_layout).build(toot_content);
toot_emoji.setOnClickListener(v -> {
emojiPopup.toggle(); // Toggles visibility of the Popup.
});
}
}

View File

@ -0,0 +1,40 @@
package app.fedilab.android.drawers;
import android.content.Intent;
import android.os.Bundle;
import java.util.List;
import app.fedilab.android.activities.OwnerNotificationChartsActivity;
import app.fedilab.android.client.Entities.Notification;
import app.fedilab.android.client.Entities.Status;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class NotificationsListAdapter extends BaseNotificationsListAdapter {
public NotificationsListAdapter(boolean isOnWifi, int behaviorWithAttachments, List<Notification> notifications) {
super(isOnWifi, behaviorWithAttachments, notifications);
}
public void notificationStatusChart(Status status) {
Intent intent = new Intent(context, OwnerNotificationChartsActivity.class);
Bundle b = new Bundle();
b.putString("status_id", status.getReblog() != null ? status.getReblog().getId() : status.getId());
intent.putExtras(b);
context.startActivity(intent);
}
}

View File

@ -0,0 +1,88 @@
package app.fedilab.android.drawers;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
import android.content.Intent;
import android.os.Bundle;
import android.view.inputmethod.InputMethodManager;
import com.vanniktech.emoji.EmojiManager;
import com.vanniktech.emoji.EmojiPopup;
import com.vanniktech.emoji.one.EmojiOneProvider;
import app.fedilab.android.activities.OwnerNotificationChartsActivity;
import app.fedilab.android.asynctasks.PostActionAsyncTask;
import app.fedilab.android.asynctasks.RetrieveFeedsAsyncTask;
import app.fedilab.android.client.API;
import app.fedilab.android.client.Entities.Reaction;
import app.fedilab.android.client.Entities.Status;
import app.fedilab.android.client.Entities.StatusDrawerParams;
import static android.content.Context.INPUT_METHOD_SERVICE;
public class StatusListAdapter extends BaseStatusListAdapter {
public StatusListAdapter(StatusDrawerParams statusDrawerParams) {
super(statusDrawerParams);
}
public void statusAddReactionClick(Status status, ViewHolder holder) {
EmojiManager.install(new EmojiOneProvider());
final EmojiPopup emojiPopup = EmojiPopup.Builder.fromRootView(holder.status_add_reaction).setOnEmojiPopupDismissListener(() -> {
InputMethodManager imm = (InputMethodManager) context.getSystemService(INPUT_METHOD_SERVICE);
assert imm != null;
imm.hideSoftInputFromWindow(holder.status_add_reaction.getWindowToken(), 0);
}).setOnEmojiClickListener((emoji, imageView) -> {
String emojiStr = imageView.getUnicode();
boolean alreadyAdded = false;
for (Reaction reaction : status.getReactions()) {
if (reaction.getName().compareTo(emojiStr) == 0) {
alreadyAdded = true;
reaction.setCount(reaction.getCount() - 1);
if (reaction.getCount() == 0) {
status.getReactions().remove(reaction);
}
notifyStatusChanged(status);
break;
}
}
if (!alreadyAdded) {
Reaction reaction = new Reaction();
reaction.setMe(true);
reaction.setCount(1);
reaction.setName(emojiStr);
status.getReactions().add(0, reaction);
notifyStatusChanged(status);
}
API.StatusAction statusAction;
if (type == RetrieveFeedsAsyncTask.Type.ANNOUNCEMENTS) {
statusAction = alreadyAdded ? API.StatusAction.REMOVE_REACTION : API.StatusAction.ADD_REACTION;
} else {
statusAction = alreadyAdded ? API.StatusAction.REMOVE_PLEROMA_REACTION : API.StatusAction.ADD_PLEROMA_REACTION;
}
new PostActionAsyncTask(context, statusAction, status.getId(), null, emojiStr, StatusListAdapter.this);
})
.build(holder.fake_edittext);
emojiPopup.toggle();
}
protected void notificationCharts(Status status) {
Intent intent = new Intent(context, OwnerNotificationChartsActivity.class);
Bundle b = new Bundle();
b.putString("status_id", status.getReblog() != null ? status.getReblog().getId() : status.getId());
intent.putExtras(b);
context.startActivity(intent);
}
}

View File

@ -0,0 +1,43 @@
package app.fedilab.android.helper;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
import android.content.Context;
import android.content.SharedPreferences;
import org.conscrypt.Conscrypt;
import java.security.Security;
import app.fedilab.android.activities.MainApplication;
public class Helper extends BaseHelper {
public static void installProvider() {
boolean patch_provider = true;
try {
Context ctx = MainApplication.getApp();
SharedPreferences sharedpreferences = ctx.getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
patch_provider = sharedpreferences.getBoolean(Helper.SET_SECURITY_PROVIDER, true);
} catch (Exception ignored) {
}
if (patch_provider) {
try {
Security.insertProviderAt(Conscrypt.newProvider(), 1);
} catch (Exception ignored) {
}
}
}
}

View File

@ -0,0 +1,23 @@
package app.fedilab.android.jobs;
import app.fedilab.android.helper.Helper;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class BackupNotificationsSyncJob extends BaseBackupNotificationsSyncJob {
static {
Helper.installProvider();
}
}

View File

@ -0,0 +1,23 @@
package app.fedilab.android.jobs;
import app.fedilab.android.helper.Helper;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class BackupStatusesSyncJob extends BaseBackupStatusesSyncJob {
static {
Helper.installProvider();
}
}

View File

@ -0,0 +1,23 @@
package app.fedilab.android.jobs;
import app.fedilab.android.helper.Helper;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class NotificationsSyncJob extends BaseNotificationsSyncJob {
static {
Helper.installProvider();
}
}

View File

@ -0,0 +1,23 @@
package app.fedilab.android.jobs;
import app.fedilab.android.helper.Helper;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class ScheduledBoostsSyncJob extends BaseScheduledBoostsSyncJob {
static {
Helper.installProvider();
}
}

View File

@ -0,0 +1,23 @@
package app.fedilab.android.jobs;
import app.fedilab.android.helper.Helper;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class ScheduledTootsSyncJob extends BaseScheduledTootsSyncJob {
static {
Helper.installProvider();
}
}

View File

@ -0,0 +1,23 @@
package app.fedilab.android.services;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
import app.fedilab.android.helper.Helper;
public class LiveNotificationService extends BaseLiveNotificationService {
static {
Helper.installProvider();
}
}

View File

@ -0,0 +1,23 @@
package app.fedilab.android.services;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
import app.fedilab.android.helper.Helper;
public class StreamingFederatedTimelineService extends BaseStreamingFederatedTimelineService {
static {
Helper.installProvider();
}
}

View File

@ -0,0 +1,23 @@
package app.fedilab.android.services;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
import app.fedilab.android.helper.Helper;
public class StreamingHomeTimelineService extends BaseStreamingHomeTimelineService {
static {
Helper.installProvider();
}
}

View File

@ -0,0 +1,23 @@
package app.fedilab.android.services;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
import app.fedilab.android.helper.Helper;
public class StreamingLocalTimelineService extends BaseStreamingLocalTimelineService {
static {
Helper.installProvider();
}
}

View File

@ -14,6 +14,8 @@
* see <http://www.gnu.org/licenses>. */
package app.fedilab.android.activities;
import android.content.Intent;
public class MainActivity extends BaseMainActivity {
@ -21,4 +23,16 @@ public class MainActivity extends BaseMainActivity {
protected void rateThisApp() {
// do nothing
}
@Override
protected void launchOwnerStatusesActivity() {
Intent myIntent = new Intent(MainActivity.this, OwnerStatusActivity.class);
startActivity(myIntent);
}
@Override
protected void launchOwnerNotificationsActivity() {
Intent myIntent = new Intent(MainActivity.this, OwnerNotificationActivity.class);
startActivity(myIntent);
}
}

View File

@ -1,7 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="my_images" path="Android/data/fr.gouv.etalab.mastodon/files/Pictures" />
<paths>
<external-path
name="my_images"
path="Android/data/fr.gouv.etalab.mastodon/files/Pictures" />
<cache-path name="*" path="." />
<cache-path
name="*"
path="." />
</paths>

View File

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?><!--
Copyright 2020 Thomas Schneider
This file is a part of Fedilab
This program is free software; you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation; either version 3 of the
License, or (at your option) any later version.
Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with Fedilab; if not,
see <http://www.gnu.org/licenses>
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="app.fedilab.android"
android:installLocation="auto">
<application
android:name="app.fedilab.android.activities.MainApplication"
android:allowBackup="false"
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_launcher_lite"
android:label="@string/app_name"
android:largeHeap="true"
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher_lite_round"
android:supportsRtl="true"
android:theme="@style/AppThemeDark"
android:usesCleartextTraffic="true"
tools:replace="android:allowBackup,android:icon, android:roundIcon, android:label">
<activity-alias
android:name=".activities.MainActivity.Bubbles"
android:enabled="true"
android:icon="@mipmap/ic_launcher_lite"
android:roundIcon="@mipmap/ic_launcher_lite_round"
android:targetActivity=".activities.MainActivity">
<meta-data
android:name="icon"
android:value="bubbles" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>
</application>
</manifest>

View File

@ -0,0 +1,28 @@
package app.fedilab.android.activities;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
import android.annotation.SuppressLint;
@SuppressLint("Registered")
public class BaseActivity extends AllBaseActivity {
protected void launchOwnerStatusesActivity() {
}
protected void launchOwnerNotificationsActivity() {
}
}

View File

@ -0,0 +1,21 @@
package app.fedilab.android.activities;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class BaseFragmentActivity extends MainBaseFragmentActivity {
}

View File

@ -0,0 +1,34 @@
package app.fedilab.android.activities;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class MainActivity extends BaseMainActivity {
@Override
protected void rateThisApp() {
// do nothing
}
@Override
protected void launchOwnerStatusesActivity() {
// do nothing
}
@Override
protected void launchOwnerNotificationsActivity() {
// do nothing
}
}

View File

@ -0,0 +1,30 @@
package app.fedilab.android.activities;
import android.net.Uri;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class PixelfedComposeActivity extends BasePixelfedComposeActivity {
@Override
protected void launchPhotoEditor(Uri uri) {
}
@Override
protected void displayEmojiPopup() {
}
}

View File

@ -0,0 +1,651 @@
/* Copyright 2019 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
package app.fedilab.android.activities;
import android.app.NotificationManager;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.SeekBar;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.SwitchCompat;
import androidx.core.content.ContextCompat;
import app.fedilab.android.R;
import app.fedilab.android.client.Entities.Account;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.jobs.ApplicationJob;
import app.fedilab.android.jobs.NotificationsSyncJob;
import app.fedilab.android.services.LiveNotificationDelayedService;
import app.fedilab.android.services.LiveNotificationService;
import app.fedilab.android.services.StopDelayedNotificationReceiver;
import app.fedilab.android.services.StopLiveNotificationReceiver;
import app.fedilab.android.sqlite.AccountDAO;
import app.fedilab.android.sqlite.Sqlite;
import es.dmoral.toasty.Toasty;
import static app.fedilab.android.helper.BaseHelper.startStreaming;
/**
* Created by Thomas on 01/07/2019.
* Settings activity
*/
public class SettingsActivity extends BaseActivity {
public static boolean needRestart;
protected int res;
private int style;
private int liveNotificationCount;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
switch (theme) {
case Helper.THEME_LIGHT:
setTheme(R.style.AppTheme);
break;
case Helper.THEME_BLACK:
setTheme(R.style.AppThemeBlack);
break;
default:
setTheme(R.style.AppThemeDark);
}
needRestart = false;
if (getSupportActionBar() != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
assert inflater != null;
View view = inflater.inflate(R.layout.simple_bar, new LinearLayout(SettingsActivity.this), false);
view.setBackground(new ColorDrawable(ContextCompat.getColor(SettingsActivity.this, R.color.cyanea_primary)));
actionBar.setCustomView(view, new ActionBar.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
ImageView toolbar_close = actionBar.getCustomView().findViewById(R.id.toolbar_close);
TextView toolbar_title = actionBar.getCustomView().findViewById(R.id.toolbar_title);
toolbar_close.setOnClickListener(v -> finish());
toolbar_title.setText(R.string.settings);
}
setContentView(R.layout.activity_settings);
if (theme == Helper.THEME_DARK) {
style = R.style.DialogDark;
} else if (theme == Helper.THEME_BLACK) {
style = R.style.DialogBlack;
} else {
style = R.style.Dialog;
}
boolean display_content_after_fetch_more = sharedpreferences.getBoolean(Helper.SET_DISPLAY_CONTENT_AFTER_FM, true);
final SwitchCompat set_display_content_after_fetch_more = findViewById(R.id.set_display_content_after_fetch_more);
set_display_content_after_fetch_more.setChecked(display_content_after_fetch_more);
set_display_content_after_fetch_more.setOnClickListener(v -> {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_DISPLAY_CONTENT_AFTER_FM, set_display_content_after_fetch_more.isChecked());
editor.apply();
});
boolean notif_validation = sharedpreferences.getBoolean(Helper.SET_NOTIF_VALIDATION, false);
final SwitchCompat set_share_validation = findViewById(R.id.set_share_validation);
set_share_validation.setChecked(notif_validation);
set_share_validation.setOnClickListener(v -> {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_NOTIF_VALIDATION, set_share_validation.isChecked());
editor.apply();
});
boolean notif_validation_fav = sharedpreferences.getBoolean(Helper.SET_NOTIF_VALIDATION_FAV, false);
final SwitchCompat set_share_validation_fav = findViewById(R.id.set_share_validation_fav);
set_share_validation_fav.setChecked(notif_validation_fav);
set_share_validation_fav.setOnClickListener(v -> {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_NOTIF_VALIDATION_FAV, set_share_validation_fav.isChecked());
editor.apply();
});
EditText set_invidious_host = findViewById(R.id.set_invidious_host);
String invidiousHost = sharedpreferences.getString(Helper.SET_INVIDIOUS_HOST, null);
if (invidiousHost != null) {
set_invidious_host.setText(invidiousHost);
}
set_invidious_host.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
SharedPreferences.Editor editor = sharedpreferences.edit();
if (s.toString().trim().length() > 0) {
editor.putString(Helper.SET_INVIDIOUS_HOST, s.toString().toLowerCase().trim());
} else {
editor.putString(Helper.SET_INVIDIOUS_HOST, null);
}
editor.apply();
}
});
EditText set_nitter_host = findViewById(R.id.set_nitter_host);
String nitterHost = sharedpreferences.getString(Helper.SET_NITTER_HOST, null);
if (nitterHost != null) {
set_nitter_host.setText(nitterHost);
}
set_nitter_host.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
SharedPreferences.Editor editor = sharedpreferences.edit();
if (s.toString().trim().length() > 0) {
editor.putString(Helper.SET_NITTER_HOST, s.toString().toLowerCase().trim());
} else {
editor.putString(Helper.SET_NITTER_HOST, null);
}
editor.apply();
}
});
TextView set_bibliogram_host = findViewById(R.id.set_bibliogram_host);
String bibliogramHost = sharedpreferences.getString(Helper.SET_BIBLIOGRAM_HOST, null);
if (bibliogramHost != null) {
set_bibliogram_host.setText(bibliogramHost);
}
set_bibliogram_host.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
SharedPreferences.Editor editor = sharedpreferences.edit();
if (s.toString().trim().length() > 0) {
editor.putString(Helper.SET_BIBLIOGRAM_HOST, s.toString().toLowerCase().trim());
} else {
editor.putString(Helper.SET_BIBLIOGRAM_HOST, null);
}
editor.apply();
}
});
boolean expand_cw = sharedpreferences.getBoolean(Helper.SET_EXPAND_CW, false);
final SwitchCompat set_expand_cw = findViewById(R.id.set_expand_cw);
set_expand_cw.setChecked(expand_cw);
set_expand_cw.setOnClickListener(v -> {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_EXPAND_CW, set_expand_cw.isChecked());
editor.apply();
});
boolean expand_media = sharedpreferences.getBoolean(Helper.SET_EXPAND_MEDIA, false);
final SwitchCompat set_expand_media = findViewById(R.id.set_expand_image);
set_expand_media.setChecked(expand_media);
set_expand_media.setOnClickListener(v -> {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_EXPAND_MEDIA, set_expand_media.isChecked());
editor.apply();
});
int truncate_toots_size = sharedpreferences.getInt(Helper.SET_TRUNCATE_TOOTS_SIZE, 0);
SeekBar set_truncate_size = findViewById(R.id.set_truncate_size);
set_truncate_size.setMax(20);
set_truncate_size.setProgress(truncate_toots_size);
TextView set_truncate_toots = findViewById(R.id.set_truncate_toots);
set_truncate_toots.setText(String.valueOf(truncate_toots_size));
set_truncate_size.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
set_truncate_toots.setText(String.valueOf(progress));
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putInt(Helper.SET_TRUNCATE_TOOTS_SIZE, progress);
editor.apply();
}
});
boolean quick_reply = sharedpreferences.getBoolean(Helper.SET_QUICK_REPLY, true);
final SwitchCompat set_quick_reply = findViewById(R.id.set_quick_reply);
set_quick_reply.setChecked(quick_reply);
set_quick_reply.setOnClickListener(v -> {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_QUICK_REPLY, set_quick_reply.isChecked());
editor.apply();
});
boolean fit_preview = sharedpreferences.getBoolean(Helper.SET_FULL_PREVIEW, false);
final SwitchCompat set_fit_preview = findViewById(R.id.set_fit_preview);
set_fit_preview.setChecked(fit_preview);
set_fit_preview.setOnClickListener(v -> {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_FULL_PREVIEW, set_fit_preview.isChecked());
editor.apply();
});
boolean disableGif = sharedpreferences.getBoolean(Helper.SET_DISABLE_GIF, false);
final SwitchCompat set_disable_gif = findViewById(R.id.set_disable_gif);
set_disable_gif.setChecked(disableGif);
set_disable_gif.setOnClickListener(v -> {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_DISABLE_GIF, set_disable_gif.isChecked());
editor.apply();
recreate();
});
boolean disableAnimatedEmoji = sharedpreferences.getBoolean(Helper.SET_DISABLE_ANIMATED_EMOJI, false);
final SwitchCompat set_disable_animated_emoji = findViewById(R.id.set_disable_animated_emoji);
set_disable_animated_emoji.setChecked(disableAnimatedEmoji);
set_disable_animated_emoji.setOnClickListener(v -> {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_DISABLE_ANIMATED_EMOJI, set_disable_animated_emoji.isChecked());
editor.apply();
});
boolean display_card = sharedpreferences.getBoolean(Helper.SET_DISPLAY_CARD, false);
final SwitchCompat set_display_card = findViewById(R.id.set_display_card);
set_display_card.setChecked(display_card);
set_display_card.setOnClickListener(v -> {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_DISPLAY_CARD, set_display_card.isChecked());
editor.apply();
});
boolean notify = sharedpreferences.getBoolean(Helper.SET_NOTIFY, true);
final SwitchCompat switchCompatNotify = findViewById(R.id.set_notify);
switchCompatNotify.setChecked(notify);
switchCompatNotify.setOnCheckedChangeListener((buttonView, isChecked) -> {
// Save the state here
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_NOTIFY, isChecked);
editor.apply();
if (isChecked) {
startStreaming(SettingsActivity.this);
} else {
sendBroadcast(new Intent(getApplicationContext(), StopLiveNotificationReceiver.class));
if (Build.VERSION.SDK_INT >= 26) {
NotificationManager notif = ((NotificationManager) getSystemService(NOTIFICATION_SERVICE));
if (notif != null) {
notif.deleteNotificationChannel(LiveNotificationDelayedService.CHANNEL_ID);
}
}
}
});
SQLiteDatabase db = Sqlite.getInstance(getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
String instance = sharedpreferences.getString(Helper.PREF_INSTANCE, Helper.getLiveInstance(getApplicationContext()));
final Account account = new AccountDAO(getApplicationContext(), db).getUniqAccount(userId, instance);
boolean allow_live_notifications = sharedpreferences.getBoolean(Helper.SET_ALLOW_STREAM + userId + instance, true);
TextView set_allow_live_notifications_title = findViewById(R.id.set_allow_live_notifications_title);
set_allow_live_notifications_title.setText(getString(R.string.set_allow_live_notifications, account.getAcct() + "@" + account.getInstance()));
final SwitchCompat set_allow_live_notifications = findViewById(R.id.set_allow_live_notifications);
set_allow_live_notifications.setChecked(allow_live_notifications);
set_allow_live_notifications.setOnClickListener(v -> {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_ALLOW_STREAM + userId + instance, set_allow_live_notifications.isChecked());
editor.apply();
if (set_allow_live_notifications.isChecked()) {
LiveNotificationDelayedService.totalAccount++;
} else {
LiveNotificationDelayedService.totalAccount--;
}
if (set_allow_live_notifications.isChecked()) {
LiveNotificationDelayedService.totalAccount++;
} else {
LiveNotificationDelayedService.totalAccount--;
}
startStreaming(SettingsActivity.this);
});
final ImageButton set_allow_live_notifications_others = findViewById(R.id.set_allow_live_notifications_others);
set_allow_live_notifications_others.setOnClickListener(view -> {
Intent intent = new Intent(SettingsActivity.this, LiveNotificationSettingsAccountsActivity.class);
startActivity(intent);
});
//Live notification mode
final Spinner set_live_type = findViewById(R.id.set_live_type);
String[] labels = {getString(R.string.live_notif), getString(R.string.live_delayed), getString(R.string.no_live_notif)};
ArrayAdapter<String> adapterLive = new ArrayAdapter<>(SettingsActivity.this,
android.R.layout.simple_spinner_dropdown_item, labels);
LinearLayout live_notif_per_account = findViewById(R.id.live_notif_per_account);
set_live_type.setAdapter(adapterLive);
if (Helper.liveNotifType(SettingsActivity.this) == Helper.NOTIF_NONE) {
live_notif_per_account.setVisibility(View.GONE);
}
TextView set_live_type_indication = findViewById(R.id.set_live_type_indication);
switch (Helper.liveNotifType(SettingsActivity.this)) {
case Helper.NOTIF_LIVE:
set_live_type_indication.setText(R.string.live_notif_indication);
break;
case Helper.NOTIF_DELAYED:
set_live_type_indication.setText(R.string.set_live_type_indication);
break;
case Helper.NOTIF_NONE:
set_live_type_indication.setText(R.string.no_live_indication);
break;
}
set_live_type.setSelection(Helper.liveNotifType(SettingsActivity.this));
liveNotificationCount = 0;
set_live_type.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if (liveNotificationCount > 0) {
SharedPreferences.Editor editor = sharedpreferences.edit();
sendBroadcast(new Intent(SettingsActivity.this, StopLiveNotificationReceiver.class));
sendBroadcast(new Intent(SettingsActivity.this, StopDelayedNotificationReceiver.class));
ApplicationJob.cancelAllJob(NotificationsSyncJob.NOTIFICATION_REFRESH);
switch (position) {
case Helper.NOTIF_LIVE:
editor.putBoolean(Helper.SET_LIVE_NOTIFICATIONS, true);
editor.putBoolean(Helper.SET_DELAYED_NOTIFICATIONS, false);
live_notif_per_account.setVisibility(View.VISIBLE);
editor.commit();
set_live_type_indication.setText(R.string.live_notif_indication);
Handler handler = new Handler();
handler.postDelayed(() -> {
startStreaming(SettingsActivity.this);
}, 1000);
break;
case Helper.NOTIF_DELAYED:
editor.putBoolean(Helper.SET_LIVE_NOTIFICATIONS, false);
editor.putBoolean(Helper.SET_DELAYED_NOTIFICATIONS, true);
live_notif_per_account.setVisibility(View.VISIBLE);
set_live_type_indication.setText(R.string.set_live_type_indication);
editor.commit();
handler = new Handler();
handler.postDelayed(() -> {
startStreaming(SettingsActivity.this);
}, 1000);
break;
case Helper.NOTIF_NONE:
editor.putBoolean(Helper.SET_LIVE_NOTIFICATIONS, false);
editor.putBoolean(Helper.SET_DELAYED_NOTIFICATIONS, false);
editor.commit();
set_live_type_indication.setText(R.string.no_live_indication);
live_notif_per_account.setVisibility(View.GONE);
NotificationsSyncJob.schedule(false);
break;
}
} else {
liveNotificationCount++;
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
boolean clear_cache_exit = sharedpreferences.getBoolean(Helper.SET_CLEAR_CACHE_EXIT, false);
final SwitchCompat set_clear_cache_exit = findViewById(R.id.set_clear_cache_exit);
set_clear_cache_exit.setChecked(clear_cache_exit);
set_clear_cache_exit.setOnClickListener(v -> {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_CLEAR_CACHE_EXIT, set_clear_cache_exit.isChecked());
editor.apply();
});
// NSFW Timeout
SeekBar nsfwTimeoutSeekBar = findViewById(R.id.set_nsfw_timeout);
final TextView set_nsfw_timeout_value = findViewById(R.id.set_nsfw_timeout_value);
nsfwTimeoutSeekBar.setMax(30);
int nsfwTimeout = sharedpreferences.getInt(Helper.SET_NSFW_TIMEOUT, 5);
nsfwTimeoutSeekBar.setProgress(nsfwTimeout);
set_nsfw_timeout_value.setText(String.valueOf(nsfwTimeout));
nsfwTimeoutSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
set_nsfw_timeout_value.setText(String.valueOf(progress));
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putInt(Helper.SET_NSFW_TIMEOUT, progress);
editor.apply();
}
});
final ImageView set_toot_visibility = findViewById(R.id.set_toot_visibility);
if (theme == Helper.THEME_DARK) {
Helper.changeDrawableColor(getApplicationContext(), set_toot_visibility, R.color.dark_text);
} else {
Helper.changeDrawableColor(getApplicationContext(), set_toot_visibility, R.color.white);
}
//Only displayed for non locked accounts
String defaultVisibility = account.isLocked() ? "private" : "public";
String tootVisibility = sharedpreferences.getString(Helper.SET_TOOT_VISIBILITY + "@" + account.getAcct() + "@" + account.getInstance(), defaultVisibility);
switch (tootVisibility) {
case "public":
set_toot_visibility.setImageResource(R.drawable.ic_public);
break;
case "unlisted":
set_toot_visibility.setImageResource(R.drawable.ic_lock_open);
break;
case "private":
set_toot_visibility.setImageResource(R.drawable.ic_lock_outline);
break;
case "direct":
set_toot_visibility.setImageResource(R.drawable.ic_mail_outline);
break;
}
set_toot_visibility.setOnClickListener(v -> {
final SharedPreferences sharedpreferences1 = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
if (theme == Helper.THEME_DARK) {
style = R.style.DialogDark;
} else if (theme == Helper.THEME_BLACK) {
style = R.style.DialogBlack;
} else {
style = R.style.Dialog;
}
AlertDialog.Builder dialog = new AlertDialog.Builder(SettingsActivity.this, style);
dialog.setTitle(R.string.toot_visibility_tilte);
final String[] stringArray = getResources().getStringArray(R.array.toot_visibility);
final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(getApplicationContext(), android.R.layout.simple_list_item_1, stringArray);
dialog.setNegativeButton(R.string.cancel, (dialog12, position) -> dialog12.dismiss());
dialog.setAdapter(arrayAdapter, (dialog1, position) -> {
String visibility = "public";
switch (position) {
case 0:
visibility = "public";
set_toot_visibility.setImageResource(R.drawable.ic_public);
break;
case 1:
visibility = "unlisted";
set_toot_visibility.setImageResource(R.drawable.ic_lock_open);
break;
case 2:
visibility = "private";
set_toot_visibility.setImageResource(R.drawable.ic_lock_outline);
break;
case 3:
visibility = "direct";
set_toot_visibility.setImageResource(R.drawable.ic_mail_outline);
break;
}
SharedPreferences.Editor editor = sharedpreferences1.edit();
editor.putString(Helper.SET_TOOT_VISIBILITY + "@" + account.getAcct() + "@" + account.getInstance(), visibility);
editor.apply();
Toasty.info(getApplicationContext(), getString(R.string.toast_visibility_changed, "@" + account.getAcct() + "@" + account.getInstance()), Toast.LENGTH_SHORT).show();
dialog1.dismiss();
});
dialog.show();
});
int split_size_val = sharedpreferences.getInt(Helper.SET_AUTOMATICALLY_SPLIT_TOOTS_SIZE + userId + instance, Helper.SPLIT_TOOT_SIZE);
LinearLayout set_split_container = findViewById(R.id.set_split_container);
//split size
SeekBar split_size = findViewById(R.id.set_split_size);
final EditText split_text = findViewById(R.id.set_split_text);
split_size.setProgress(0);
split_text.setText(String.valueOf(split_size_val));
split_text.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { }
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
if (charSequence != null && charSequence.length() > 0) {
int newValue = Integer.parseInt(charSequence.toString());
if (newValue > 0) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putInt(Helper.SET_AUTOMATICALLY_SPLIT_TOOTS_SIZE + userId + instance, newValue);
editor.apply();
}
}
}
@Override
public void afterTextChanged(Editable editable) {
}
});
split_size.setMax(5);
split_size.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
int newProgress = (progress + 1) * Helper.SPLIT_TOOT_SIZE;
split_text.setText(String.valueOf(newProgress));
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putInt(Helper.SET_AUTOMATICALLY_SPLIT_TOOTS_SIZE + userId + instance, newProgress);
editor.apply();
}
});
boolean split_toot = sharedpreferences.getBoolean(Helper.SET_AUTOMATICALLY_SPLIT_TOOTS + userId + instance, false);
if (!split_toot) {
set_split_container.setVisibility(View.GONE);
}
final SwitchCompat set_split_toot = findViewById(R.id.set_automatically_split_toot);
set_split_toot.setChecked(split_toot);
set_split_toot.setOnClickListener(v -> {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_AUTOMATICALLY_SPLIT_TOOTS + userId + instance, set_split_toot.isChecked());
editor.apply();
if (set_split_toot.isChecked()) {
set_split_container.setVisibility(View.VISIBLE);
} else {
set_split_container.setVisibility(View.GONE);
}
});
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
}

View File

@ -0,0 +1,34 @@
package app.fedilab.android.activities;
import android.net.Uri;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class TootActivity extends BaseTootActivity {
@Override
protected boolean actionTranslateClick() {
return true;
}
@Override
protected void launchPhotoEditor(Uri uri) {
}
@Override
protected void displayEmojiPopup() {
}
}

View File

@ -0,0 +1,31 @@
package app.fedilab.android.drawers;
import java.util.List;
import app.fedilab.android.client.Entities.Notification;
import app.fedilab.android.client.Entities.Status;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class NotificationsListAdapter extends BaseNotificationsListAdapter {
public NotificationsListAdapter(boolean isOnWifi, int behaviorWithAttachments, List<Notification> notifications) {
super(isOnWifi, behaviorWithAttachments, notifications);
}
public void notificationStatusChart(Status status) {
}
}

View File

@ -0,0 +1,35 @@
package app.fedilab.android.drawers;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
import android.app.Activity;
import android.view.WindowManager;
import app.fedilab.android.client.Entities.Status;
import app.fedilab.android.client.Entities.StatusDrawerParams;
public class StatusListAdapter extends BaseStatusListAdapter {
public StatusListAdapter(StatusDrawerParams statusDrawerParams) {
super(statusDrawerParams);
}
protected void statusAddReactionClick(Status status, ViewHolder holder) {
((Activity) context).getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
}
protected void notificationCharts(Status status) {
}
}

View File

@ -0,0 +1,37 @@
package app.fedilab.android.helper;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
import android.content.Context;
import android.util.AttributeSet;
import androidx.appcompat.widget.AppCompatTextView;
public class CustomTextView extends AppCompatTextView {
public CustomTextView(Context context) {
super(context);
}
public CustomTextView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CustomTextView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
}

View File

@ -0,0 +1,18 @@
package app.fedilab.android.helper;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class Helper extends BaseHelper {
}

View File

@ -0,0 +1,104 @@
package app.fedilab.android.helper;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.util.AttributeSet;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import androidx.core.view.inputmethod.EditorInfoCompat;
import androidx.core.view.inputmethod.InputConnectionCompat;
import androidx.core.view.inputmethod.InputContentInfoCompat;
public class MastalabAutoCompleteTextView extends androidx.appcompat.widget.AppCompatAutoCompleteTextView {
private String[] imgTypeString;
private KeyBoardInputCallbackListener keyBoardInputCallbackListener;
final InputConnectionCompat.OnCommitContentListener callback =
new InputConnectionCompat.OnCommitContentListener() {
@Override
public boolean onCommitContent(InputContentInfoCompat inputContentInfo,
int flags, Bundle opts) {
// read and display inputContentInfo asynchronously
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1 && (flags &
InputConnectionCompat.INPUT_CONTENT_GRANT_READ_URI_PERMISSION) != 0) {
try {
inputContentInfo.requestPermission();
} catch (Exception e) {
return false; // return false if failed
}
}
boolean supported = false;
for (final String mimeType : imgTypeString) {
if (inputContentInfo.getDescription().hasMimeType(mimeType)) {
supported = true;
break;
}
}
if (!supported) {
return false;
}
if (keyBoardInputCallbackListener != null) {
keyBoardInputCallbackListener.onCommitContent(inputContentInfo, flags, opts);
}
return true; // return true if succeeded
}
};
public MastalabAutoCompleteTextView(Context context) {
super(context);
initView();
}
public MastalabAutoCompleteTextView(Context context, AttributeSet attrs) {
super(context, attrs);
setText(getText());
initView();
}
public MastalabAutoCompleteTextView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initView();
}
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
final InputConnection ic = super.onCreateInputConnection(outAttrs);
EditorInfoCompat.setContentMimeTypes(outAttrs,
imgTypeString);
return InputConnectionCompat.createWrapper(ic, outAttrs, callback);
}
private void initView() {
imgTypeString = new String[]{"image/png",
"image/gif",
"image/jpeg",
"image/webp"};
}
public void setKeyBoardInputCallbackListener(KeyBoardInputCallbackListener keyBoardInputCallbackListener) {
this.keyBoardInputCallbackListener = keyBoardInputCallbackListener;
}
@SuppressWarnings("unused")
public String[] getImgTypeString() {
return imgTypeString;
}
@SuppressWarnings("unused")
public void setImgTypeString(String[] imgTypeString) {
this.imgTypeString = imgTypeString;
}
public interface KeyBoardInputCallbackListener {
void onCommitContent(InputContentInfoCompat inputContentInfo,
int flags, Bundle opts);
}
}

View File

@ -0,0 +1,18 @@
package app.fedilab.android.jobs;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class BackupNotificationsSyncJob extends BaseBackupNotificationsSyncJob {
}

View File

@ -0,0 +1,18 @@
package app.fedilab.android.jobs;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class BackupStatusesSyncJob extends BaseBackupStatusesSyncJob {
}

View File

@ -0,0 +1,18 @@
package app.fedilab.android.jobs;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class NotificationsSyncJob extends BaseNotificationsSyncJob {
}

View File

@ -0,0 +1,18 @@
package app.fedilab.android.jobs;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class ScheduledBoostsSyncJob extends BaseScheduledBoostsSyncJob {
}

View File

@ -0,0 +1,18 @@
package app.fedilab.android.jobs;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class ScheduledTootsSyncJob extends BaseScheduledTootsSyncJob {
}

View File

@ -0,0 +1,18 @@
package app.fedilab.android.services;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class LiveNotificationService extends BaseLiveNotificationService {
}

View File

@ -0,0 +1,18 @@
package app.fedilab.android.services;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class StreamingFederatedTimelineService extends BaseStreamingFederatedTimelineService {
}

View File

@ -0,0 +1,18 @@
package app.fedilab.android.services;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class StreamingHomeTimelineService extends BaseStreamingHomeTimelineService {
}

View File

@ -0,0 +1,18 @@
package app.fedilab.android.services;
/* Copyright 2020 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
public class StreamingLocalTimelineService extends BaseStreamingLocalTimelineService {
}

View File

@ -0,0 +1,619 @@
<?xml version="1.0" encoding="utf-8"?><!--
Copyright 2020 Thomas Schneider
This file is a part of Fedilab
This program is free software; you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation; either version 3 of the
License, or (at your option) any later version.
Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with Fedilab; if not,
see <http://www.gnu.org/licenses>.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/activity_vertical_margin"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- EXPAND CW -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_option_margin"
android:layout_marginBottom="@dimen/settings_option_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_weight="1"
android:text="@string/expand_cw"
android:textSize="16sp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_expand_cw"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<!-- EXPAND Images -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_option_margin"
android:layout_marginBottom="@dimen/settings_option_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_weight="1"
android:text="@string/expand_image"
android:textSize="16sp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_expand_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_option_margin"
android:layout_marginBottom="@dimen/settings_option_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_weight="1"
android:text="@string/set_share_validation"
android:textSize="16sp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_share_validation"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_option_margin"
android:layout_marginBottom="@dimen/settings_option_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_weight="1"
android:text="@string/set_share_validation_fav"
android:textSize="16sp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_share_validation_fav"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<!-- DISPLAY QUICK REPLY -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_option_margin"
android:layout_marginBottom="@dimen/settings_option_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_quick_reply"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_quick_reply_indication"
android:textColor="@color/mastodonC2"
android:textSize="12sp" />
</LinearLayout>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_quick_reply"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<!-- FIT PREVIEWS -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_option_margin"
android:layout_marginBottom="@dimen/settings_option_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_fit_preview"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_fit_preview_indication"
android:textColor="@color/mastodonC2"
android:textSize="12sp" />
</LinearLayout>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_fit_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<!-- GIF AVATARS -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_option_margin"
android:layout_marginBottom="@dimen/settings_option_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_weight="1"
android:text="@string/set_disable_gif"
android:textSize="16sp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_disable_gif"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_option_margin"
android:layout_marginBottom="@dimen/settings_option_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_weight="1"
android:text="@string/set_disable_animated_emoji"
android:textSize="16sp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_disable_animated_emoji"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_option_margin"
android:layout_marginBottom="@dimen/settings_option_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_weight="1"
android:text="@string/set_display_card"
android:textSize="16sp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_display_card"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_option_margin"
android:layout_marginBottom="@dimen/settings_option_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_clear_cache_exit"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_clear_cache_exit_indication"
android:textColor="@color/mastodonC2"
android:textSize="12sp" />
</LinearLayout>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_clear_cache_exit"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_option_margin"
android:layout_marginBottom="@dimen/settings_option_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_display_content_after_fetch_more"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_display_content_after_fetch_more_indication"
android:textColor="@color/mastodonC2"
android:textSize="12sp" />
</LinearLayout>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_display_content_after_fetch_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="@dimen/settings_option_margin"
android:layout_marginBottom="@dimen/settings_option_margin"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="10dp"
android:text="@string/set_notify"
android:textSize="16sp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_notify"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center" />
</LinearLayout>
<!-- Choose stream -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<Spinner
android:id="@+id/set_live_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<TextView
android:id="@+id/set_live_type_indication"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/settings_option_margin"
android:textColor="@color/mastodonC2" />
<LinearLayout
android:id="@+id/live_notif_per_account"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_option_margin"
android:layout_marginBottom="@dimen/settings_option_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/set_allow_live_notifications_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_allow_live_notifications"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_allow_live_notifications_indication"
android:textColor="@color/mastodonC2"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_allow_live_notifications"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageButton
android:id="@+id/set_allow_live_notifications_others"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="end"
android:contentDescription="@string/live_notif"
android:padding="5dp"
android:src="@drawable/ic_account_circle_acct" />
</LinearLayout>
</LinearLayout>
<!-- TRUNCATE LONG TOOTS -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_option_margin"
android:layout_marginBottom="@dimen/settings_option_margin"
android:gravity="center_vertical"
android:text="@string/set_truncate_toot"
android:textSize="16sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/settings_option_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/set_truncate_toots"
android:layout_width="20dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:textSize="16sp" />
<SeekBar
android:id="@+id/set_truncate_size"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<!-- NSFW Timeout -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_option_margin"
android:layout_marginBottom="@dimen/settings_option_margin"
android:gravity="center_vertical"
android:text="@string/set_nsfw_timeout"
android:textSize="16sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/set_nsfw_timeout_value"
android:layout_width="20dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:textSize="16sp" />
<SeekBar
android:id="@+id/set_nsfw_timeout"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_option_margin"
android:layout_marginBottom="@dimen/settings_option_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_weight="1"
android:text="@string/set_automatically_split_toot"
android:textSize="16sp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_automatically_split_toot"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:id="@+id/set_split_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/settings_option_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<EditText
android:id="@+id/set_split_text"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:inputType="number"
android:textSize="16sp" />
<SeekBar
android:id="@+id/set_split_size"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:id="@+id/toot_visibility_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_option_margin"
android:layout_marginBottom="@dimen/settings_option_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/toots_visibility_tilte"
android:textSize="16sp" />
<ImageButton
android:id="@+id/set_toot_visibility"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="20dp"
android:contentDescription="@string/toot_visibility_tilte"
android:padding="5dp"
android:src="@drawable/ic_public" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_option_margin"
android:text="@string/set_invidious"
android:textSize="16sp" />
<EditText
android:id="@+id/set_invidious_host"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/settings_option_margin"
android:hint="@string/set_invidious_host"
android:inputType="textWebEditText" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_option_margin"
android:text="@string/set_nitter"
android:textSize="16sp" />
<EditText
android:id="@+id/set_nitter_host"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/settings_option_margin"
android:hint="@string/set_nitter_host"
android:inputType="textWebEditText" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_bibliogram"
android:textSize="16sp" />
<EditText
android:id="@+id/set_bibliogram_host"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/settings_option_margin"
android:hint="@string/set_bibliogram_host"
android:inputType="textWebEditText" />
</LinearLayout>
</ScrollView>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<paths>
<external-path
name="my_images"
path="Android/data/app.fedilab.lite/files/Pictures" />
<cache-path
name="*"
path="." />
</paths>

View File

@ -111,11 +111,12 @@
<service
android:name="app.fedilab.android.services.StreamingLocalTimelineService"
android:exported="false" />
<service
android:name="app.fedilab.android.services.DownloadTrackingDBScriptsService"
android:exported="false" />
<activity
android:name="app.fedilab.android.activities.MainActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask"
android:theme="@style/AppThemeDark_NoActionBar"
android:windowSoftInputMode="adjustResize">
@ -164,20 +165,7 @@
</intent-filter>
</activity>
<activity-alias
android:name=".activities.MainActivity.Bubbles"
android:enabled="true"
android:icon="@mipmap/ic_launcher_bubbles"
android:roundIcon="@mipmap/ic_launcher_bubbles_round"
android:targetActivity=".activities.MainActivity">
<meta-data
android:name="icon"
android:value="bubbles" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>
<activity-alias
android:name=".activities.MainActivity.Fediverse"
@ -258,17 +246,14 @@
<activity
android:name="app.fedilab.android.activities.MastodonRegisterActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.PeertubeRegisterActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.MastodonShareRegisterActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
@ -285,7 +270,6 @@
<activity
android:name="app.fedilab.android.activities.LoginActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
@ -301,158 +285,105 @@
<activity
android:name="app.fedilab.android.activities.ShowAccountActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:theme="@style/AppThemeDark_NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.TootInfoActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.HashTagActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:theme="@style/AppThemeDark_NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.WebviewConnectActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name" />
/>
<activity
android:name="app.fedilab.android.activities.PeertubeActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name" />
/>
<activity
android:name="app.fedilab.android.activities.PlaylistsActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:theme="@style/AppThemeDark_NoActionBar" />
<activity
android:name="app.fedilab.android.activities.PhotoEditorActivity"
android:name=".activities.WebviewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name" />
<activity
android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
android:theme="@style/Base.Theme.AppCompat" />
<activity
android:name="app.fedilab.android.activities.WebviewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name" />
/>
<activity
android:name="app.fedilab.android.activities.SlideMediaActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask"
android:noHistory="true"
android:theme="@style/TransparentDark" />
<activity
android:name="app.fedilab.android.activities.SearchResultActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.SearchResultTabActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.ListActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:theme="@style/AppThemeDark_NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.WhoToFollowActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:theme="@style/AppThemeDark_NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.ShowConversationActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:theme="@style/AppThemeDark_NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.OwnerStatusActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask"
android:theme="@style/AppThemeDark_NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.OwnerNotificationChartsActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.OwnerChartsActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.OwnerNotificationActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask"
android:theme="@style/AppThemeDark_NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.AboutActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.BookmarkActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:theme="@style/AppThemeDark_NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.SettingsActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTop"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.AdminActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.AccountReportActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.ReorderTimelinesActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.PartnerShipActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.InstanceActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.PrivacyActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.TootActivity"
android:configChanges="orientation|screenSize"
android:fitsSystemWindows="true"
android:label="@string/app_name"
android:launchMode="singleTop"
android:theme="@style/AppThemeDark"
android:windowSoftInputMode="adjustResize" />
@ -460,19 +391,16 @@
android:name="app.fedilab.android.activities.PixelfedComposeActivity"
android:configChanges="orientation|screenSize"
android:fitsSystemWindows="true"
android:label="@string/app_name"
android:launchMode="singleTop"
android:theme="@style/AppThemeDark"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.EditProfileActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.CustomSharingActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.InstanceHealthActivity"
@ -498,28 +426,23 @@
<activity
android:name="app.fedilab.android.activities.PeertubeUploadActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.LiveNotificationSettingsAccountsActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:theme="@style/Base.V7.Theme.AppCompat.Dialog"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.MutedInstanceActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.PeertubeEditUploadActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="app.fedilab.android.activities.GroupActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:theme="@style/AppThemeDark_NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden" />

View File

@ -0,0 +1,9 @@
Added:
- Watermarks for pictures (default: disabled)
- Blur sensitive media for Pixelfed
- Put messages into drafts when replying to a deleted message
- Allow to schedule with another account
Fixed:
- Quick replies lose text when doing another action
- Fix refresh token (Peertube/Pixelfed)

View File

@ -0,0 +1,9 @@
Added:
- Watermarks for pictures (default: disabled)
- Blur sensitive media for Pixelfed
- Put messages into drafts when replying to a deleted message
- Allow to schedule with another account
Fixed:
- Quick replies lose text when doing another action
- Fix refresh token (Peertube/Pixelfed)

View File

@ -0,0 +1,11 @@
Added:
- Offset for replies in threads with a new decoration to make them easier to read
- Fix translation issue (use https://translate.fedilab.app)
- Watermarks for pictures (default: disabled)
- Blur sensitive media for Pixelfed
- Put messages into drafts when replying to a deleted message
- Allow to schedule with another account
Fixed:
- Quick replies lose text when doing another action
- Fix refresh token (Peertube/Pixelfed)

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -20,7 +20,6 @@ import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.style.UnderlineSpan;
@ -64,9 +63,9 @@ import es.dmoral.toasty.Toasty;
public class AboutActivity extends BaseActivity implements OnRetrieveRemoteAccountInterface, OnRetrieveRelationshipInterface {
private List<Account> developers = new ArrayList<>();
private List<Account> contributors = new ArrayList<>();
private List<Account> uxuidesigners = new ArrayList<>();
private final List<Account> developers = new ArrayList<>();
private final List<Account> contributors = new ArrayList<>();
private final List<Account> uxuidesigners = new ArrayList<>();
private AccountSearchDevAdapter accountSearchWebAdapterDeveloper;
private AccountSearchDevAdapter accountSearchWebAdapterContributors;
@ -208,17 +207,17 @@ public class AboutActivity extends BaseActivity implements OnRetrieveRemoteAccou
lv_ux.setAdapter(accountSearchWebAdapterUxUiDesigners);
if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
new RetrieveRemoteDataAsyncTask(AboutActivity.this, "fedilab", "toot.fedilab.app", AboutActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveRemoteDataAsyncTask(AboutActivity.this, "mmarif", "mastodon.social", AboutActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveRemoteDataAsyncTask(AboutActivity.this, "PhotonQyv", "mastodon.xyz", AboutActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveRemoteDataAsyncTask(AboutActivity.this, "angrytux", "social.tchncs.de", AboutActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveRemoteDataAsyncTask(AboutActivity.this, "guzzisti", "mastodon.social", AboutActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveRemoteDataAsyncTask(AboutActivity.this, "apps", "toot.fedilab.app", AboutActivity.this);
new RetrieveRemoteDataAsyncTask(AboutActivity.this, "mmarif", "mastodon.social", AboutActivity.this);
new RetrieveRemoteDataAsyncTask(AboutActivity.this, "PhotonQyv", "mastodon.xyz", AboutActivity.this);
new RetrieveRemoteDataAsyncTask(AboutActivity.this, "angrytux", "social.tchncs.de", AboutActivity.this);
new RetrieveRemoteDataAsyncTask(AboutActivity.this, "guzzisti", "mastodon.social", AboutActivity.this);
} else {
SpannableString name = new SpannableString("@fedilab@toot.fedilab.app");
SpannableString name = new SpannableString("@apps@toot.fedilab.app");
name.setSpan(new UnderlineSpan(), 0, name.length(), 0);
txt_developers.setText(name);
txt_developers.setVisibility(View.VISIBLE);
txt_developers.setOnClickListener(v -> Helper.openBrowser(AboutActivity.this, "https://toot.fedilab.app/@fedilab"));
txt_developers.setOnClickListener(v -> Helper.openBrowser(AboutActivity.this, "https://toot.fedilab.app/@apps"));
name = new SpannableString("@mmarif@mastodon.social");
name.setSpan(new UnderlineSpan(), 0, name.length(), 0);
txt_ux.setText(name);
@ -260,7 +259,7 @@ public class AboutActivity extends BaseActivity implements OnRetrieveRemoteAccou
account = accounts.get(0);
account.setFollowing(true);
switch (account.getUsername()) {
case "fedilab":
case "apps":
developers.add(account);
accountSearchWebAdapterDeveloper.notifyDataSetChanged();
break;
@ -273,7 +272,7 @@ public class AboutActivity extends BaseActivity implements OnRetrieveRemoteAccou
accountSearchWebAdapterContributors.notifyDataSetChanged();
break;
}
new RetrieveRelationshipAsyncTask(AboutActivity.this, account.getId(), AboutActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveRelationshipAsyncTask(AboutActivity.this, account.getId(), AboutActivity.this);
}
}
@ -283,17 +282,17 @@ public class AboutActivity extends BaseActivity implements OnRetrieveRemoteAccou
super.onResume();
if (developers != null) {
for (Account account : developers) {
new RetrieveRelationshipAsyncTask(AboutActivity.this, account.getId(), AboutActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveRelationshipAsyncTask(AboutActivity.this, account.getId(), AboutActivity.this);
}
}
if (contributors != null) {
for (Account account : contributors) {
new RetrieveRelationshipAsyncTask(AboutActivity.this, account.getId(), AboutActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveRelationshipAsyncTask(AboutActivity.this, account.getId(), AboutActivity.this);
}
}
if (uxuidesigners != null) {
for (Account account : uxuidesigners) {
new RetrieveRelationshipAsyncTask(AboutActivity.this, account.getId(), AboutActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveRelationshipAsyncTask(AboutActivity.this, account.getId(), AboutActivity.this);
}
}
}

View File

@ -19,7 +19,6 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.PorterDuff;
import android.graphics.drawable.ColorDrawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
@ -139,7 +138,7 @@ public class AccountReportActivity extends BaseActivity implements OnAdminAction
assign.setVisibility(View.GONE);
status.setVisibility(View.GONE);
if (account_id != null) {
new PostAdminActionAsyncTask(AccountReportActivity.this, API.adminAction.GET_ONE_ACCOUNT, account_id, null, AccountReportActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new PostAdminActionAsyncTask(AccountReportActivity.this, API.adminAction.GET_ONE_ACCOUNT, account_id, null, AccountReportActivity.this);
return;
}
if (report != null) {
@ -157,7 +156,7 @@ public class AccountReportActivity extends BaseActivity implements OnAdminAction
Group statuses_group = findViewById(R.id.statuses_group);
statuses_group.setVisibility(View.VISIBLE);
if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
new PostAdminActionAsyncTask(AccountReportActivity.this, API.adminAction.GET_ONE_ACCOUNT, report.getTarget_account().getUsername(), null, AccountReportActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new PostAdminActionAsyncTask(AccountReportActivity.this, API.adminAction.GET_ONE_ACCOUNT, report.getTarget_account().getUsername(), null, AccountReportActivity.this);
}
}
@ -227,13 +226,13 @@ public class AccountReportActivity extends BaseActivity implements OnAdminAction
reject.setOnClickListener(view -> {
AdminAction adminAction = new AdminAction();
adminAction.setType(REJECT);
new PostAdminActionAsyncTask(AccountReportActivity.this, REJECT, account_id, adminAction, AccountReportActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new PostAdminActionAsyncTask(AccountReportActivity.this, REJECT, account_id, adminAction, AccountReportActivity.this);
});
allow.setOnClickListener(view -> {
AdminAction adminAction = new AdminAction();
adminAction.setType(APPROVE);
new PostAdminActionAsyncTask(AccountReportActivity.this, APPROVE, account_id, adminAction, AccountReportActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new PostAdminActionAsyncTask(AccountReportActivity.this, APPROVE, account_id, adminAction, AccountReportActivity.this);
});
warn.setOnClickListener(view -> {
@ -241,7 +240,7 @@ public class AccountReportActivity extends BaseActivity implements OnAdminAction
adminAction.setType(NONE);
adminAction.setSend_email_notification(email_user.isChecked());
adminAction.setText(comment.getText().toString().trim());
new PostAdminActionAsyncTask(AccountReportActivity.this, NONE, account_id, adminAction, AccountReportActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new PostAdminActionAsyncTask(AccountReportActivity.this, NONE, account_id, adminAction, AccountReportActivity.this);
});
@ -256,9 +255,9 @@ public class AccountReportActivity extends BaseActivity implements OnAdminAction
adminAction.setType(SILENCE);
adminAction.setSend_email_notification(email_user.isChecked());
adminAction.setText(comment.getText().toString().trim());
new PostAdminActionAsyncTask(AccountReportActivity.this, SILENCE, account_id, adminAction, AccountReportActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new PostAdminActionAsyncTask(AccountReportActivity.this, SILENCE, account_id, adminAction, AccountReportActivity.this);
} else {
new PostAdminActionAsyncTask(AccountReportActivity.this, API.adminAction.UNSILENCE, account_id, null, AccountReportActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new PostAdminActionAsyncTask(AccountReportActivity.this, API.adminAction.UNSILENCE, account_id, null, AccountReportActivity.this);
}
});
@ -273,9 +272,9 @@ public class AccountReportActivity extends BaseActivity implements OnAdminAction
adminAction.setType(DISABLE);
adminAction.setSend_email_notification(email_user.isChecked());
adminAction.setText(comment.getText().toString().trim());
new PostAdminActionAsyncTask(AccountReportActivity.this, DISABLE, account_id, adminAction, AccountReportActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new PostAdminActionAsyncTask(AccountReportActivity.this, DISABLE, account_id, adminAction, AccountReportActivity.this);
} else {
new PostAdminActionAsyncTask(AccountReportActivity.this, API.adminAction.ENABLE, account_id, null, AccountReportActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new PostAdminActionAsyncTask(AccountReportActivity.this, API.adminAction.ENABLE, account_id, null, AccountReportActivity.this);
}
});
if (!accountAdmin.isSuspended()) {
@ -289,9 +288,9 @@ public class AccountReportActivity extends BaseActivity implements OnAdminAction
adminAction.setType(SUSPEND);
adminAction.setSend_email_notification(email_user.isChecked());
adminAction.setText(comment.getText().toString().trim());
new PostAdminActionAsyncTask(AccountReportActivity.this, SUSPEND, account_id, adminAction, AccountReportActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new PostAdminActionAsyncTask(AccountReportActivity.this, SUSPEND, account_id, adminAction, AccountReportActivity.this);
} else {
new PostAdminActionAsyncTask(AccountReportActivity.this, API.adminAction.UNSUSPEND, account_id, null, AccountReportActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new PostAdminActionAsyncTask(AccountReportActivity.this, API.adminAction.UNSUSPEND, account_id, null, AccountReportActivity.this);
}
});
@ -423,9 +422,9 @@ public class AccountReportActivity extends BaseActivity implements OnAdminAction
}
assign.setOnClickListener(view -> {
if (report.getAssigned_account() == null) {
new PostAdminActionAsyncTask(AccountReportActivity.this, API.adminAction.ASSIGN_TO_SELF, report.getId(), null, AccountReportActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new PostAdminActionAsyncTask(AccountReportActivity.this, API.adminAction.ASSIGN_TO_SELF, report.getId(), null, AccountReportActivity.this);
} else {
new PostAdminActionAsyncTask(AccountReportActivity.this, API.adminAction.UNASSIGN, report.getId(), null, AccountReportActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new PostAdminActionAsyncTask(AccountReportActivity.this, API.adminAction.UNASSIGN, report.getId(), null, AccountReportActivity.this);
}
});
if (report.isAction_taken()) {
@ -435,9 +434,9 @@ public class AccountReportActivity extends BaseActivity implements OnAdminAction
}
status.setOnClickListener(view -> {
if (report.isAction_taken()) {
new PostAdminActionAsyncTask(AccountReportActivity.this, API.adminAction.REOPEN, report.getId(), null, AccountReportActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new PostAdminActionAsyncTask(AccountReportActivity.this, API.adminAction.REOPEN, report.getId(), null, AccountReportActivity.this);
} else {
new PostAdminActionAsyncTask(AccountReportActivity.this, API.adminAction.RESOLVE, report.getId(), null, AccountReportActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new PostAdminActionAsyncTask(AccountReportActivity.this, API.adminAction.RESOLVE, report.getId(), null, AccountReportActivity.this);
}
});

View File

@ -19,14 +19,11 @@ import androidx.core.content.ContextCompat;
import com.franmontiel.localechanger.LocaleChanger;
import com.google.android.material.snackbar.Snackbar;
import com.jaredrummler.cyanea.app.CyaneaAppCompatActivity;
import com.vanniktech.emoji.EmojiManager;
import com.vanniktech.emoji.one.EmojiOneProvider;
import org.jetbrains.annotations.NotNull;
import java.util.Timer;
import app.fedilab.android.helper.Helper;
import es.dmoral.toasty.Toasty;
/**
@ -35,17 +32,13 @@ import es.dmoral.toasty.Toasty;
*/
@SuppressLint("Registered")
public class BaseActivity extends CyaneaAppCompatActivity {
public class AllBaseActivity extends CyaneaAppCompatActivity {
public static final int READ_WRITE_STORAGE = 52;
public static Timer timer;
public static boolean canShowActionMode = true;
static {
Helper.installProvider();
EmojiManager.install(new EmojiOneProvider());
}
private ProgressDialog mProgressDialog;
@ -140,7 +133,7 @@ public class BaseActivity extends CyaneaAppCompatActivity {
if (view != null) {
Snackbar.make(view, message, Snackbar.LENGTH_SHORT).show();
} else {
Toasty.info(BaseActivity.this, message, Toast.LENGTH_SHORT).show();
Toasty.info(AllBaseActivity.this, message, Toast.LENGTH_SHORT).show();
}
}

View File

@ -149,8 +149,7 @@ import app.fedilab.android.interfaces.OnRetrieveRemoteAccountInterface;
import app.fedilab.android.interfaces.OnSyncTimelineInterface;
import app.fedilab.android.interfaces.OnUpdateAccountInfoInterface;
import app.fedilab.android.services.BackupStatusService;
import app.fedilab.android.services.LiveNotificationDelayedService;
import app.fedilab.android.services.LiveNotificationService;
import app.fedilab.android.services.DownloadTrackingDBScriptsService;
import app.fedilab.android.sqlite.AccountDAO;
import app.fedilab.android.sqlite.Sqlite;
import app.fedilab.android.sqlite.TempMuteDAO;
@ -160,6 +159,7 @@ import es.dmoral.toasty.Toasty;
import static app.fedilab.android.activities.WebviewActivity.trackingDomains;
import static app.fedilab.android.asynctasks.ManageFiltersAsyncTask.action.GET_ALL_FILTER;
import static app.fedilab.android.helper.BaseHelper.startStreaming;
import static app.fedilab.android.helper.Helper.changeDrawableColor;
@ -183,9 +183,9 @@ public abstract class BaseMainActivity extends BaseActivity
public static iconLauncher mLauncher = iconLauncher.BUBBLES;
private static boolean notificationChecked = false;
private final int PICK_IMPORT = 5556;
private final HashMap<String, String> tagTile = new HashMap<>();
private final HashMap<String, Integer> tagItem = new HashMap<>();
private FloatingActionButton toot, delete_all, add_new;
private HashMap<String, String> tagTile = new HashMap<>();
private HashMap<String, Integer> tagItem = new HashMap<>();
private TextView toolbarTitle;
private SearchView toolbar_search;
private View headerLayout;
@ -312,10 +312,11 @@ public abstract class BaseMainActivity extends BaseActivity
//This task will allow to instance a static PeertubeInformation class
if (social == UpdateAccountInfoAsyncTask.SOCIAL.PEERTUBE) {
try {
new RetrievePeertubeInformationAsyncTask(BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrievePeertubeInformationAsyncTask(BaseMainActivity.this);
} catch (Exception ignored) {
}
}
//Here, the user is authenticated
appBar = findViewById(R.id.appBar);
Toolbar toolbar = findViewById(R.id.toolbar);
@ -419,7 +420,7 @@ public abstract class BaseMainActivity extends BaseActivity
main_app_container = findViewById(R.id.main_app_container);
if (social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA || social == UpdateAccountInfoAsyncTask.SOCIAL.GNU || social == UpdateAccountInfoAsyncTask.SOCIAL.FRIENDICA) {
new SyncTimelinesAsyncTask(BaseMainActivity.this, 0, Helper.canFetchList(BaseMainActivity.this, account), BaseMainActivity.this).execute();
new SyncTimelinesAsyncTask(BaseMainActivity.this, 0, Helper.canFetchList(BaseMainActivity.this, account), BaseMainActivity.this);
} else if (social == UpdateAccountInfoAsyncTask.SOCIAL.PEERTUBE) {
TabLayout.Tab pTabsub = tabLayout.newTab();
@ -638,9 +639,10 @@ public abstract class BaseMainActivity extends BaseActivity
} else {
style = R.style.Dialog;
}
Helper.startStreaming(BaseMainActivity.this);
boolean popupShown = sharedpreferences.getBoolean(Helper.SET_POPUP_PUSH, false);
if (popupShown) {
Helper.startStreaming(BaseMainActivity.this);
}
if (hidde_menu != null)
LocalBroadcastManager.getInstance(BaseMainActivity.this).unregisterReceiver(hidde_menu);
@ -707,7 +709,7 @@ public abstract class BaseMainActivity extends BaseActivity
int position = 0;
if (tabLayout != null)
position = tabLayout.getSelectedTabPosition();
new SyncTimelinesAsyncTask(BaseMainActivity.this, position, true, BaseMainActivity.this).execute();
new SyncTimelinesAsyncTask(BaseMainActivity.this, position, true, BaseMainActivity.this);
}
};
LocalBroadcastManager.getInstance(BaseMainActivity.this).registerReceiver(hidde_menu, new IntentFilter(Helper.RECEIVE_HIDE_ITEM));
@ -930,6 +932,9 @@ public abstract class BaseMainActivity extends BaseActivity
if (action_size != null)
action_size.setVisible(false);
}
if (BuildConfig.lite) {
popup.getMenu().findItem(R.id.action_send_invitation).setVisible(false);
}
popup.setOnMenuItemClickListener(item -> {
switch (item.getItemId()) {
@ -969,7 +974,7 @@ public abstract class BaseMainActivity extends BaseActivity
}
return true;
case R.id.action_cache:
new Helper.CacheTask(BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new Helper.CacheTask(BaseMainActivity.this);
return true;
case R.id.action_size:
final SharedPreferences sharedpreferences1 = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
@ -1106,11 +1111,7 @@ public abstract class BaseMainActivity extends BaseActivity
Helper.updateHeaderAccountInfo(activity, account, headerLayout);
//Locked account can see follow request
if (MainActivity.social != UpdateAccountInfoAsyncTask.SOCIAL.GNU && MainActivity.social != UpdateAccountInfoAsyncTask.SOCIAL.FRIENDICA) {
if (account.isLocked()) {
navigationView.getMenu().findItem(R.id.nav_follow_request).setVisible(true);
} else {
navigationView.getMenu().findItem(R.id.nav_follow_request).setVisible(false);
}
navigationView.getMenu().findItem(R.id.nav_follow_request).setVisible(account.isLocked());
}
if (!BuildConfig.DONATIONS) {
@ -1162,7 +1163,7 @@ public abstract class BaseMainActivity extends BaseActivity
});
// Asked once for notification opt-in
boolean popupShown = sharedpreferences.getBoolean(Helper.SET_POPUP_PUSH, false);
if (!popupShown && (social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA)) {
if (theme == Helper.THEME_DARK) {
style = R.style.DialogDark;
@ -1196,7 +1197,7 @@ public abstract class BaseMainActivity extends BaseActivity
set_live_type_indication.setText(R.string.no_live_indication);
break;
}
set_live_type.setSelection(Helper.liveNotifType(BaseMainActivity.this));
set_live_type.setSelection(Helper.liveNotifType(BaseMainActivity.this), false);
set_live_type.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
@ -1206,15 +1207,13 @@ public abstract class BaseMainActivity extends BaseActivity
editor.putBoolean(Helper.SET_LIVE_NOTIFICATIONS, true);
editor.putBoolean(Helper.SET_DELAYED_NOTIFICATIONS, false);
editor.apply();
Intent streamingIntent = new Intent(BaseMainActivity.this, LiveNotificationService.class);
startService(streamingIntent);
startStreaming(BaseMainActivity.this);
break;
case Helper.NOTIF_DELAYED:
editor.putBoolean(Helper.SET_LIVE_NOTIFICATIONS, false);
editor.putBoolean(Helper.SET_DELAYED_NOTIFICATIONS, true);
streamingIntent = new Intent(BaseMainActivity.this, LiveNotificationDelayedService.class);
startService(streamingIntent);
editor.apply();
startStreaming(BaseMainActivity.this);
break;
case Helper.NOTIF_NONE:
editor.putBoolean(Helper.SET_LIVE_NOTIFICATIONS, false);
@ -1245,7 +1244,7 @@ public abstract class BaseMainActivity extends BaseActivity
dialogBuilderOptin.setPositiveButton(R.string.validate, (dialog, id) -> {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_POPUP_PUSH, true);
editor.apply();
editor.commit();
});
try {
@ -1260,7 +1259,7 @@ public abstract class BaseMainActivity extends BaseActivity
int versionCode = BuildConfig.VERSION_CODE;
if (lastReleaseNoteRead != versionCode) { //Need to push release notes
if (social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
new RetrieveRemoteDataAsyncTask(BaseMainActivity.this, BaseMainActivity.this).execute();
new RetrieveRemoteDataAsyncTask(BaseMainActivity.this, BaseMainActivity.this);
}
try (BufferedReader reader = new BufferedReader(
new InputStreamReader(getAssets().open("changelogs/" + versionCode + ".txt")))) {
@ -1316,11 +1315,12 @@ public abstract class BaseMainActivity extends BaseActivity
if (social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA || social == UpdateAccountInfoAsyncTask.SOCIAL.GNU || social == UpdateAccountInfoAsyncTask.SOCIAL.FRIENDICA) {
// Retrieves instance
new RetrieveInstanceAsyncTask(BaseMainActivity.this, BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveInstanceAsyncTask(BaseMainActivity.this, BaseMainActivity.this);
// Retrieves filters
if (social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
new ManageFiltersAsyncTask(BaseMainActivity.this, GET_ALL_FILTER, null, BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new ManageFiltersAsyncTask(BaseMainActivity.this, GET_ALL_FILTER, null, BaseMainActivity.this);
}
}
/* Clean cache for statuses */
@ -1330,11 +1330,27 @@ public abstract class BaseMainActivity extends BaseActivity
new TimelineCacheDAO(BaseMainActivity.this, db).removeAfterDate(dateString);
});
if (Helper.isLoggedIn(BaseMainActivity.this)) {
new UpdateAccountInfoByIDAsyncTask(BaseMainActivity.this, social, BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
final Handler handler = new Handler();
handler.postDelayed(() -> new UpdateAccountInfoByIDAsyncTask(BaseMainActivity.this, account, BaseMainActivity.this), 2000);
}
mutedAccount = new TempMuteDAO(BaseMainActivity.this, db).getAllTimeMuted(account);
if (social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
new RetrieveFeedsAsyncTask(BaseMainActivity.this, RetrieveFeedsAsyncTask.Type.ANNOUNCEMENTS, null, BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
final Handler handler = new Handler();
handler.postDelayed(() -> {
new RetrieveFeedsAsyncTask(BaseMainActivity.this, RetrieveFeedsAsyncTask.Type.ANNOUNCEMENTS, null, BaseMainActivity.this);
if (BuildConfig.lite) {
String datesupdate = sharedpreferences.getString(Helper.TRACKING_LAST_UPDATE, null);
Date dateLastUpdate = Helper.stringToDate(BaseMainActivity.this, datesupdate);
Date dateUpdate = new Date(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(10));
//Refresh tracking db if needed
if (datesupdate == null || dateUpdate.after(dateLastUpdate)) {
Intent scriptIntent = new Intent(BaseMainActivity.this, DownloadTrackingDBScriptsService.class);
startService(scriptIntent);
}
}
}, 3000);
}
}
@ -1439,21 +1455,19 @@ public abstract class BaseMainActivity extends BaseActivity
} else if (extras.getInt(Helper.INTENT_ACTION) == Helper.ADD_USER_INTENT) {
this.recreate();
} else if (extras.getInt(Helper.INTENT_ACTION) == Helper.BACKUP_INTENT) {
Intent myIntent = new Intent(BaseMainActivity.this, OwnerStatusActivity.class);
startActivity(myIntent);
launchOwnerStatusesActivity();
} else if (extras.getInt(Helper.INTENT_ACTION) == Helper.BACKUP_NOTIFICATION_INTENT) {
Intent myIntent = new Intent(BaseMainActivity.this, OwnerNotificationActivity.class);
startActivity(myIntent);
launchOwnerNotificationsActivity();
} else if (extras.getInt(Helper.INTENT_ACTION) == Helper.REDRAW_MENU) {
Helper.hideMenuItem(BaseMainActivity.this, navigationView.getMenu());
} else if (extras.getInt(Helper.INTENT_ACTION) == Helper.SEARCH_TAG) {
new SyncTimelinesAsyncTask(BaseMainActivity.this, -1, false, BaseMainActivity.this).execute();
new SyncTimelinesAsyncTask(BaseMainActivity.this, -1, false, BaseMainActivity.this);
} else if (extras.getInt(Helper.INTENT_ACTION) == Helper.REFRESH_TIMELINE) {
int position = 0;
boolean refreshList = extras.getBoolean(Helper.REFRESH_LIST_TIMELINE, false);
if (tabLayout != null)
position = tabLayout.getSelectedTabPosition();
new SyncTimelinesAsyncTask(BaseMainActivity.this, position, refreshList, BaseMainActivity.this).execute();
new SyncTimelinesAsyncTask(BaseMainActivity.this, position, refreshList, BaseMainActivity.this);
} else if (extras.getInt(Helper.INTENT_ACTION) == Helper.SEARCH_REMOTE) {
String url = extras.getString(Helper.SEARCH_URL);
intent.replaceExtras(new Bundle());
@ -1474,7 +1488,7 @@ public abstract class BaseMainActivity extends BaseActivity
if (!isUrl)
return;
//Here we know that the intent contains a valid URL
new RetrieveRemoteDataAsyncTask(BaseMainActivity.this, url, BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveRemoteDataAsyncTask(BaseMainActivity.this, url, BaseMainActivity.this);
}
} else if (Intent.ACTION_SEND.equals(action) && type != null) {
if ("text/plain".equals(type)) {
@ -1499,7 +1513,7 @@ public abstract class BaseMainActivity extends BaseActivity
if (matchStart < matchEnd && sharedText.length() >= matchEnd)
url = sharedText.substring(matchStart, matchEnd);
}
new RetrieveMetaDataAsyncTask(BaseMainActivity.this, shouldRetrieveMetaData, sharedSubject, sharedText, url, BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveMetaDataAsyncTask(BaseMainActivity.this, shouldRetrieveMetaData, sharedSubject, sharedText, url, BaseMainActivity.this);
}
} else if (type.startsWith("image/") || type.startsWith("video/")) {
@ -1561,7 +1575,7 @@ public abstract class BaseMainActivity extends BaseActivity
}
//Here we know that the intent contains a valid URL
if (!url.contains("medium.com")) {
new RetrieveRemoteDataAsyncTask(BaseMainActivity.this, url, BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveRemoteDataAsyncTask(BaseMainActivity.this, url, BaseMainActivity.this);
} else {
forwardToBrowser(intent);
}
@ -1709,8 +1723,7 @@ public abstract class BaseMainActivity extends BaseActivity
// Handle navigation view item clicks here.
int id = item.getItemId();
if (id == R.id.nav_archive) {
Intent myIntent = new Intent(BaseMainActivity.this, OwnerStatusActivity.class);
startActivity(myIntent);
launchOwnerStatusesActivity();
return false;
}
if (id == R.id.nav_trends) {
@ -1721,8 +1734,7 @@ public abstract class BaseMainActivity extends BaseActivity
startActivity(myIntent);
return false;
} else if (id == R.id.nav_archive_notifications) {
Intent myIntent = new Intent(BaseMainActivity.this, OwnerNotificationActivity.class);
startActivity(myIntent);
launchOwnerNotificationsActivity();
return false;
} else if (id == R.id.nav_drag_timelines) {
Intent intent = new Intent(BaseMainActivity.this, ReorderTimelinesActivity.class);
@ -2058,7 +2070,7 @@ public abstract class BaseMainActivity extends BaseActivity
if (accounts != null && accounts.size() > 0) {
developers = new ArrayList<>();
developers.addAll(accounts);
new RetrieveRelationshipAsyncTask(BaseMainActivity.this, accounts.get(0).getId(), BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveRelationshipAsyncTask(BaseMainActivity.this, accounts.get(0).getId(), BaseMainActivity.this);
}
}
}
@ -2342,12 +2354,13 @@ public abstract class BaseMainActivity extends BaseActivity
}
try {
TabLayoutNotificationsFragment tabLayoutNotificationsFragment = (TabLayoutNotificationsFragment) mPageReferenceMap.get(position);
assert tabLayoutNotificationsFragment != null;
ViewPager notifViewPager = Objects.requireNonNull(tabLayoutNotificationsFragment).getViewPager();
if (notifViewPager != null && notifViewPager.getAdapter() != null) {
DisplayNotificationsFragment displayNotificationsFragment = (DisplayNotificationsFragment) notifViewPager.getAdapter().instantiateItem(notifViewPager, 0);
displayNotificationsFragment.updateNotificationRead();
if (tabLayoutNotificationsFragment != null) {
ViewPager notifViewPager = tabLayoutNotificationsFragment.getViewPager();
if (notifViewPager != null && notifViewPager.getAdapter() != null) {
DisplayNotificationsFragment displayNotificationsFragment = (DisplayNotificationsFragment) notifViewPager.getAdapter().instantiateItem(notifViewPager, 0);
displayNotificationsFragment.updateNotificationRead();
}
}
} catch (Exception ignored) {
}
@ -2409,6 +2422,10 @@ public abstract class BaseMainActivity extends BaseActivity
super.onDetachedFromWindow();
}
protected abstract void launchOwnerStatusesActivity();
protected abstract void launchOwnerNotificationsActivity();
public enum iconLauncher {
BUBBLES,
FEDIVERSE,

Some files were not shown because too many files have changed in this diff Show More