remove drawable compat code

This commit is contained in:
Conny Duck 2018-09-09 22:29:11 +02:00
parent 1e194e86bf
commit 6513ee29b5
6 changed files with 2 additions and 13 deletions

View File

@ -22,7 +22,6 @@ android {
versionCode 49
versionName "3.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary true
}
buildTypes {
release {

View File

@ -24,7 +24,6 @@ import android.content.Context;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.text.emoji.EmojiCompat;
import android.support.v7.app.AppCompatDelegate;
import com.evernote.android.job.JobManager;
import com.jakewharton.picasso.OkHttp3Downloader;
@ -95,8 +94,6 @@ public class TuskyApplication extends Application implements HasActivityInjector
JobManager.create(this).addJobCreator(notificationPullJobCreator);
//necessary for Android < API 21
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
}
/**

View File

@ -257,9 +257,6 @@ public class NotificationsAdapter extends RecyclerView.Adapter {
usernameView = itemView.findViewById(R.id.notification_username);
displayNameView = itemView.findViewById(R.id.notification_display_name);
avatar = itemView.findViewById(R.id.notification_avatar);
//workaround because Android < API 21 does not support setting drawableLeft from xml when it is a vector image
Drawable followIcon = ContextCompat.getDrawable(message.getContext(), R.drawable.ic_person_add_24dp);
message.setCompoundDrawablesWithIntrinsicBounds(followIcon, null, null, null);
}
void setMessage(Account account, BidiFormatter bidiFormatter) {

View File

@ -16,7 +16,6 @@
package com.keylesspalace.tusky.adapter;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
@ -24,7 +23,6 @@ import android.widget.TextView;
import com.keylesspalace.tusky.R;
import com.keylesspalace.tusky.interfaces.StatusActionListener;
import com.keylesspalace.tusky.util.ThemeUtils;
import com.keylesspalace.tusky.viewdata.StatusViewData;
import com.squareup.picasso.Picasso;
@ -38,10 +36,6 @@ public class StatusViewHolder extends StatusBaseViewHolder {
super(itemView, useAbsoluteTime);
avatarReblog = itemView.findViewById(R.id.status_avatar_reblog);
rebloggedBar = itemView.findViewById(R.id.status_reblogged);
//workaround because Android < API 21 does not support setting drawableLeft from xml when it is a vector image
Drawable rebloggedIcon = ThemeUtils.getDrawable(rebloggedBar.getContext(),
R.attr.status_reblog_small_drawable, R.drawable.ic_reblog_dark_18dp);
rebloggedBar.setCompoundDrawablesWithIntrinsicBounds(rebloggedIcon, null, null, null);
}
@Override

View File

@ -18,6 +18,7 @@
android:layout_marginBottom="4dp"
android:layout_marginTop="8dp"
android:drawablePadding="10dp"
android:drawableStart="@drawable/ic_person_add_24dp"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"

View File

@ -13,6 +13,7 @@
<android.support.text.emoji.widget.EmojiTextView
android:id="@+id/status_reblogged"
android:drawableStart="?attr/status_reblog_small_drawable"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/status_reblogged_bar_padding_top"