Release 2.35.4
This commit is contained in:
parent
00b7bf3990
commit
129621c73c
|
@ -6,8 +6,8 @@ android {
|
|||
defaultConfig {
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 29
|
||||
versionCode 366
|
||||
versionName "2.35.3"
|
||||
versionCode 367
|
||||
versionName "2.35.4"
|
||||
multiDexEnabled true
|
||||
renderscriptTargetApi 28 as int
|
||||
renderscriptSupportModeEnabled true
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
Added:
|
||||
- 100 Mo of cache for videos (can be changed in settings)
|
||||
- Ouiches support for audio
|
||||
|
||||
Changed:
|
||||
- Closing media
|
||||
- Smoother settings
|
||||
|
||||
Fixed:
|
||||
- An issue with animated avatars in menu
|
||||
- An issue with avatars in accounts list
|
||||
- An issue with banana.dog instance
|
||||
- An issue with sensitive media when there were already a video preview
|
||||
- Crashes with polls on some instances
|
||||
- Crashes with Pixelfed
|
||||
- Some other issues.
|
||||
- Peertube comments
|
||||
- Some layout issues
|
||||
- Some other crashes
|
|
@ -15,8 +15,8 @@ package app.fedilab.android.activities;
|
|||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.AsyncTask;
|
||||
|
@ -34,6 +34,7 @@ import android.widget.TextView;
|
|||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
@ -175,8 +176,18 @@ public class AccountReportActivity extends BaseActivity implements OnAdminAction
|
|||
public void onAdminAction(APIResponse apiResponse) {
|
||||
if (apiResponse.getError() != null) {
|
||||
if (apiResponse.getError().getStatusCode() == 403) {
|
||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
|
||||
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
|
||||
int style;
|
||||
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 builderInner;
|
||||
builderInner = new AlertDialog.Builder(AccountReportActivity.this, R.style.AppThemeDark);
|
||||
builderInner = new AlertDialog.Builder(AccountReportActivity.this, style);
|
||||
builderInner.setTitle(R.string.reconnect_account);
|
||||
builderInner.setMessage(R.string.reconnect_account_message);
|
||||
builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||
|
|
|
@ -280,9 +280,7 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
|
|||
}
|
||||
});
|
||||
String user_agent = sharedpreferences.getString(Helper.SET_CUSTOM_USER_AGENT, Helper.USER_AGENT);
|
||||
if (user_agent != null) {
|
||||
webview_video.getSettings().setUserAgentString(user_agent);
|
||||
}
|
||||
webview_video.getSettings().setUserAgentString(user_agent);
|
||||
webview_video.getSettings().setAllowFileAccess(true);
|
||||
webview_video.setWebChromeClient(mastalabWebChromeClient);
|
||||
webview_video.getSettings().setDomStorageEnabled(true);
|
||||
|
@ -902,7 +900,7 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
|
|||
} else {
|
||||
b.putParcelable("tootReply", remoteStatuses);
|
||||
}
|
||||
intent.putExtras(b); //Put your id to your next Intent
|
||||
intent.putExtras(b);
|
||||
contextReference.get().startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,6 +80,7 @@ public class PeertubeEditUploadActivity extends BaseActivity implements OnRetrie
|
|||
private String videoId;
|
||||
private Account channel;
|
||||
|
||||
@SuppressWarnings("SuspiciousMethodCalls")
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -539,6 +540,7 @@ public class PeertubeEditUploadActivity extends BaseActivity implements OnRetrie
|
|||
|
||||
List<String> tags = peertube.getTags();
|
||||
if (tags != null && tags.size() > 0) {
|
||||
//noinspection ToArrayCallWithZeroLengthArrayArgument
|
||||
String[] tagsA = tags.toArray(new String[tags.size()]);
|
||||
p_video_tags.setTags(tagsA);
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ package app.fedilab.android.activities;
|
|||
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
|
@ -193,6 +194,7 @@ public class PeertubeUploadActivity extends BaseActivity implements OnRetrievePe
|
|||
|
||||
}
|
||||
|
||||
@SuppressWarnings("SuspiciousMethodCalls")
|
||||
@Override
|
||||
public void onRetrievePeertubeChannels(APIResponse apiResponse) {
|
||||
if (apiResponse.getError() != null || apiResponse.getAccounts() == null || apiResponse.getAccounts().size() == 0) {
|
||||
|
@ -277,32 +279,29 @@ public class PeertubeUploadActivity extends BaseActivity implements OnRetrievePe
|
|||
});
|
||||
set_upload_file.setEnabled(true);
|
||||
|
||||
set_upload_file.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (ContextCompat.checkSelfPermission(PeertubeUploadActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) !=
|
||||
PackageManager.PERMISSION_GRANTED) {
|
||||
ActivityCompat.requestPermissions(PeertubeUploadActivity.this,
|
||||
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
|
||||
MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE);
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
|
||||
intent.setType("*/*");
|
||||
String[] mimetypes = {"video/*"};
|
||||
intent.putExtra(Intent.EXTRA_MIME_TYPES, mimetypes);
|
||||
startActivityForResult(intent, PICK_IVDEO);
|
||||
} else {
|
||||
intent.setType("video/*");
|
||||
Intent pickIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
|
||||
Intent chooserIntent = Intent.createChooser(intent, getString(R.string.toot_select_image));
|
||||
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[]{pickIntent});
|
||||
startActivityForResult(chooserIntent, PICK_IVDEO);
|
||||
}
|
||||
|
||||
set_upload_file.setOnClickListener(v -> {
|
||||
if (ContextCompat.checkSelfPermission(PeertubeUploadActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) !=
|
||||
PackageManager.PERMISSION_GRANTED) {
|
||||
ActivityCompat.requestPermissions(PeertubeUploadActivity.this,
|
||||
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
|
||||
MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE);
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
|
||||
intent.setType("*/*");
|
||||
String[] mimetypes = {"video/*"};
|
||||
intent.putExtra(Intent.EXTRA_MIME_TYPES, mimetypes);
|
||||
startActivityForResult(intent, PICK_IVDEO);
|
||||
} else {
|
||||
intent.setType("video/*");
|
||||
Intent pickIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
|
||||
Intent chooserIntent = Intent.createChooser(intent, getString(R.string.toot_select_image));
|
||||
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[]{pickIntent});
|
||||
startActivityForResult(chooserIntent, PICK_IVDEO);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//Manage languages
|
||||
|
@ -391,6 +390,7 @@ public class PeertubeUploadActivity extends BaseActivity implements OnRetrievePe
|
|||
exception.printStackTrace();
|
||||
}
|
||||
|
||||
@SuppressLint("ApplySharedPref")
|
||||
@Override
|
||||
public void onCompleted(Context context, UploadInfo uploadInfo, ServerResponse serverResponse) {
|
||||
try {
|
||||
|
|
|
@ -18,7 +18,10 @@ import android.content.Context;
|
|||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableString;
|
||||
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
|
@ -412,6 +415,13 @@ public class API {
|
|||
status.setEmojis(new ArrayList<>());
|
||||
status.setMedia_attachments(new ArrayList<>());
|
||||
status.setVisibility("public");
|
||||
status.setViewType(context);
|
||||
SpannableString spannableString;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
spannableString = new SpannableString(Html.fromHtml(status.getContent(), Html.FROM_HTML_MODE_LEGACY));
|
||||
else
|
||||
spannableString = new SpannableString(Html.fromHtml(status.getContent()));
|
||||
status.setContentSpan(new SpannableString(spannableString));
|
||||
i++;
|
||||
statuses.add(status);
|
||||
}
|
||||
|
|
|
@ -857,6 +857,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
|
||||
if (social == UpdateAccountInfoAsyncTask.SOCIAL.PEERTUBE) {
|
||||
holder.status_action_container.setVisibility(View.GONE);
|
||||
holder.fedilab_features.setVisibility(View.GONE);
|
||||
holder.status_peertube_container.setVisibility(View.VISIBLE);
|
||||
holder.status_peertube_reply.setOnClickListener(v -> {
|
||||
AlertDialog.Builder builderInner;
|
||||
|
|
|
@ -14,10 +14,9 @@ package app.fedilab.android.fragments;
|
|||
* 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.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
|
@ -27,24 +26,27 @@ import android.widget.RelativeLayout;
|
|||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.activities.LoginActivity;
|
||||
import app.fedilab.android.asynctasks.PostAdminActionAsyncTask;
|
||||
import app.fedilab.android.asynctasks.RetrieveAccountsAsyncTask;
|
||||
import app.fedilab.android.client.API;
|
||||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.AdminAction;
|
||||
import app.fedilab.android.client.Entities.Report;
|
||||
import app.fedilab.android.drawers.ReportsListAdapter;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.interfaces.OnAdminActionInterface;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
|
@ -59,9 +61,7 @@ public class DisplayAdminReportsFragment extends Fragment implements OnAdminActi
|
|||
private Context context;
|
||||
private AsyncTask<Void, Void, Void> asyncTask;
|
||||
private ReportsListAdapter reportsListAdapter;
|
||||
private String max_id;
|
||||
private List<Report> reports;
|
||||
private RetrieveAccountsAsyncTask.Type type;
|
||||
private RelativeLayout mainLoader, nextElementLoader, textviewNoAction;
|
||||
private boolean firstLoad;
|
||||
private SwipeRefreshLayout swipeRefreshLayout;
|
||||
|
@ -82,7 +82,6 @@ public class DisplayAdminReportsFragment extends Fragment implements OnAdminActi
|
|||
if (bundle != null) {
|
||||
unresolved = bundle.getBoolean("unresolved", true);
|
||||
}
|
||||
max_id = null;
|
||||
firstLoad = true;
|
||||
flag_loading = true;
|
||||
swiped = false;
|
||||
|
@ -109,7 +108,7 @@ public class DisplayAdminReportsFragment extends Fragment implements OnAdminActi
|
|||
mLayoutManager = new LinearLayoutManager(context);
|
||||
lv_reports.setLayoutManager(mLayoutManager);
|
||||
lv_reports.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
|
||||
public void onScrolled(@NotNull RecyclerView recyclerView, int dx, int dy) {
|
||||
if (dy > 0) {
|
||||
int visibleItemCount = mLayoutManager.getChildCount();
|
||||
int totalItemCount = mLayoutManager.getItemCount();
|
||||
|
@ -129,18 +128,14 @@ public class DisplayAdminReportsFragment extends Fragment implements OnAdminActi
|
|||
}
|
||||
});
|
||||
|
||||
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
max_id = null;
|
||||
reports = new ArrayList<>();
|
||||
firstLoad = true;
|
||||
flag_loading = true;
|
||||
swiped = true;
|
||||
AdminAction adminAction = new AdminAction();
|
||||
adminAction.setUnresolved(unresolved);
|
||||
asyncTask = new PostAdminActionAsyncTask(context, API.adminAction.GET_REPORTS, null, adminAction, DisplayAdminReportsFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
}
|
||||
swipeRefreshLayout.setOnRefreshListener(() -> {
|
||||
reports = new ArrayList<>();
|
||||
firstLoad = true;
|
||||
flag_loading = true;
|
||||
swiped = true;
|
||||
AdminAction adminAction = new AdminAction();
|
||||
adminAction.setUnresolved(unresolved);
|
||||
asyncTask = new PostAdminActionAsyncTask(context, API.adminAction.GET_REPORTS, null, adminAction, DisplayAdminReportsFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
});
|
||||
|
||||
AdminAction adminAction = new AdminAction();
|
||||
|
@ -155,15 +150,8 @@ public class DisplayAdminReportsFragment extends Fragment implements OnAdminActi
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Refresh report in list
|
||||
*/
|
||||
public void refreshFilter() {
|
||||
reportsListAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
public void onAttach(@NotNull Context context) {
|
||||
super.onAttach(context);
|
||||
this.context = context;
|
||||
}
|
||||
|
@ -191,22 +179,24 @@ public class DisplayAdminReportsFragment extends Fragment implements OnAdminActi
|
|||
//Admin right not granted through the API?
|
||||
if (apiResponse.getError().getStatusCode() == 403) {
|
||||
AlertDialog.Builder builderInner;
|
||||
builderInner = new AlertDialog.Builder(context, R.style.AppThemeDark);
|
||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
|
||||
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
|
||||
int style;
|
||||
if (theme == Helper.THEME_DARK) {
|
||||
style = R.style.DialogDark;
|
||||
} else if (theme == Helper.THEME_BLACK) {
|
||||
style = R.style.DialogBlack;
|
||||
} else {
|
||||
style = R.style.Dialog;
|
||||
}
|
||||
builderInner = new AlertDialog.Builder(context, style);
|
||||
builderInner.setTitle(R.string.reconnect_account);
|
||||
builderInner.setMessage(R.string.reconnect_account_message);
|
||||
builderInner.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
builderInner.setPositiveButton(R.string.validate, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
Intent intent = new Intent(context, LoginActivity.class);
|
||||
intent.putExtra("admin", true);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||
builderInner.setPositiveButton(R.string.validate, (dialog, which) -> {
|
||||
Intent intent = new Intent(context, LoginActivity.class);
|
||||
intent.putExtra("admin", true);
|
||||
context.startActivity(intent);
|
||||
});
|
||||
builderInner.show();
|
||||
} else {
|
||||
|
@ -226,8 +216,6 @@ public class DisplayAdminReportsFragment extends Fragment implements OnAdminActi
|
|||
else
|
||||
textviewNoAction.setVisibility(View.GONE);
|
||||
|
||||
max_id = apiResponse.getMax_id();
|
||||
|
||||
if (swiped) {
|
||||
reportsListAdapter = new ReportsListAdapter(this.reports);
|
||||
lv_reports.setAdapter(reportsListAdapter);
|
||||
|
|
|
@ -2999,7 +2999,7 @@ public class Helper {
|
|||
}
|
||||
try {
|
||||
assert url != null;
|
||||
if (disableGif || (!url.endsWith(".gif") && account.getAvatar_static().compareTo(account.getAvatar()) == 0)) {
|
||||
if (social == UpdateAccountInfoAsyncTask.SOCIAL.PEERTUBE || disableGif || (!url.endsWith(".gif") && account.getAvatar_static().compareTo(account.getAvatar()) == 0)) {
|
||||
Glide.with(imageView.getContext())
|
||||
.asDrawable()
|
||||
.load(url)
|
||||
|
|
Loading…
Reference in New Issue