Fix some issues
This commit is contained in:
parent
e058b54c96
commit
a06d73e281
|
@ -6,7 +6,6 @@ import android.content.Context;
|
|||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.os.StrictMode;
|
||||
import android.view.ActionMode;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
@ -25,7 +24,6 @@ import org.jetbrains.annotations.NotNull;
|
|||
|
||||
import java.util.Timer;
|
||||
|
||||
import app.fedilab.android.BuildConfig;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
|
|
|
@ -207,6 +207,7 @@ import static app.fedilab.android.helper.Helper.THEME_BLACK;
|
|||
import static app.fedilab.android.helper.Helper.THEME_DARK;
|
||||
import static app.fedilab.android.helper.Helper.THEME_LIGHT;
|
||||
import static app.fedilab.android.helper.Helper.countWithEmoji;
|
||||
import static app.fedilab.android.helper.Helper.isValidContextForGlide;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -646,7 +647,7 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
|||
}
|
||||
}
|
||||
|
||||
public static String manageMentions(Context context, String userIdReply, Status tootReply) {
|
||||
public static String manageMentions(String userIdReply, Status tootReply) {
|
||||
String contentView = "";
|
||||
//Retrieves mentioned accounts + OP and adds them at the beginin of the toot
|
||||
ArrayList<String> mentionedAccountsAdded = new ArrayList<>();
|
||||
|
@ -1340,6 +1341,7 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
|||
it.remove();
|
||||
}
|
||||
if (fileName != null) {
|
||||
if (isValidContextForGlide(imageView.getContext())) {
|
||||
Glide.with(imageView.getContext())
|
||||
.asBitmap()
|
||||
.load(fileName)
|
||||
|
@ -1356,8 +1358,10 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
|||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if (isValidContextForGlide(imageView.getContext())) {
|
||||
String finalUrl = url;
|
||||
Glide.with(imageView.getContext())
|
||||
.asBitmap()
|
||||
|
@ -1388,6 +1392,7 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
|||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LinearLayout.LayoutParams imParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
|
||||
|
@ -2246,8 +2251,7 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
|||
if (namebar != null && namebar.getParent() != null)
|
||||
((ViewGroup) namebar.getParent()).removeView(namebar);
|
||||
}
|
||||
List<Attachment> tmp_attachment = new ArrayList<>();
|
||||
tmp_attachment.addAll(attachments);
|
||||
List<Attachment> tmp_attachment = new ArrayList<>(attachments);
|
||||
attachments.removeAll(tmp_attachment);
|
||||
tmp_attachment.clear();
|
||||
}
|
||||
|
@ -2585,8 +2589,7 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
|||
if (namebar != null && namebar.getParent() != null)
|
||||
((ViewGroup) namebar.getParent()).removeView(namebar);
|
||||
}
|
||||
List<Attachment> tmp_attachment = new ArrayList<>();
|
||||
tmp_attachment.addAll(attachments);
|
||||
List<Attachment> tmp_attachment = new ArrayList<>(attachments);
|
||||
attachments.removeAll(tmp_attachment);
|
||||
tmp_attachment.clear();
|
||||
}
|
||||
|
@ -3069,9 +3072,7 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
|||
}
|
||||
});
|
||||
imageView.setTag(attachment.getId());
|
||||
imageView.setOnClickListener(view -> {
|
||||
imageView.setOnClickListener(view1 -> showAddDescription(attachment));
|
||||
});
|
||||
imageView.setOnClickListener(view -> imageView.setOnClickListener(view1 -> showAddDescription(attachment)));
|
||||
imageView.setOnLongClickListener(view -> {
|
||||
showRemove(imageView.getId());
|
||||
return false;
|
||||
|
@ -3396,7 +3397,7 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
|||
private void displayPollPopup() {
|
||||
AlertDialog.Builder alertPoll = new AlertDialog.Builder(TootActivity.this, style);
|
||||
alertPoll.setTitle(R.string.create_poll);
|
||||
View view = getLayoutInflater().inflate(R.layout.popup_poll, null);
|
||||
View view = getLayoutInflater().inflate(R.layout.popup_poll, new LinearLayout(TootActivity.this), false);
|
||||
alertPoll.setView(view);
|
||||
Spinner poll_choice = view.findViewById(R.id.poll_choice);
|
||||
Spinner poll_duration = view.findViewById(R.id.poll_duration);
|
||||
|
|
|
@ -459,7 +459,7 @@ public class PixelfedListAdapter extends RecyclerView.Adapter implements OnPostA
|
|||
InputMethodManager.SHOW_FORCED, 0);
|
||||
EditText content_cw = new EditText(context);
|
||||
content_cw.setText(status.getReblog() != null ? status.getReblog().getSpoiler_text() : status.getSpoiler_text());
|
||||
String content = TootActivity.manageMentions(context, userId, status.getReblog() != null ? status.getReblog() : status);
|
||||
String content = TootActivity.manageMentions(userId, status.getReblog() != null ? status.getReblog() : status);
|
||||
TextWatcher textWatcher = PixelfedComposeActivity.initializeTextWatcher(context, social, holder.quick_reply_text, holder.toot_space_left, null, null, PixelfedListAdapter.this, PixelfedListAdapter.this, PixelfedListAdapter.this);
|
||||
holder.quick_reply_text.addTextChangedListener(textWatcher);
|
||||
holder.quick_reply_text.setText(content);
|
||||
|
|
|
@ -480,6 +480,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
public void onPostStatusAction(APIResponse apiResponse) {
|
||||
if (apiResponse.getError() != null) {
|
||||
Toasty.error(context, apiResponse.getError().getError(), Toast.LENGTH_SHORT).show();
|
||||
storeToot();
|
||||
return;
|
||||
}
|
||||
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||
|
@ -487,7 +488,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
String instance = Helper.getLiveInstance(context);
|
||||
boolean split_toot = sharedpreferences.getBoolean(Helper.SET_AUTOMATICALLY_SPLIT_TOOTS + userId + instance, false);
|
||||
|
||||
|
||||
if (split_toot && splitToot != null && stepSpliToot < splitToot.size()) {
|
||||
String tootContent = splitToot.get(stepSpliToot);
|
||||
stepSpliToot += 1;
|
||||
|
|
Loading…
Reference in New Issue