background tinting
This commit is contained in:
@@ -2,7 +2,9 @@ package net.headlezz.notificationlogger.notificationlist;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.v4.graphics.drawable.DrawableCompat;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.text.format.DateUtils;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -60,7 +62,10 @@ public class NotificationListAdapter extends CursorRecyclerViewAdapter<Notificat
|
||||
ivAppIcon.setImageDrawable(appIcon);
|
||||
ivAppIcon.setContentDescription(String.format(context.getString(R.string.app_icon_cd), n.appName));
|
||||
|
||||
Drawable smallIcon = PackageUtils.getApplicationDrawable(context, n.packageName, n.smallIconId);
|
||||
Drawable smallIcon = DrawableCompat.wrap(PackageUtils.getApplicationDrawable(context, n.packageName, n.smallIconId));
|
||||
DrawableCompat.setTint(smallIcon, Color.BLACK);
|
||||
|
||||
|
||||
ivSmallIcon.setImageDrawable(smallIcon);
|
||||
|
||||
itemView.setTag(n.id);
|
||||
|
||||
@@ -33,8 +33,6 @@ public class NotificationListFragment extends Fragment implements LoaderManager.
|
||||
|
||||
private NotificationListAdapter mAdapter;
|
||||
|
||||
// TODO reload list if new notification arrives
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
|
||||
@@ -25,11 +25,15 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_marginEnd="4dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:id="@+id/notification_item_smallIcon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:contentDescription="@string/notification_small_icon_cd"
|
||||
tools:src="@drawable/ic_sd_card" />
|
||||
tools:src="@drawable/ic_sd_card"
|
||||
android:layout_above="@+id/notification_item_title"
|
||||
android:layout_alignParentTop="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/notification_item_appName"
|
||||
|
||||
Reference in New Issue
Block a user