Release 3.16.0

This commit is contained in:
Thomas 2023-01-27 18:35:27 +01:00
parent 575329586f
commit 9683fee1e6
4 changed files with 63 additions and 7 deletions

View file

@ -13,8 +13,8 @@ android {
defaultConfig { defaultConfig {
minSdk 21 minSdk 21
targetSdk 33 targetSdk 33
versionCode 471 versionCode 472
versionName "3.15.2" versionName "3.16.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
flavorDimensions "default" flavorDimensions "default"

View file

@ -1,4 +1,9 @@
[ [
{
"version": "3.16.0",
"code": "472",
"note": "Changed:\n- Peertube support\n- Compose shortcut\n- Long press compose button to write with another account\n\nChanged:\n- Cross actions with two accounts display a dialog\n- Order & compact og values when sharing > title - url - content\n\nFixed:\n- Text cleared when adding a media\n- Fix crashes"
},
{ {
"version": "3.15.2", "version": "3.15.2",
"code": "471", "code": "471",

View file

@ -54,6 +54,8 @@ import android.webkit.WebView;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.Toast; import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.core.app.ActivityCompat; import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
@ -65,6 +67,8 @@ import com.bumptech.glide.RequestBuilder;
import com.bumptech.glide.load.resource.bitmap.CenterCrop; import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners; import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition;
import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import java.io.IOException; import java.io.IOException;
@ -379,10 +383,36 @@ public class Helper {
} }
try { try {
RequestBuilder<Drawable> requestBuilder = Glide.with(imageView.getContext()) RequestBuilder<Drawable> requestBuilder = Glide.with(imageView.getContext())
.load(url) .load(url);
.thumbnail(0.1f);
requestBuilder.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10))) requestBuilder.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10)))
.into(imageView); .into(new CustomTarget<Drawable>() {
@Override
public void onResourceReady(@NonNull Drawable resource, Transition<? super Drawable> transition) {
imageView.setImageDrawable(resource);
}
@Override
public void onLoadFailed(@Nullable Drawable errorDrawable) {
super.onLoadFailed(errorDrawable);
BitmapDrawable avatar = new AvatarGenerator.AvatarBuilder(context)
.setLabel(channel.getAcct())
.setAvatarSize(120)
.setTextSize(30)
.toSquare()
.setBackgroundColor(fetchAccentColor(context))
.build();
Glide.with(imageView.getContext())
.asDrawable()
.load(avatar)
.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10)))
.into(imageView);
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
}
});
} catch (Exception e) { } catch (Exception e) {
try { try {
BitmapDrawable avatar = new AvatarGenerator.AvatarBuilder(context) BitmapDrawable avatar = new AvatarGenerator.AvatarBuilder(context)
@ -429,7 +459,27 @@ public class Helper {
} else { } else {
requestBuilder.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(round))); requestBuilder.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(round)));
} }
requestBuilder.into(imageView); requestBuilder.into(new CustomTarget<Drawable>() {
@Override
public void onResourceReady(@NonNull Drawable resource, Transition<? super Drawable> transition) {
imageView.setImageDrawable(resource);
}
@Override
public void onLoadFailed(@Nullable Drawable errorDrawable) {
super.onLoadFailed(errorDrawable);
Glide.with(imageView.getContext())
.asDrawable()
.load(R.drawable.missing_peertube)
.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10)))
.into(imageView);
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
}
});
} catch (Exception e) { } catch (Exception e) {
try { try {
Glide.with(imageView.getContext()) Glide.with(imageView.getContext())

View file

@ -27,6 +27,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp" android:layout_marginTop="6dp"
android:background="?colorSecondaryContainer" android:background="?colorSecondaryContainer"
android:textColor="?colorOnSecondaryContainer"
android:padding="6dp" android:padding="6dp"
android:textAlignment="center" android:textAlignment="center"
android:textAppearance="@style/TextAppearance.Material3.TitleLarge" android:textAppearance="@style/TextAppearance.Material3.TitleLarge"
@ -156,7 +157,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.Material3.TitleMedium" android:textAppearance="@style/TextAppearance.Material3.TitleMedium"
android:textColor="?colorAccent" android:textColor="?colorPrimary"
android:textStyle="bold" android:textStyle="bold"
tools:maxLines="1" tools:maxLines="1"
tools:text="@tools:sample/lorem/random" /> tools:text="@tools:sample/lorem/random" />