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