Search in sources :

Example 31 with LightingColorFilter

use of android.graphics.LightingColorFilter in project wire-android by wireapp.

the class AudioMessageRecordingView method setAccentColor.

public void setAccentColor(int color) {
    Drawable drawable = recordingSeekBar.getProgressDrawable();
    if (drawable == null) {
        return;
    }
    if (drawable instanceof LayerDrawable) {
        LayerDrawable layerDrawable = (LayerDrawable) drawable;
        Drawable progress = layerDrawable.findDrawableByLayerId(android.R.id.progress);
        if (progress != null) {
            drawable = progress;
        }
    }
    drawable.setColorFilter(new LightingColorFilter(0xFF000000, color));
    drawable = recordingSeekBar.getThumb();
    drawable.setColorFilter(new LightingColorFilter(0xFF000000, color));
}
Also used : LayerDrawable(android.graphics.drawable.LayerDrawable) LayerDrawable(android.graphics.drawable.LayerDrawable) Drawable(android.graphics.drawable.Drawable) LightingColorFilter(android.graphics.LightingColorFilter)

Example 32 with LightingColorFilter

use of android.graphics.LightingColorFilter in project AntennaPod by AntennaPod.

the class ItemlistFragment method setupHeaderView.

private void setupHeaderView() {
    if (getListView() == null || feed == null) {
        Log.e(TAG, "Unable to setup listview: recyclerView = null or feed = null");
        return;
    }
    ListView lv = getListView();
    LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View header = inflater.inflate(R.layout.feeditemlist_header, lv, false);
    lv.addHeaderView(header);
    txtvTitle = (TextView) header.findViewById(R.id.txtvTitle);
    TextView txtvAuthor = (TextView) header.findViewById(R.id.txtvAuthor);
    ImageView imgvBackground = (ImageView) header.findViewById(R.id.imgvBackground);
    ImageView imgvCover = (ImageView) header.findViewById(R.id.imgvCover);
    ImageButton butShowInfo = (ImageButton) header.findViewById(R.id.butShowInfo);
    txtvInformation = (TextView) header.findViewById(R.id.txtvInformation);
    txtvFailure = (IconTextView) header.findViewById(R.id.txtvFailure);
    txtvTitle.setText(feed.getTitle());
    txtvAuthor.setText(feed.getAuthor());
    // https://github.com/bumptech/glide/issues/529
    imgvBackground.setColorFilter(new LightingColorFilter(0xff828282, 0x000000));
    Glide.with(getActivity()).load(feed.getImageLocation()).placeholder(R.color.image_readability_tint).error(R.color.image_readability_tint).diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY).transform(new FastBlurTransformation(getActivity())).dontAnimate().into(imgvBackground);
    Glide.with(getActivity()).load(feed.getImageLocation()).placeholder(R.color.light_gray).error(R.color.light_gray).diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY).fitCenter().dontAnimate().into(imgvCover);
    butShowInfo.setOnClickListener(v -> {
        if (viewsCreated && itemsLoaded) {
            Intent startIntent = new Intent(getActivity(), FeedInfoActivity.class);
            startIntent.putExtra(FeedInfoActivity.EXTRA_FEED_ID, feed.getId());
            startActivity(startIntent);
        }
    });
    headerCreated = true;
}
Also used : ImageButton(android.widget.ImageButton) ListView(android.widget.ListView) FastBlurTransformation(de.danoeh.antennapod.core.glide.FastBlurTransformation) LayoutInflater(android.view.LayoutInflater) LightingColorFilter(android.graphics.LightingColorFilter) TextView(android.widget.TextView) IconTextView(com.joanzapata.iconify.widget.IconTextView) Intent(android.content.Intent) ImageView(android.widget.ImageView) SearchView(android.support.v7.widget.SearchView) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) ListView(android.widget.ListView) IconTextView(com.joanzapata.iconify.widget.IconTextView)

Aggregations

LightingColorFilter (android.graphics.LightingColorFilter)32 ColorFilter (android.graphics.ColorFilter)20 Drawable (android.graphics.drawable.Drawable)18 LayerDrawable (android.graphics.drawable.LayerDrawable)17 FilterableStateListDrawable (com.simplecity.amp_library.ui.views.FilterableStateListDrawable)16 ImageView (android.widget.ImageView)5 View (android.view.View)4 Canvas (android.graphics.Canvas)3 TextView (android.widget.TextView)3 Bitmap (android.graphics.Bitmap)2 SearchView (android.support.v7.widget.SearchView)2 LayoutInflater (android.view.LayoutInflater)2 AdapterView (android.widget.AdapterView)2 ListView (android.widget.ListView)2 Intent (android.content.Intent)1 SharedPreferences (android.content.SharedPreferences)1 Rect (android.graphics.Rect)1 ColorDrawable (android.graphics.drawable.ColorDrawable)1 NinePatchDrawable (android.graphics.drawable.NinePatchDrawable)1 RecyclerView (android.support.v7.widget.RecyclerView)1