Remove TextDrawable dependency.

fork-5.53.8
Alex Hart 2021-11-30 12:56:41 -04:00 zatwierdzone przez Greyson Parrelli
rodzic f9c4fe736a
commit 9f9bf3c604
4 zmienionych plików z 6 dodań i 14 usunięć

Wyświetl plik

@ -24,12 +24,6 @@ repositories {
includeGroupByRegex "org\\.signal.*"
}
}
maven { // textdrawable
url 'https://dl.bintray.com/amulyakhare/maven'
content {
includeGroupByRegex "com\\.amulyakhare.*"
}
}
maven {
url "https://www.jitpack.io"
}
@ -46,7 +40,6 @@ repositories {
includeVersion "cn.carbswang.android", "NumberPickerView", "1.0.9"
includeVersion "com.takisoft.fix", "colorpicker", "0.9.1"
includeVersion "com.codewaves.stickyheadergrid", "stickyheadergrid", "0.9.4"
includeVersion "com.amulyakhare", "com.amulyakhare.textdrawable", "1.0.1"
includeVersion "com.google.android", "flexbox", "0.3.0"
}
}
@ -480,7 +473,6 @@ dependencies {
implementation libs.floatingactionbutton
implementation libs.google.zxing.android.integration
implementation libs.time.duration.picker
implementation libs.textdrawable
implementation libs.google.zxing.core
implementation (libs.subsampling.scale.image.view) {
exclude group: 'com.android.support', module: 'support-annotations'

Wyświetl plik

@ -10,14 +10,17 @@ import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.content.ContextCompat;
import com.amulyakhare.textdrawable.TextDrawable;
import com.makeramen.roundedimageview.RoundedDrawable;
import org.jetbrains.annotations.NotNull;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.avatar.Avatars;
import org.thoughtcrime.securesms.conversation.colors.AvatarColor;
import java.util.Objects;
public class ResourceContactPhoto implements FallbackContactPhoto {
private final int resourceId;
@ -61,11 +64,12 @@ public class ResourceContactPhoto implements FallbackContactPhoto {
private @NonNull Drawable buildDrawable(@NonNull Context context, int resourceId, @NonNull AvatarColor color, boolean inverted) {
Avatars.ForegroundColor foregroundColor = Avatars.getForegroundColor(color);
Drawable background = TextDrawable.builder().buildRound(" ", inverted ? foregroundColor.getColorInt() : color.colorInt());
Drawable background = Objects.requireNonNull(ContextCompat.getDrawable(context, R.drawable.circle_tintable));
RoundedDrawable foreground = (RoundedDrawable) RoundedDrawable.fromDrawable(AppCompatResources.getDrawable(context, resourceId));
//noinspection ConstantConditions
foreground.setScaleType(scaleType);
background.setColorFilter(inverted ? foregroundColor.getColorInt() : color.colorInt(), PorterDuff.Mode.SRC_IN);
foreground.setColorFilter(inverted ? color.colorInt() : foregroundColor.getColorInt(), PorterDuff.Mode.SRC_ATOP);
return new ExpandingLayerDrawable(new Drawable[] {background, foreground});

Wyświetl plik

@ -258,9 +258,6 @@ dependencyVerification {
['com.airbnb.android:lottie:3.6.0',
'70ea0650e82fd858e317af60ee1ffd84bc6f406bbcf017cedcc45217408e20d1'],
['com.amulyakhare:com.amulyakhare.textdrawable:1.0.1',
'54c92b5fba38cfd316a07e5a30528068f45ce8515a6890f1297df4c401af5dcb'],
['com.annimon:stream:1.1.8',
'5da6e2e3e0551d61a3ea7014f04312276549e3dd739cf637996e4cf43c5535b9'],

Wyświetl plik

@ -101,7 +101,6 @@ dependencyResolutionManagement {
alias('waitingdots').to('pl.tajchert:waitingdots:0.1.0')
alias('floatingactionbutton').to('com.melnykov:floatingactionbutton:1.3.0')
alias('time-duration-picker').to('mobi.upod:time-duration-picker:1.1.3')
alias('textdrawable').to('com.amulyakhare:com.amulyakhare.textdrawable:1.0.1')
alias('subsampling-scale-image-view').to('com.davemorrissey.labs:subsampling-scale-image-view:3.10.0')
alias('numberpickerview').to('cn.carbswang.android:NumberPickerView:1.0.9')
alias('android-tooltips').to('com.tomergoldst.android:tooltips:1.0.6')