Search in sources :

Example 1 with IconTextView

use of com.joanzapata.iconify.widget.IconTextView 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

Intent (android.content.Intent)1 LightingColorFilter (android.graphics.LightingColorFilter)1 SearchView (android.support.v7.widget.SearchView)1 LayoutInflater (android.view.LayoutInflater)1 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 ImageButton (android.widget.ImageButton)1 ImageView (android.widget.ImageView)1 ListView (android.widget.ListView)1 TextView (android.widget.TextView)1 IconTextView (com.joanzapata.iconify.widget.IconTextView)1 FastBlurTransformation (de.danoeh.antennapod.core.glide.FastBlurTransformation)1