Some cleaning

This commit is contained in:
tom79 2020-03-07 08:14:15 +01:00
parent 2957d50e1f
commit 4fcf8d5283
7 changed files with 1203 additions and 1512 deletions

View File

@ -69,41 +69,28 @@ task gitPushReleaseNotes(type: Exec, dependsOn: 'copyAllReleaseNotes') {
['sh', '-c', "git push"].execute().text.trim() ['sh', '-c', "git push"].execute().text.trim()
} }
ext.supportLibraryVersion = '29.0.2'
ext.glideLibraryVersion = '4.9.0'
ext.conscryptLibraryVersion = '2.2.1'
ext.evernoteLibraryVersion = '1.2.6'
ext.gsonLibraryVersion = '2.8.2'
ext.guavaLibraryVersion = '28.2-android'
ext.photoViewLibraryVersion = '2.3.0'
ext.ratethisappLibraryVersion = '1.2.0'
ext.uploadServiceVersion = "3.5.2"
ext.torrentstreamVersion = "2.5.0"
ext.netCipherVersion = "2.0.0-alpha1"
ext.acraVersion = "5.4.0"
dependencies { dependencies {
implementation 'com.android.support:appcompat-v7:29.0.2'
implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.0.0' implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0' implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.browser:browser:1.2.0' implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.exifinterface:exifinterface:1.1.0' implementation 'androidx.exifinterface:exifinterface:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4' implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
implementation "com.github.bumptech.glide:glide:$glideLibraryVersion" implementation "com.github.bumptech.glide:glide:4.11.0"
implementation ("com.github.bumptech.glide:recyclerview-integration:$glideLibraryVersion") { implementation ("com.github.bumptech.glide:recyclerview-integration:4.11.0") {
// Excludes the support library because it's already included by Glide. // Excludes the support library because it's already included by Glide.
transitive = false transitive = false
} }
annotationProcessor "com.github.bumptech.glide:compiler:$glideLibraryVersion" annotationProcessor "com.github.bumptech.glide:compiler:4.11.0"
annotationProcessor 'com.android.support:support-annotations:28.0.0' annotationProcessor 'com.android.support:support-annotations:28.0.0'
implementation "org.conscrypt:conscrypt-android:$conscryptLibraryVersion" implementation "org.conscrypt:conscrypt-android:2.2.1"
implementation "com.evernote:android-job:$evernoteLibraryVersion" implementation "com.evernote:android-job:1.2.6"
implementation "com.google.code.gson:gson:$gsonLibraryVersion" implementation "com.google.code.gson:gson:2.8.5"
implementation "com.google.guava:guava:$guavaLibraryVersion" implementation "com.google.guava:guava:28.2-android"
implementation "com.github.chrisbanes:PhotoView:$photoViewLibraryVersion" implementation "com.github.chrisbanes:PhotoView:2.3.0"
implementation 'com.r0adkll:slidableactivity:2.1.0' implementation 'com.r0adkll:slidableactivity:2.1.0'
implementation 'com.github.stom79:country-picker-android:1.2.0' implementation 'com.github.stom79:country-picker-android:1.2.0'
implementation 'com.github.stom79:mytransl:2.0' implementation 'com.github.stom79:mytransl:2.0'
@ -121,21 +108,21 @@ dependencies {
implementation "com.tonyodev.fetch2:fetch2:2.3.6" implementation "com.tonyodev.fetch2:fetch2:2.3.6"
implementation 'com.github.stom79:horizontalbargraph:1.6' implementation 'com.github.stom79:horizontalbargraph:1.6'
implementation 'jp.wasabeef:glide-transformations:4.0.0' implementation 'jp.wasabeef:glide-transformations:4.0.0'
playstoreImplementation "io.github.kobakei:ratethisapp:$ratethisappLibraryVersion" playstoreImplementation "io.github.kobakei:ratethisapp:1.2.0"
implementation 'ja.burhanrashid52:photoeditor:0.4.0' implementation 'ja.burhanrashid52:photoeditor:0.4.0'
api 'com.theartofdev.edmodo:android-image-cropper:2.8.+' api 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
implementation "net.gotev:uploadservice:$uploadServiceVersion" implementation "net.gotev:uploadservice:3.5.2"
implementation "net.gotev:uploadservice-okhttp:$uploadServiceVersion" implementation "net.gotev:uploadservice-okhttp:3.5.2"
implementation "info.guardianproject.netcipher:netcipher:$netCipherVersion" implementation "info.guardianproject.netcipher:netcipher:2.0.0-alpha1"
implementation "info.guardianproject.netcipher:netcipher-okhttp3:$netCipherVersion" implementation "info.guardianproject.netcipher:netcipher-okhttp3:2.0.0-alpha1"
implementation 'com.github.adrielcafe:AndroidAudioRecorder:0.3.0' implementation 'com.github.adrielcafe:AndroidAudioRecorder:0.3.0'
implementation 'yogesh.firzen:MukkiyaSevaigal:1.0.6' implementation 'yogesh.firzen:MukkiyaSevaigal:1.0.6'
implementation 'com.iceteck.silicompressorr:silicompressor:2.2.2' implementation 'com.iceteck.silicompressorr:silicompressor:2.2.2'
implementation "ch.acra:acra-mail:$acraVersion" implementation "ch.acra:acra-mail:5.4.0"
implementation "ch.acra:acra-limiter:$acraVersion" implementation "ch.acra:acra-limiter:5.4.0"
implementation "ch.acra:acra-notification:$acraVersion" implementation "ch.acra:acra-notification:5.4.0"
implementation 'com.github.stom79:Android-WYSIWYG-Editor:3.2.1' implementation 'com.github.stom79:Android-WYSIWYG-Editor:3.2.1'
implementation 'com.github.duanhong169:colorpicker:1.1.6' implementation 'com.github.duanhong169:colorpicker:1.1.6'
implementation 'com.github.penfeizhou.android.animation:apng:1.1.0' implementation 'com.github.penfeizhou.android.animation:apng:1.1.0'

View File

@ -1,13 +1,5 @@
Added:
- Català language
- Push notifications for Friendica & GNU Social
- Add follow/unfollow buttons for Pixelfed
- View your own story (need to wait the endpoint)
- Increase max bio chars to 500 for Pleroma
Fixed: Fixed:
- Proxy not applied with embedded videos - Peertube videos crashes
- Fix no toots that remains displayed on Nitter timelines - Color of the compose menu for the light theme
- Avoid to lose composed message when not sent
- Notifications not pushed
- Fix some crashes

View File

@ -584,7 +584,11 @@ public class API {
}else { }else {
status.setUri(resobj.get("id").toString()); status.setUri(resobj.get("id").toString());
} }
status.setCreated_at(Helper.mstStringToDate(context, resobj.get("created_at").toString())); if( resobj.has("created_at")) {
status.setCreated_at(Helper.mstStringToDate(context, resobj.get("created_at").toString()));
}else{
status.setCreated_at(new Date());
}
status.setIn_reply_to_id(resobj.get("in_reply_to_id").toString()); status.setIn_reply_to_id(resobj.get("in_reply_to_id").toString());
status.setIn_reply_to_account_id(resobj.get("in_reply_to_account_id").toString()); status.setIn_reply_to_account_id(resobj.get("in_reply_to_account_id").toString());
status.setSensitive(Boolean.parseBoolean(resobj.get("sensitive").toString())); status.setSensitive(Boolean.parseBoolean(resobj.get("sensitive").toString()));

View File

@ -25,7 +25,6 @@ import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
import android.provider.ContactsContract;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -49,6 +48,8 @@ import com.bumptech.glide.RequestBuilder;
import com.bumptech.glide.integration.recyclerview.RecyclerViewPreloader; import com.bumptech.glide.integration.recyclerview.RecyclerViewPreloader;
import com.bumptech.glide.util.FixedPreloadSizeProvider; import com.bumptech.glide.util.FixedPreloadSizeProvider;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
@ -97,7 +98,7 @@ import es.dmoral.toasty.Toasty;
public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsInterface, OnRetrieveMissingFeedsInterface, OnRetrieveFeedsAfterBookmarkInterface, OnListActionInterface { public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsInterface, OnRetrieveMissingFeedsInterface, OnRetrieveFeedsAfterBookmarkInterface, OnListActionInterface {
LinearLayoutManager mLayoutManager; private LinearLayoutManager mLayoutManager;
private boolean flag_loading; private boolean flag_loading;
private Context context; private Context context;
private AsyncTask<Void, Void, Void> asyncTask; private AsyncTask<Void, Void, Void> asyncTask;
@ -122,7 +123,6 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
private SharedPreferences sharedpreferences; private SharedPreferences sharedpreferences;
private boolean isSwipped; private boolean isSwipped;
private String remoteInstance; private String remoteInstance;
private List<String> mutedAccount;
private String instanceType; private String instanceType;
private String search_peertube, remote_channel_name; private String search_peertube, remote_channel_name;
private String initialBookMark; private String initialBookMark;
@ -206,9 +206,8 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
ListPreloader.PreloadSizeProvider sizeProvider = ListPreloader.PreloadSizeProvider sizeProvider =
new FixedPreloadSizeProvider(640, 480); new FixedPreloadSizeProvider(640, 480);
ListPreloader.PreloadModelProvider modelProvider = new MyPreloadModelProvider(); ListPreloader.PreloadModelProvider modelProvider = new MyPreloadModelProvider();
RecyclerViewPreloader<ContactsContract.CommonDataKinds.Photo> preloader = RecyclerViewPreloader preloader =
new RecyclerViewPreloader<>( new RecyclerViewPreloader<>(Glide.with(context), modelProvider, sizeProvider, 20 );
Glide.with(context), modelProvider, sizeProvider, 20 );
lv_status.addOnScrollListener(preloader); lv_status.addOnScrollListener(preloader);
mainLoader = rootView.findViewById(R.id.loader); mainLoader = rootView.findViewById(R.id.loader);
@ -359,55 +358,46 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
if (instanceType == null || (!instanceType.equals("PEERTUBE") && !instanceType.equals("NITTER"))) { if (instanceType == null || (!instanceType.equals("PEERTUBE") && !instanceType.equals("NITTER"))) {
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { swipeRefreshLayout.setOnRefreshListener(() -> {
@Override if (type == RetrieveFeedsAsyncTask.Type.HOME || type == RetrieveFeedsAsyncTask.Type.PF_HOME)
public void onRefresh() { MainActivity.countNewStatus = 0;
if (type == RetrieveFeedsAsyncTask.Type.HOME || type == RetrieveFeedsAsyncTask.Type.PF_HOME) isSwipped = true;
MainActivity.countNewStatus = 0; if (type != RetrieveFeedsAsyncTask.Type.CONVERSATION)
isSwipped = true; retrieveMissingToots(null);
if (type != RetrieveFeedsAsyncTask.Type.CONVERSATION) else {
if (statuses.size() > 0)
retrieveMissingToots(statuses.get(0).getId());
else
retrieveMissingToots(null); retrieveMissingToots(null);
else {
if (statuses.size() > 0)
retrieveMissingToots(statuses.get(0).getId());
else
retrieveMissingToots(null);
}
} }
}); });
}else if(instanceType.equals("PEERTUBE")){ }else if(instanceType.equals("PEERTUBE")){
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { swipeRefreshLayout.setOnRefreshListener(() -> {
@Override if (peertubes.size() > 0) {
public void onRefresh() { int size = peertubes.size();
if (peertubes.size() > 0) { isSwipped = true;
int size = peertubes.size(); peertubes.clear();
isSwipped = true; peertubes = new ArrayList<>();
peertubes.clear(); max_id = "0";
peertubes = new ArrayList<>(); peertubeAdapater.notifyItemRangeRemoved(0, size);
max_id = "0"; if (search_peertube == null) { //Not a Peertube search
peertubeAdapater.notifyItemRangeRemoved(0, size); asyncTask = new RetrieveFeedsAsyncTask(context, type, remoteInstance, "0", DisplayStatusFragment.this).execute();
if (search_peertube == null) { //Not a Peertube search } else {
asyncTask = new RetrieveFeedsAsyncTask(context, type, remoteInstance, "0", DisplayStatusFragment.this).execute(); asyncTask = new RetrievePeertubeSearchAsyncTask(context, remoteInstance, search_peertube, DisplayStatusFragment.this).execute();
} else {
asyncTask = new RetrievePeertubeSearchAsyncTask(context, remoteInstance, search_peertube, DisplayStatusFragment.this).execute();
}
} }
} }
}); });
}else { }else {
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { swipeRefreshLayout.setOnRefreshListener(() -> {
@Override if (statuses.size() > 0) {
public void onRefresh() { int size = statuses.size();
if (statuses.size() > 0) { isSwipped = true;
int size = statuses.size(); statuses.clear();
isSwipped = true; statuses = new ArrayList<>();
statuses.clear(); max_id = null;
statuses = new ArrayList<>(); statusListAdapter.notifyItemRangeRemoved(0, size);
max_id = null; asyncTask = new RetrieveFeedsAsyncTask(context, type, remoteInstance, max_id, DisplayStatusFragment.this).execute();
statusListAdapter.notifyItemRangeRemoved(0, size);
asyncTask = new RetrieveFeedsAsyncTask(context, type, remoteInstance, max_id, DisplayStatusFragment.this).execute();
}
} }
}); });
@ -417,12 +407,9 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
//Load data depending of the value //Load data depending of the value
manageAsyncTask(false); manageAsyncTask(false);
} else { } else {
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() { new Handler(Looper.getMainLooper()).postDelayed(() -> {
@Override if (context != null) {
public void run() { manageAsyncTask(false);
if (context != null) {
manageAsyncTask(false);
}
} }
}, 500); }, 500);
} }
@ -466,7 +453,7 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
@Override @Override
public void onAttach(Context context) { public void onAttach(@NotNull Context context) {
super.onAttach(context); super.onAttach(context);
this.context = context; this.context = context;
} }
@ -532,7 +519,7 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
max_id = "0"; max_id = "0";
//max_id needs to work like an offset //max_id needs to work like an offset
int tootPerPage = sharedpreferences.getInt(Helper.SET_TOOT_PER_PAGE, Helper.TOOTS_PER_PAGE); int tootPerPage = sharedpreferences.getInt(Helper.SET_TOOT_PER_PAGE, Helper.TOOTS_PER_PAGE);
max_id = String.valueOf(Integer.valueOf(max_id) + tootPerPage); max_id = String.valueOf(Integer.parseInt(max_id) + tootPerPage);
if (apiResponse.getPeertubes() == null) { if (apiResponse.getPeertubes() == null) {
return; return;
} }
@ -608,11 +595,11 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
if (max_id == null) if (max_id == null)
max_id = "1"; max_id = "1";
//max_id needs to work like an offset //max_id needs to work like an offset
max_id = String.valueOf(Integer.valueOf(max_id) + 1); max_id = String.valueOf(Integer.parseInt(max_id) + 1);
} else if (type == RetrieveFeedsAsyncTask.Type.SEARCH && !tag.contains("_cache_")) { } else if (type == RetrieveFeedsAsyncTask.Type.SEARCH && !tag.contains("_cache_")) {
if (max_id == null) if (max_id == null)
max_id = "0"; max_id = "0";
max_id = String.valueOf(Integer.valueOf(max_id) + 20); max_id = String.valueOf(Integer.parseInt(max_id) + 20);
} else { } else {
max_id = apiResponse.getMax_id(); max_id = apiResponse.getMax_id();
} }
@ -677,7 +664,7 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
return; return;
if (status.getId() != null && statuses != null && statuses.size() > 0 && statuses.get(0) != null if (status.getId() != null && statuses != null && statuses.size() > 0 && statuses.get(0) != null
&& status.getCreated_at().after(statuses.get(0).getCreated_at())) { && status.getCreated_at().after(statuses.get(0).getCreated_at())) {
List<Status> tempTootResult = new ArrayList(); List<Status> tempTootResult = new ArrayList<>();
tempTootResult.add(status); tempTootResult.add(status);
if (tempTootResult.size() > 0) if (tempTootResult.size() > 0)
status = tempTootResult.get(0); status = tempTootResult.get(0);
@ -809,7 +796,7 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
Iterator<Status> s = statuses.iterator(); Iterator<Status> s = statuses.iterator();
int i = 0; int i = 0;
while (s.hasNext() && i < firstVisible) { while (s.hasNext() && i < firstVisible) {
Status status = s.next(); s.next();
s.remove(); s.remove();
statusListAdapter.notifyItemRemoved(0); statusListAdapter.notifyItemRemoved(0);
statusListAdapter.notifyItemChanged(0); statusListAdapter.notifyItemChanged(0);
@ -950,12 +937,20 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
Status status = it.next(); Status status = it.next();
for (Status status1 : statuses) { for (Status status1 : statuses) {
if (status.getConversationId() != null && status.getConversationId().equals(status1.getConversationId())) { if (status.getConversationId() != null && status.getConversationId().equals(status1.getConversationId())) {
if (instanceType.equals("MASTODON") || instanceType.equals("MISSKEY") || instanceType.equals("NITTER")|| instanceType.equals("GNU")) switch (instanceType) {
statusListAdapter.notifyItemRemoved(position); case "MASTODON":
else if (instanceType.equals("PIXELFED")) case "MISSKEY":
pixelfedListAdapter.notifyItemRemoved(position); case "NITTER":
else if (instanceType.equals("ART")) case "GNU":
artListAdapter.notifyItemRemoved(position); statusListAdapter.notifyItemRemoved(position);
break;
case "PIXELFED":
pixelfedListAdapter.notifyItemRemoved(position);
break;
case "ART":
artListAdapter.notifyItemRemoved(position);
break;
}
it.remove(); it.remove();
} }
} }
@ -1186,9 +1181,7 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
if (isSwipped) { if (isSwipped) {
if (previousPosition > 0) { if (previousPosition > 0) {
for (int i = 0; i < previousPosition; i++) { this.statuses.subList(0, previousPosition).clear();
this.statuses.remove(0);
}
statusListAdapter.notifyItemRangeRemoved(0, previousPosition); statusListAdapter.notifyItemRangeRemoved(0, previousPosition);
} }
isSwipped = false; isSwipped = false;
@ -1214,6 +1207,7 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
isSwipped = true; isSwipped = true;
int lenght = statuses.size(); int lenght = statuses.size();
statuses.clear(); statuses.clear();
assert instanceType != null;
switch (instanceType) { switch (instanceType) {
case "MASTODON": case "MASTODON":
case "MISSKEY": case "MISSKEY":

View File

@ -6,7 +6,7 @@ buildscript {
google() google()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.5.2' classpath 'com.android.tools.build:gradle:3.6.1'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files

View File

@ -1,6 +1,6 @@
#Fri Aug 23 15:40:43 CEST 2019 #Fri Mar 06 19:14:19 CET 2020
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip