Search in sources :

Example 36 with SimpleDraweeView

use of com.facebook.drawee.view.SimpleDraweeView in project remusic by aa112901.

the class PlaylistActivity method setHeaderView.

private void setHeaderView() {
    albumArt = (ImageView) findViewById(R.id.album_art);
    playlistTitleView = (TextView) findViewById(R.id.album_title);
    playlistDetailView = (TextView) findViewById(R.id.album_details);
    albumArtSmall = (SimpleDraweeView) findViewById(R.id.playlist_art);
    SpannableString spanString;
    Bitmap b = BitmapFactory.decodeResource(getResources(), R.mipmap.index_icn_earphone);
    ImageSpan imgSpan = new ImageSpan(this, b, ImageSpan.ALIGN_BASELINE);
    spanString = new SpannableString("icon");
    spanString.setSpan(imgSpan, 0, 4, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    playlistCountView = (TextView) findViewById(R.id.playlist_listen_count);
    playlistCountView.setText(spanString);
    if (playlistCount == null) {
        playlistCount = "0";
    }
    int count = Integer.parseInt(playlistCount);
    if (count > 10000) {
        count = count / 10000;
        playlistCountView.append(" " + count + "万");
    } else {
        playlistCountView.append(" " + playlistCount);
    }
    LinearLayout downAll = (LinearLayout) headerViewContent.findViewById(R.id.playlist_down);
    downAll.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            new LoadAllDownInfos((Activity) mContext, mList).execute();
        }
    });
    final LinearLayout addToplaylist = (LinearLayout) headerViewContent.findViewById(R.id.playlist_collect);
    addToplaylist.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (!mCollected) {
                collectText.setText("已收藏");
                new AsyncTask<Void, Void, Void>() {

                    @Override
                    protected Void doInBackground(Void... params) {
                        String albumart = null;
                        for (MusicInfo info : adapterList) {
                            albumart = info.albumData;
                            if (!TextUtils.isEmpty(albumart)) {
                                break;
                            }
                        }
                        PlaylistInfo.getInstance(mContext).addPlaylist(Long.parseLong(playlsitId), playlistName, adapterList.size(), albumart, "net");
                        PlaylistsManager.getInstance(mContext).insertLists(mContext, Long.parseLong(playlsitId), adapterList);
                        Intent intent = new Intent(IConstants.PLAYLIST_COUNT_CHANGED);
                        MainApplication.context.sendBroadcast(intent);
                        mCollected = true;
                        return null;
                    }
                }.execute();
            } else {
                collectText.setText("收藏");
                PlaylistInfo.getInstance(mContext).deletePlaylist(Long.parseLong(playlsitId));
                mCollected = false;
            }
        }
    });
    share.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent shareIntent = new Intent();
            shareIntent.setAction(Intent.ACTION_SEND);
            shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("http://music.baidu.com/songlist/" + playlsitId));
            shareIntent.setType("html/*");
            startActivity(Intent.createChooser(shareIntent, getResources().getString(R.string.shared_to)));
        }
    });
    if (!isLocalPlaylist)
        headerDetail.setVisibility(View.GONE);
    tryAgain.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            loadAllLists();
        }
    });
    if (Integer.parseInt(playlsitId) == IConstants.FAV_PLAYLIST) {
        favLayout.setVisibility(View.VISIBLE);
    }
}
Also used : AsyncTask(android.os.AsyncTask) Intent(android.content.Intent) SpannableString(android.text.SpannableString) ImageView(android.widget.ImageView) ObservableRecyclerView(com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView) SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView) View(android.view.View) TextView(android.widget.TextView) TintImageView(com.bilibili.magicasakura.widgets.TintImageView) RecyclerView(android.support.v7.widget.RecyclerView) SpannableString(android.text.SpannableString) Bitmap(android.graphics.Bitmap) LoadAllDownInfos(com.wm.remusic.dialog.LoadAllDownInfos) MusicInfo(com.wm.remusic.info.MusicInfo) LinearLayout(android.widget.LinearLayout) ImageSpan(android.text.style.ImageSpan)

Example 37 with SimpleDraweeView

use of com.facebook.drawee.view.SimpleDraweeView in project remusic by aa112901.

the class AlbumsDetailActivity method setHeaderView.

private void setHeaderView() {
    albumArt = (ImageView) findViewById(R.id.album_art);
    albumTitle = (TextView) findViewById(R.id.album_title);
    albumArtSmall = (SimpleDraweeView) findViewById(R.id.playlist_art);
    LinearLayout downAll = (LinearLayout) headerViewContent.findViewById(R.id.playlist_down);
    downAll.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            new LoadAllDownInfos((Activity) AlbumsDetailActivity.this, mList).execute();
        }
    });
    tryAgain.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            loadAllLists();
        }
    });
}
Also used : LoadAllDownInfos(com.wm.remusic.dialog.LoadAllDownInfos) ImageView(android.widget.ImageView) ObservableRecyclerView(com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView) SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView) View(android.view.View) TextView(android.widget.TextView) TintImageView(com.bilibili.magicasakura.widgets.TintImageView) RecyclerView(android.support.v7.widget.RecyclerView) LinearLayout(android.widget.LinearLayout)

Example 38 with SimpleDraweeView

use of com.facebook.drawee.view.SimpleDraweeView in project react-native-navigation by wix.

the class CollapsingTopBarBackground method createBackDropImage.

private void createBackDropImage() {
    backdrop = new SimpleDraweeView(getContext());
    setImageSource();
    backdrop.setScaleType(ImageView.ScaleType.CENTER_CROP);
    backdrop.setFitsSystemWindows(true);
    addView(backdrop, new LayoutParams(MATCH_PARENT, MATCH_PARENT));
}
Also used : SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView)

Example 39 with SimpleDraweeView

use of com.facebook.drawee.view.SimpleDraweeView in project Rocket.Chat.Android by RocketChat.

the class RocketChatMessageAttachmentsLayout method showImageAttachment.

private void showImageAttachment(Attachment attachment, View attachmentView, boolean autoloadImages) {
    final View imageContainer = attachmentView.findViewById(R.id.image_container);
    if (attachment.getImageUrl() == null) {
        imageContainer.setVisibility(GONE);
        return;
    }
    imageContainer.setVisibility(VISIBLE);
    final SimpleDraweeView attachedImage = (SimpleDraweeView) attachmentView.findViewById(R.id.image);
    final View load = attachmentView.findViewById(R.id.image_load);
    loadImage(absolutize(attachment.getImageUrl()), attachedImage, load, autoloadImages);
}
Also used : SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView) TextView(android.widget.TextView) SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView) View(android.view.View)

Example 40 with SimpleDraweeView

use of com.facebook.drawee.view.SimpleDraweeView in project Rocket.Chat.Android by RocketChat.

the class RocketChatMessageAttachmentsLayout method showAuthorAttachment.

private void showAuthorAttachment(Attachment attachment, View attachmentView) {
    final View authorBox = attachmentView.findViewById(R.id.author_box);
    AttachmentAuthor author = attachment.getAttachmentAuthor();
    if (author == null) {
        authorBox.setVisibility(GONE);
        return;
    }
    authorBox.setVisibility(VISIBLE);
    FrescoHelper.setupDraweeAndLoadImage(absolutize(author.getIconUrl()), (SimpleDraweeView) attachmentView.findViewById(R.id.author_icon));
    final TextView authorName = (TextView) attachmentView.findViewById(R.id.author_name);
    authorName.setText(author.getName());
    final String link = absolutize(author.getLink());
    authorName.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View view) {
            Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(link));
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            view.getContext().startActivity(intent);
        }
    });
// timestamp and link - need to format time
}
Also used : TextView(android.widget.TextView) Intent(android.content.Intent) TextView(android.widget.TextView) SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView) View(android.view.View) AttachmentAuthor(chat.rocket.core.models.AttachmentAuthor)

Aggregations

SimpleDraweeView (com.facebook.drawee.view.SimpleDraweeView)58 View (android.view.View)30 TextView (android.widget.TextView)20 Uri (android.net.Uri)8 DraweeController (com.facebook.drawee.interfaces.DraweeController)8 Intent (android.content.Intent)6 ImageView (android.widget.ImageView)5 RecyclerView (android.support.v7.widget.RecyclerView)4 Button (android.widget.Button)4 TintImageView (com.bilibili.magicasakura.widgets.TintImageView)4 RoundingParams (com.facebook.drawee.generic.RoundingParams)4 Animatable (android.graphics.drawable.Animatable)3 ViewGroup (android.view.ViewGroup)3 AdapterView (android.widget.AdapterView)3 CompoundButton (android.widget.CompoundButton)3 LinearLayout (android.widget.LinearLayout)3 SwitchCompat (androidx.appcompat.widget.SwitchCompat)3 BaseControllerListener (com.facebook.drawee.controller.BaseControllerListener)3 ControllerListener (com.facebook.drawee.controller.ControllerListener)3 ProgressBarDrawable (com.facebook.drawee.drawable.ProgressBarDrawable)3