Search in sources :

Example 16 with SimpleImageLoadingListener

use of com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener in project ForPDA by RadiationX.

the class AuthFragment method onLoadForm.

private void onLoadForm(AuthForm authForm) {
    if (authForm.getBody() == null)
        return;
    this.authForm = authForm;
    captchaProgress.setVisibility(View.VISIBLE);
    captchaImage.setVisibility(View.GONE);
    ImageLoader.getInstance().displayImage(authForm.getCaptchaImageUrl(), captchaImage, new SimpleImageLoadingListener() {

        @Override
        public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
            captchaProgress.setVisibility(View.GONE);
            captchaImage.setVisibility(View.VISIBLE);
        }
    });
}
Also used : SimpleImageLoadingListener(com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener) Bitmap(android.graphics.Bitmap) CircularProgressView(com.github.rahatarmanahmed.cpv.CircularProgressView) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView)

Example 17 with SimpleImageLoadingListener

use of com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener in project ForPDA by RadiationX.

the class ProfileFragment method onProfileLoad.

private void onProfileLoad(ProfileModel profile) {
    currentProfile = profile;
    if (currentProfile.getNick() == null)
        return;
    adapter.setProfile(currentProfile);
    adapter.notifyDataSetChanged();
    refreshToolbarMenuItems(true);
    ImageLoader.getInstance().loadImage(currentProfile.getAvatar(), new SimpleImageLoadingListener() {

        @Override
        public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
            // Нужен handler, иначе при повторном создании фрагмента неверно вычисляется высота вьюхи
            new Handler().post(() -> {
                if (!isAdded())
                    return;
                blur(loadedImage);
                Bitmap overlay = Bitmap.createBitmap(loadedImage.getWidth(), loadedImage.getHeight(), Bitmap.Config.RGB_565);
                overlay.eraseColor(Color.WHITE);
                Canvas canvas = new Canvas(overlay);
                canvas.drawBitmap(loadedImage, 0, 0, new Paint(Paint.FILTER_BITMAP_FLAG));
                AlphaAnimation animation = new AlphaAnimation(0, 1);
                animation.setDuration(500);
                animation.setFillAfter(true);
                avatar.setImageBitmap(overlay);
                avatar.startAnimation(animation);
                AlphaAnimation animation1 = new AlphaAnimation(1, 0);
                animation1.setDuration(500);
                animation1.setFillAfter(true);
                progressView.startAnimation(animation1);
                new Handler().postDelayed(() -> {
                    progressView.stopAnimation();
                    progressView.setVisibility(View.GONE);
                }, 500);
            });
        }
    });
    setTabTitle(String.format(getString(R.string.profile_with_Nick), currentProfile.getNick()));
    setTitle(currentProfile.getNick());
    nick.setText(currentProfile.getNick());
    group.setText(currentProfile.getGroup());
    if (currentProfile.getSign() != null) {
        sign.setText(currentProfile.getSign());
        sign.setVisibility(View.VISIBLE);
        sign.setMovementMethod(LinkMovementMethod.getInstance());
    }
    if (!currentProfile.getContacts().isEmpty()) {
        if (!Pattern.compile("showuser=".concat(Integer.toString(ClientHelper.getUserId()))).matcher(tab_url).find()) {
            writeMenuItem.setVisible(true);
        } else {
            writeMenuItem.setVisible(false);
        }
    }
}
Also used : SimpleImageLoadingListener(com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener) Bitmap(android.graphics.Bitmap) Canvas(android.graphics.Canvas) Handler(android.os.Handler) IntentHandler(forpdateam.ru.forpda.common.IntentHandler) Paint(android.graphics.Paint) CircularProgressView(com.github.rahatarmanahmed.cpv.CircularProgressView) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 18 with SimpleImageLoadingListener

use of com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener in project LibreraReader by foobnix.

the class BookmarksAdapter2 method onBindViewHolder.

@Override
public void onBindViewHolder(final BookmarksViewHolder holder, final int position) {
    final AppBookmark item = getItem(position);
    holder.page.setText("" + item.getPage());
    holder.title.setText("" + item.getTitle());
    holder.text.setText(item.getText());
    holder.remove.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            onDeleteClickListener.onResultRecive(item);
        }
    });
    if (withTitle) {
        holder.title.setVisibility(View.VISIBLE);
    } else {
        holder.title.setVisibility(View.GONE);
    }
    TintUtil.setTintBgSimple(holder.page, 240);
    holder.page.setTextColor(Color.WHITE);
    if (withPageNumber) {
        holder.page.setVisibility(View.VISIBLE);
        holder.remove.setVisibility(View.VISIBLE);
    } else {
        holder.page.setVisibility(View.GONE);
        holder.remove.setVisibility(View.GONE);
    }
    IMG.getCoverPageWithEffectPos(holder.image, item.getPath(), IMG.getImageSize(), position, new SimpleImageLoadingListener() {

        @Override
        public void onLoadingComplete(String arg0, View arg1, Bitmap arg2) {
        }
    });
    if (!AppState.get().isBorderAndShadow) {
        holder.parent.setBackgroundColor(Color.TRANSPARENT);
    }
    bindItemClickAndLongClickListeners(holder.parent, getItem(position));
}
Also used : SimpleImageLoadingListener(com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener) AppBookmark(com.foobnix.pdf.info.wrapper.AppBookmark) Bitmap(android.graphics.Bitmap) OnClickListener(android.view.View.OnClickListener) CardView(android.support.v7.widget.CardView) ImageView(android.widget.ImageView) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View)

Example 19 with SimpleImageLoadingListener

use of com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener in project LibreraReader by foobnix.

the class Safe method run.

public static void run(final Runnable action) {
    ImageLoader.getInstance().clearAllTasks();
    ImageLoader.getInstance().loadImage(TXT_SAFE_RUN, IMG.noneOptions, new SimpleImageLoadingListener() {

        @Override
        public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
            LOG.d(TXT_SAFE_RUN, "end", imageUri, "action", action);
            if (action != null) {
                ImageLoader.getInstance().clearAllTasks();
                action.run();
            }
        }
    });
}
Also used : SimpleImageLoadingListener(com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener) Bitmap(android.graphics.Bitmap) View(android.view.View)

Example 20 with SimpleImageLoadingListener

use of com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener in project Android-Universal-Image-Loader by nostra13.

the class UILWidgetProvider method updateAppWidget.

static void updateAppWidget(Context context, final AppWidgetManager appWidgetManager, final int appWidgetId) {
    final RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget);
    // 70 - approximate size of ImageView in widget
    ImageSize minImageSize = new ImageSize(70, 70);
    ImageLoader.getInstance().loadImage(IMAGES[0], minImageSize, displayOptions, new SimpleImageLoadingListener() {

        @Override
        public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
            views.setImageViewBitmap(R.id.image_left, loadedImage);
            appWidgetManager.updateAppWidget(appWidgetId, views);
        }
    });
    ImageLoader.getInstance().loadImage(IMAGES[1], minImageSize, displayOptions, new SimpleImageLoadingListener() {

        @Override
        public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
            views.setImageViewBitmap(R.id.image_right, loadedImage);
            appWidgetManager.updateAppWidget(appWidgetId, views);
        }
    });
}
Also used : SimpleImageLoadingListener(com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener) RemoteViews(android.widget.RemoteViews) Bitmap(android.graphics.Bitmap) ImageSize(com.nostra13.universalimageloader.core.assist.ImageSize) View(android.view.View)

Aggregations

View (android.view.View)23 Bitmap (android.graphics.Bitmap)22 SimpleImageLoadingListener (com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener)22 TextView (android.widget.TextView)15 ImageView (android.widget.ImageView)14 FailReason (com.nostra13.universalimageloader.core.assist.FailReason)11 DisplayImageOptions (com.nostra13.universalimageloader.core.DisplayImageOptions)8 RecyclerView (android.support.v7.widget.RecyclerView)4 Palette (androidx.palette.graphics.Palette)4 RecyclerView (androidx.recyclerview.widget.RecyclerView)4 Handler (android.os.Handler)3 ViewGroup (android.view.ViewGroup)3 CircularProgressView (com.github.rahatarmanahmed.cpv.CircularProgressView)3 ImageSize (com.nostra13.universalimageloader.core.assist.ImageSize)3 PagerAdapter (android.support.v4.view.PagerAdapter)2 OnClickListener (android.view.View.OnClickListener)2 ArtistInfoListener (com.naman14.timber.lastfmapi.callbacks.ArtistInfoListener)2 Album (com.naman14.timber.models.Album)2 List (java.util.List)2 Context (android.content.Context)1