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);
}
});
}
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);
}
}
}
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));
}
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();
}
}
});
}
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);
}
});
}
Aggregations