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()
}
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 {
implementation 'com.android.support:appcompat-v7:29.0.2'
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.recyclerview:recyclerview:1.1.0'
implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.exifinterface:exifinterface:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
implementation "com.github.bumptech.glide:glide:$glideLibraryVersion"
implementation ("com.github.bumptech.glide:recyclerview-integration:$glideLibraryVersion") {
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.
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'
implementation "org.conscrypt:conscrypt-android:$conscryptLibraryVersion"
implementation "com.evernote:android-job:$evernoteLibraryVersion"
implementation "com.google.code.gson:gson:$gsonLibraryVersion"
implementation "com.google.guava:guava:$guavaLibraryVersion"
implementation "com.github.chrisbanes:PhotoView:$photoViewLibraryVersion"
implementation "org.conscrypt:conscrypt-android:2.2.1"
implementation "com.evernote:android-job:1.2.6"
implementation "com.google.code.gson:gson:2.8.5"
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'
@ -121,21 +108,21 @@ dependencies {
implementation "com.tonyodev.fetch2:fetch2:2.3.6"
implementation 'com.github.stom79:horizontalbargraph:1.6'
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'
api 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
implementation "net.gotev:uploadservice:$uploadServiceVersion"
implementation "net.gotev:uploadservice-okhttp:$uploadServiceVersion"
implementation "info.guardianproject.netcipher:netcipher:$netCipherVersion"
implementation "info.guardianproject.netcipher:netcipher-okhttp3:$netCipherVersion"
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.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:$acraVersion"
implementation "ch.acra:acra-limiter:$acraVersion"
implementation "ch.acra:acra-notification:$acraVersion"
implementation "ch.acra:acra-mail:5.4.0"
implementation "ch.acra:acra-limiter:5.4.0"
implementation "ch.acra:acra-notification:5.4.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: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:
- Proxy not applied with embedded videos
- Fix no toots that remains displayed on Nitter timelines
- Avoid to lose composed message when not sent
- Notifications not pushed
- Fix some crashes
- Peertube videos crashes
- Color of the compose menu for the light theme

View File

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

View File

@ -6,7 +6,7 @@ buildscript {
google()
}
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
// 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
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
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