mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 00:37:47 +00:00
Make sure nav drawable is mutable before tinting
This commit is contained in:
parent
99ea6f9812
commit
40caf20188
@ -4,6 +4,7 @@ package org.thoughtcrime.securesms.components;
|
||||
import android.animation.Animator;
|
||||
import android.content.Context;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.support.annotation.MainThread;
|
||||
import android.support.annotation.Nullable;
|
||||
@ -40,15 +41,17 @@ public class SearchToolbar extends LinearLayout {
|
||||
initialize();
|
||||
}
|
||||
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
private void initialize() {
|
||||
inflate(getContext(), R.layout.search_toolbar, this);
|
||||
setOrientation(VERTICAL);
|
||||
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
|
||||
toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);
|
||||
toolbar.getNavigationIcon().setColorFilter(getContext().getResources().getColor(R.color.grey_700), PorterDuff.Mode.SRC_IN);
|
||||
Drawable drawable = getContext().getResources().getDrawable(R.drawable.ic_arrow_back_white_24dp);
|
||||
drawable.mutate();
|
||||
drawable.setColorFilter(getContext().getResources().getColor(R.color.grey_700), PorterDuff.Mode.SRC_IN);
|
||||
|
||||
toolbar.setNavigationIcon(drawable);
|
||||
toolbar.inflateMenu(R.menu.conversation_list_search);
|
||||
|
||||
this.searchItem = toolbar.getMenu().findItem(R.id.action_filter_search);
|
||||
|
Loading…
x
Reference in New Issue
Block a user