Fix issue #448
This commit is contained in:
parent
8578bf8ce3
commit
05e918793b
|
@ -2073,9 +2073,8 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
|||
dialog.dismiss();
|
||||
});
|
||||
builderSingle1.setPositiveButton(R.string.server_schedule, (dialog, which) -> {
|
||||
int offset = TimeZone.getDefault().getRawOffset();
|
||||
calendar.add(Calendar.MILLISECOND, -offset);
|
||||
final String date = Helper.dateToString(new Date(calendar.getTimeInMillis()));
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ", Locale.getDefault());
|
||||
String date = sdf.format(calendar.getTime());
|
||||
serverSchedule(date);
|
||||
});
|
||||
builderSingle1.show();
|
||||
|
@ -3169,10 +3168,12 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
|||
toRemove.clear();
|
||||
}
|
||||
String content = status.getContent();
|
||||
Pattern mentionLink = Pattern.compile("(<\\s?a\\s?href=\"https?://([\\da-z.-]+\\.[a-z.]{2,10})/(@[/\\w._-]*)\"\\s?[^.]*<\\s?/\\s?a\\s?>)");
|
||||
Matcher matcher = mentionLink.matcher(content);
|
||||
if (matcher.find()) {
|
||||
content = matcher.replaceAll("$3@$2");
|
||||
if( content != null) {
|
||||
Pattern mentionLink = Pattern.compile("(<\\s?a\\s?href=\"https?://([\\da-z.-]+\\.[a-z.]{2,10})/(@[/\\w._-]*)\"\\s?[^.]*<\\s?/\\s?a\\s?>)");
|
||||
Matcher matcher = mentionLink.matcher(content);
|
||||
if (matcher.find()) {
|
||||
content = matcher.replaceAll("$3@$2");
|
||||
}
|
||||
}
|
||||
if (removed) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
|
|
|
@ -962,7 +962,11 @@ public class API {
|
|||
Status status = new Status();
|
||||
try {
|
||||
status.setIn_reply_to_id(resobj.getString("in_reply_to_id"));
|
||||
status.setSensitive(resobj.getBoolean("sensitive"));
|
||||
if( !resobj.isNull("sensitive")) {
|
||||
status.setSensitive(resobj.getBoolean("sensitive"));
|
||||
}else{
|
||||
status.setSensitive(false);
|
||||
}
|
||||
status.setSpoiler_text(resobj.getString("spoiler_text"));
|
||||
try {
|
||||
status.setVisibility(resobj.getString("visibility"));
|
||||
|
@ -970,8 +974,7 @@ public class API {
|
|||
status.setVisibility("public");
|
||||
}
|
||||
status.setContent(context, resobj.getString("text"));
|
||||
} catch (JSONException ignored) {
|
||||
}
|
||||
} catch (JSONException ignored) {}
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
|
@ -151,6 +151,7 @@ public class ScheduledTootsListAdapter extends BaseAdapter implements OnPostActi
|
|||
Helper.changeDrawableColor(context, R.drawable.ic_mail_outline, R.color.action_light);
|
||||
}
|
||||
|
||||
if(status.getVisibility() != null)
|
||||
switch (status.getVisibility()) {
|
||||
case "public":
|
||||
holder.scheduled_toot_privacy.setImageResource(R.drawable.ic_public);
|
||||
|
@ -374,7 +375,7 @@ public class ScheduledTootsListAdapter extends BaseAdapter implements OnPostActi
|
|||
holder.scheduled_toot_container.setOnClickListener(v -> {
|
||||
Intent intentToot = new Intent(context, TootActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
if (storedStatus.getStatus().getSpoiler_text().equals("null"))
|
||||
if (storedStatus.getStatus().getSpoiler_text() != null && storedStatus.getStatus().getSpoiler_text().equals("null"))
|
||||
storedStatus.getStatus().setSpoiler_text("");
|
||||
b.putParcelable("storedStatus", storedStatus);
|
||||
intentToot.putExtras(b);
|
||||
|
|
|
@ -3328,7 +3328,8 @@ public class StatusListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
|||
.asBitmap()
|
||||
.load(!attachment.getType().toLowerCase().equals("audio") ? url : R.drawable.ic_audio_wave)
|
||||
.thumbnail(0.1f)
|
||||
.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10)))
|
||||
.dontTransform()
|
||||
.apply(new RequestOptions().transform(new RoundedCorners(10)))
|
||||
.into(new CustomTarget<Bitmap>() {
|
||||
@Override
|
||||
public void onResourceReady(@NonNull Bitmap resource, Transition<? super Bitmap> transition) {
|
||||
|
@ -3347,6 +3348,7 @@ public class StatusListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
|||
.asBitmap()
|
||||
.load(!attachment.getType().toLowerCase().equals("audio") ? url : R.drawable.ic_audio_wave)
|
||||
.thumbnail(0.1f)
|
||||
.dontTransform()
|
||||
.apply(new RequestOptions().transform(new BlurTransformation(50, 3), new RoundedCorners(10)))
|
||||
.into(new CustomTarget<Bitmap>() {
|
||||
@Override
|
||||
|
@ -3367,15 +3369,17 @@ public class StatusListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
|||
if (!blur) {
|
||||
Glide.with(imageView.getContext())
|
||||
.load(!attachment.getType().toLowerCase().equals("audio") ? url : R.drawable.ic_audio_wave)
|
||||
.dontTransform()
|
||||
.thumbnail(0.1f)
|
||||
// .override(640, 480)
|
||||
.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10)))
|
||||
.apply(new RequestOptions().transform(new RoundedCorners(10)))
|
||||
// .transition(DrawableTransitionOptions.withCrossFade())
|
||||
.into(imageView);
|
||||
} else {
|
||||
Glide.with(imageView.getContext())
|
||||
.load(!attachment.getType().toLowerCase().equals("audio") ? url : R.drawable.ic_audio_wave)
|
||||
.thumbnail(0.1f)
|
||||
.dontTransform()
|
||||
// .override(640, 480)
|
||||
.apply(new RequestOptions().transform(new BlurTransformation(50, 3), new RoundedCorners(10)))
|
||||
// .transition(DrawableTransitionOptions.withCrossFade())
|
||||
|
|
|
@ -40,6 +40,8 @@ import android.widget.Toast;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -194,7 +196,7 @@ public class DisplayScheduledTootsFragment extends Fragment implements OnRetriev
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
public void onAttach(@NotNull Context context) {
|
||||
super.onAttach(context);
|
||||
this.context = context;
|
||||
}
|
||||
|
@ -224,7 +226,6 @@ public class DisplayScheduledTootsFragment extends Fragment implements OnRetriev
|
|||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
message = Html.fromHtml(context.getString(R.string.no_scheduled_boosts_indications), Html.FROM_HTML_MODE_LEGACY);
|
||||
else
|
||||
//noinspection deprecation
|
||||
message = Html.fromHtml(context.getString(R.string.no_scheduled_boosts_indications));
|
||||
no_action_text_subtitle.setText(message, TextView.BufferType.SPANNABLE);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue