mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-15 16:55:03 +01:00
improve code scores
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
ed7a762b4c
commit
61e0c88188
@ -145,7 +145,7 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
|
||||
})
|
||||
}
|
||||
|
||||
// store timestamp
|
||||
// store timestamp
|
||||
appPreferences.setPhoneBookIntegrationLastRun(System.currentTimeMillis())
|
||||
|
||||
return Result.success()
|
||||
|
@ -101,6 +101,7 @@ import androidx.annotation.XmlRes;
|
||||
import androidx.appcompat.widget.AppCompatDrawableManager;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.emoji.text.EmojiCompat;
|
||||
@ -160,7 +161,7 @@ public class DisplayUtils {
|
||||
}
|
||||
|
||||
public static Bitmap getRoundedBitmapFromVectorDrawableResource(Resources resources, int resource) {
|
||||
VectorDrawable vectorDrawable = (VectorDrawable) resources.getDrawable(resource);
|
||||
VectorDrawable vectorDrawable = (VectorDrawable) ResourcesCompat.getDrawable(resources, resource,null);
|
||||
Bitmap bitmap = getBitmap(vectorDrawable);
|
||||
new RoundPostprocessor(true).process(bitmap);
|
||||
return bitmap;
|
||||
@ -260,13 +261,14 @@ public class DisplayUtils {
|
||||
}
|
||||
|
||||
public static Drawable getTintedDrawable(Resources res, @DrawableRes int drawableResId, @ColorRes int colorResId) {
|
||||
Drawable drawable = res.getDrawable(drawableResId);
|
||||
Drawable drawable = ResourcesCompat.getDrawable(res, drawableResId,null);;
|
||||
int color = res.getColor(colorResId);
|
||||
drawable.setTint(color);
|
||||
if (drawable != null) {
|
||||
drawable.setTint(color);
|
||||
}
|
||||
return drawable;
|
||||
}
|
||||
|
||||
|
||||
public static Drawable getDrawableForMentionChipSpan(Context context, String id, CharSequence label,
|
||||
UserEntity conversationUser, String type,
|
||||
@XmlRes int chipResource,
|
||||
|
Loading…
Reference in New Issue
Block a user