mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2024-12-22 08:40:03 +02:00
Release 3.19.1
This commit is contained in:
parent
a7c76e80a0
commit
cea9abbc5b
7 changed files with 107 additions and 9 deletions
|
@ -13,8 +13,8 @@ android {
|
|||
defaultConfig {
|
||||
minSdk 21
|
||||
targetSdk 33
|
||||
versionCode 481
|
||||
versionName "3.19.0"
|
||||
versionCode 482
|
||||
versionName "3.19.1"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
flavorDimensions "default"
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
[
|
||||
{
|
||||
"version": "3.19.1",
|
||||
"code": "482",
|
||||
"note": "Added:\n- Settings compose: display a dialog to warn if there are missing media description (default disabled)\n- Settings > Notification: disable battery optimization\n- Settings > Timelines: AutoPlay gif media (default: enabled)\n\nFixed:\n- Fix an issue with cache and fetch more\n- Cache view with large fonts\n- Bad behaviors with truncated messages"
|
||||
},
|
||||
{
|
||||
"version": "3.19.0",
|
||||
"code": "481",
|
||||
|
|
|
@ -44,6 +44,7 @@ import android.graphics.PorterDuff;
|
|||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
|
@ -91,6 +92,12 @@ import com.bumptech.glide.ListPreloader;
|
|||
import com.bumptech.glide.RequestBuilder;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.github.stom79.mytransl.MyTransL;
|
||||
import com.google.android.exoplayer2.ExoPlayer;
|
||||
import com.google.android.exoplayer2.MediaItem;
|
||||
import com.google.android.exoplayer2.Player;
|
||||
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
|
||||
import com.google.android.exoplayer2.upstream.DataSource;
|
||||
import com.google.android.exoplayer2.upstream.DefaultDataSource;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.smarteist.autoimageslider.SliderAnimations;
|
||||
import com.smarteist.autoimageslider.SliderView;
|
||||
|
@ -141,6 +148,7 @@ import app.fedilab.android.mastodon.client.entities.app.StatusDraft;
|
|||
import app.fedilab.android.mastodon.client.entities.app.Timeline;
|
||||
import app.fedilab.android.mastodon.exception.DBException;
|
||||
import app.fedilab.android.mastodon.helper.BlurHashDecoder;
|
||||
import app.fedilab.android.mastodon.helper.CacheDataSourceFactory;
|
||||
import app.fedilab.android.mastodon.helper.CrossActionHelper;
|
||||
import app.fedilab.android.mastodon.helper.GlideApp;
|
||||
import app.fedilab.android.mastodon.helper.GlideFocus;
|
||||
|
@ -1438,6 +1446,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
});
|
||||
} else {
|
||||
int mediaPosition = 1;
|
||||
boolean autoplaygif = sharedpreferences.getBoolean(context.getString(R.string.SET_AUTO_PLAY_GIG_MEDIA), true);
|
||||
if (!fullAttachement || statusToDeal.sensitive) {
|
||||
int defaultHeight = (int) Helper.convertDpToPixel(300, context);
|
||||
if (measuredWidth > 0) {
|
||||
|
@ -1530,10 +1539,72 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
ratio = measuredWidth > 0 ? measuredWidth / mediaW : 1.0f;
|
||||
}
|
||||
}
|
||||
loadAndAddAttachment(context, layoutMediaBinding, holder, adapter, mediaPosition, mediaW, mediaH, ratio, statusToDeal, attachment);
|
||||
if (autoplaygif && attachment.type.equalsIgnoreCase("gifv")) {
|
||||
|
||||
layoutMediaBinding.media.setVisibility(View.GONE);
|
||||
layoutMediaBinding.mediaVideo.setVisibility(View.VISIBLE);
|
||||
LinearLayout.LayoutParams lp;
|
||||
if (fullAttachement && mediaH > 0 && (!statusToDeal.sensitive || expand_media)) {
|
||||
lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, (int) (mediaH * ratio));
|
||||
} else {
|
||||
lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
}
|
||||
layoutMediaBinding.mediaVideo.setLayoutParams(lp);
|
||||
|
||||
|
||||
layoutMediaBinding.mediaVideo.onResume();
|
||||
Uri uri = Uri.parse(attachment.url);
|
||||
int video_cache = sharedpreferences.getInt(context.getString(R.string.SET_VIDEO_CACHE), Helper.DEFAULT_VIDEO_CACHE_MB);
|
||||
ProgressiveMediaSource videoSource;
|
||||
MediaItem mediaItem = new MediaItem.Builder().setUri(uri).build();
|
||||
if (video_cache == 0) {
|
||||
DataSource.Factory dataSourceFactory = new DefaultDataSource.Factory(context);
|
||||
videoSource = new ProgressiveMediaSource.Factory(dataSourceFactory)
|
||||
.createMediaSource(mediaItem);
|
||||
} else {
|
||||
CacheDataSourceFactory cacheDataSourceFactory = new CacheDataSourceFactory(context);
|
||||
videoSource = new ProgressiveMediaSource.Factory(cacheDataSourceFactory)
|
||||
.createMediaSource(mediaItem);
|
||||
}
|
||||
ExoPlayer player = new ExoPlayer.Builder(context).build();
|
||||
player.setRepeatMode(Player.REPEAT_MODE_ONE);
|
||||
layoutMediaBinding.mediaVideo.setPlayer(player);
|
||||
player.setMediaSource(videoSource);
|
||||
player.prepare();
|
||||
player.setPlayWhenReady(true);
|
||||
} else {
|
||||
loadAndAddAttachment(context, layoutMediaBinding, holder, adapter, mediaPosition, mediaW, mediaH, ratio, statusToDeal, attachment);
|
||||
}
|
||||
|
||||
} else if (layoutMediaBinding != null) {
|
||||
loadAndAddAttachment(context, layoutMediaBinding, holder, adapter, mediaPosition, -1.f, -1.f, -1.f, statusToDeal, attachment);
|
||||
if (autoplaygif && attachment.type.equalsIgnoreCase("gifv")) {
|
||||
layoutMediaBinding.media.setVisibility(View.GONE);
|
||||
layoutMediaBinding.mediaVideo.setVisibility(View.VISIBLE);
|
||||
layoutMediaBinding.mediaVideo.onResume();
|
||||
Uri uri = Uri.parse(attachment.url);
|
||||
int video_cache = sharedpreferences.getInt(context.getString(R.string.SET_VIDEO_CACHE), Helper.DEFAULT_VIDEO_CACHE_MB);
|
||||
ProgressiveMediaSource videoSource;
|
||||
MediaItem mediaItem = new MediaItem.Builder().setUri(uri).build();
|
||||
if (video_cache == 0) {
|
||||
DataSource.Factory dataSourceFactory = new DefaultDataSource.Factory(context);
|
||||
videoSource = new ProgressiveMediaSource.Factory(dataSourceFactory)
|
||||
.createMediaSource(mediaItem);
|
||||
} else {
|
||||
CacheDataSourceFactory cacheDataSourceFactory = new CacheDataSourceFactory(context);
|
||||
videoSource = new ProgressiveMediaSource.Factory(cacheDataSourceFactory)
|
||||
.createMediaSource(mediaItem);
|
||||
}
|
||||
ExoPlayer player = new ExoPlayer.Builder(context).build();
|
||||
player.setRepeatMode(Player.REPEAT_MODE_ONE);
|
||||
layoutMediaBinding.mediaVideo.setPlayer(player);
|
||||
player.setMediaSource(videoSource);
|
||||
player.prepare();
|
||||
player.setPlayWhenReady(true);
|
||||
|
||||
} else {
|
||||
loadAndAddAttachment(context, layoutMediaBinding, holder, adapter, mediaPosition, -1.f, -1.f, -1.f, statusToDeal, attachment);
|
||||
}
|
||||
|
||||
}
|
||||
mediaPosition++;
|
||||
}
|
||||
|
@ -2391,7 +2462,9 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
layoutMediaBinding.media.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
}
|
||||
|
||||
layoutMediaBinding.media.setVisibility(View.VISIBLE);
|
||||
layoutMediaBinding.mediaVideo.setVisibility(View.GONE);
|
||||
layoutMediaBinding.mediaVideo.onPause();
|
||||
layoutMediaBinding.media.setLayoutParams(lp);
|
||||
|
||||
float focusX = 0.f;
|
||||
|
|
|
@ -18,6 +18,18 @@
|
|||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<com.google.android.exoplayer2.ui.PlayerView
|
||||
android:id="@+id/media_video"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerInParent="true"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:use_controller="false"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/play_video"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -1065,7 +1065,7 @@
|
|||
|
||||
|
||||
<string name="SET_DEFAULT_THEME" translatable="false">SYSTEM</string>
|
||||
|
||||
<string name="SET_AUTO_PLAY_GIG_MEDIA" translatable="false">SET_AUTO_PLAY_GIG_MEDIA</string>
|
||||
<string name="SET_FULL_PREVIEW" translatable="false">SET_FULL_PREVIEW</string>
|
||||
<string name="SET_SHARE_DETAILS" translatable="false">SET_SHARE_DETAILS</string>
|
||||
<string name="SET_CUSTOM_SHARING" translatable="false">SET_CUSTOM_SHARING</string>
|
||||
|
@ -1926,4 +1926,5 @@
|
|||
<string name="set_alt_text_mandatory_description_warn">If there are missing media a dialog will be displayed with the ability to send the message without media description</string>
|
||||
<string name="send_anyway">Send anyway</string>
|
||||
<string name="set_remove_battery">Ignore battery optimizations</string>
|
||||
<string name="set_autoplay_gif">Autoplay animated media</string>
|
||||
</resources>
|
|
@ -200,12 +200,21 @@
|
|||
app:key="@string/SET_FULL_PREVIEW"
|
||||
app:singleLineTitle="false"
|
||||
app:title="@string/set_fit_preview" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
app:iconSpaceReserved="false"
|
||||
app:key="@string/SET_AUTO_PLAY_GIG_MEDIA"
|
||||
app:singleLineTitle="false"
|
||||
app:title="@string/set_autoplay_gif" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
app:iconSpaceReserved="false"
|
||||
app:key="@string/SET_DISABLE_GIF"
|
||||
app:singleLineTitle="false"
|
||||
app:title="@string/set_disable_gif" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
app:iconSpaceReserved="false"
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
Added:
|
||||
- Settings compose: display a dialog to warn if there are missing media description (default disabled)
|
||||
- Settings > Notification: disable battery optimization
|
||||
|
||||
Changed:
|
||||
-
|
||||
- Settings > Timelines: AutoPlay gif media (default: enabled)
|
||||
|
||||
Fixed:
|
||||
- Fix an issue with cache and fetch more
|
||||
|
|
Loading…
Reference in a new issue