Say Hie to 'Glide' bye to 'Picasso'

This commit is contained in:
Rahul Patel
2018-07-08 19:31:27 +05:30
parent 335b47e42f
commit 9eb9620cdd
19 changed files with 192 additions and 209 deletions

View File

@@ -74,13 +74,14 @@ dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:palette-v7:27.1.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.github.percolate:caffeine:0.4.7'
implementation 'com.github.florent37:shapeofview:1.1.1'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
}
private Integer generateVersionCode() {
@@ -92,7 +93,7 @@ private String generateVersionName() {
if (ext.versionClassifier == null) {
if (ext.isSnapshot)
ext.versionClassifier = "SNAPSHOT"
else if(ext.isBeta)
else if (ext.isBeta)
ext.versionClassifier = "β"
else
ext.versionClassifier = "α"

View File

@@ -1,66 +0,0 @@
/*
* Aurora Store
* Copyright (C) 2018 Rahul Kumar Patel <whyorean@gmail.com>
*
* Yalp Store
* Copyright (C) 2018 Sergey Yeriomin <yeriomin@gmail.com>
*
* Aurora Store (a fork of Yalp Store )is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Aurora Store is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Aurora Store. If not, see <http://www.gnu.org/licenses/>.
*/
package com.dragons.aurora;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import com.squareup.picasso.Transformation;
/**
* Created by julian on 13/6/21.
*/
public class CircleTransform implements Transformation {
@Override
public Bitmap transform(Bitmap source) {
int size = Math.min(source.getWidth(), source.getHeight());
int x = (source.getWidth() - size) / 2;
int y = (source.getHeight() - size) / 2;
Bitmap squaredBitmap = Bitmap.createBitmap(source, x, y, size, size);
if (squaredBitmap != source) {
source.recycle();
}
Bitmap bitmap = Bitmap.createBitmap(size, size, source.getConfig());
Canvas canvas = new Canvas(bitmap);
Paint paint = new Paint();
BitmapShader shader = new BitmapShader(squaredBitmap, BitmapShader.TileMode.CLAMP, BitmapShader.TileMode.CLAMP);
paint.setShader(shader);
paint.setAntiAlias(true);
float r = size / 2f;
canvas.drawCircle(r, r, r, paint);
squaredBitmap.recycle();
return bitmap;
}
@Override
public String key() {
return "circle";
}
}

View File

@@ -24,8 +24,8 @@ package com.dragons.aurora.activities;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.graphics.Palette;
import android.text.Editable;
import android.text.TextWatcher;
@@ -37,13 +37,19 @@ import android.widget.ImageView;
import android.widget.ScrollView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.engine.GlideException;
import com.bumptech.glide.load.resource.bitmap.BitmapTransitionOptions;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.Target;
import com.dragons.aurora.R;
import com.dragons.aurora.Util;
import com.dragons.aurora.fragment.details.DownloadOrInstall;
import com.dragons.aurora.model.App;
import com.dragons.aurora.task.playstore.PurchaseCheckTask;
import com.squareup.picasso.Callback;
import com.squareup.picasso.Picasso;
import java.util.Timer;
import java.util.TimerTask;
@@ -133,23 +139,28 @@ public class ManualDownloadActivity extends DetailsActivity {
});
ImageView appIcon = findViewById(R.id.icon);
Picasso
.with(this)
Glide.with(this)
.asBitmap()
.load(app.getIconInfo().getUrl())
.placeholder(R.color.transparent)
.into((ImageView) findViewById(R.id.icon), new Callback() {
.apply(new RequestOptions()
.diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
.placeholder(R.color.transparent))
.transition(new BitmapTransitionOptions().crossFade())
.listener(new RequestListener<Bitmap>() {
@Override
public void onSuccess() {
Bitmap bitmap = ((BitmapDrawable) appIcon.getDrawable()).getBitmap();
if (bitmap != null && COLOR_UI)
getPalette(bitmap);
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Bitmap> target, boolean isFirstResource) {
return false;
}
@Override
public void onError() {
public boolean onResourceReady(Bitmap resource, Object model, Target<Bitmap> target, DataSource dataSource, boolean isFirstResource) {
if (COLOR_UI)
getPalette(resource);
return false;
}
});
})
.into(appIcon);
}
private void getPalette(Bitmap bitmap) {

View File

@@ -29,8 +29,9 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.dragons.aurora.R;
import com.squareup.picasso.Picasso;
import java.util.List;
@@ -57,9 +58,10 @@ public class BigScreenshotsAdapter extends RecyclerView.Adapter<BigScreenshotsAd
public void onBindViewHolder(@NonNull final ViewHolder holder, int position) {
bsholder = this.ssholder.get(position);
String url = bsholder.url.get(position);
Picasso.with(context)
Glide
.with(context)
.load(url)
.placeholder(android.R.color.transparent)
.apply(new RequestOptions().placeholder(android.R.color.transparent))
.into(holder.ss_image);
}

View File

@@ -23,10 +23,9 @@ package com.dragons.aurora.adapters;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.GradientDrawable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.graphics.ColorUtils;
import android.support.v7.graphics.Palette;
import android.support.v7.widget.RecyclerView;
@@ -39,6 +38,14 @@ import android.widget.RatingBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.engine.GlideException;
import com.bumptech.glide.load.resource.bitmap.BitmapTransitionOptions;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.Target;
import com.dragons.aurora.R;
import com.dragons.aurora.activities.AuroraActivity;
import com.dragons.aurora.activities.DetailsActivity;
@@ -46,7 +53,6 @@ import com.dragons.aurora.fragment.details.ButtonDownload;
import com.dragons.aurora.fragment.details.ButtonUninstall;
import com.dragons.aurora.fragment.details.DownloadOptions;
import com.dragons.aurora.model.App;
import com.squareup.picasso.Picasso;
import java.util.List;
@@ -113,47 +119,49 @@ public class FeaturedAppsAdapter extends RecyclerView.Adapter<FeaturedAppsAdapte
}
private void drawBackground(App app, ViewHolder holder) {
Picasso.with(context)
Glide.with(context)
.asBitmap()
.load(app.getPageBackgroundImage().getUrl())
.placeholder(R.color.transparent)
.into(holder.appBackground, new com.squareup.picasso.Callback() {
.apply(new RequestOptions()
.diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
.placeholder(R.color.transparent))
.transition(new BitmapTransitionOptions().crossFade())
.listener(new RequestListener<Bitmap>() {
@Override
public void onSuccess() {
Bitmap bitmap = ((BitmapDrawable) holder.appBackground.getDrawable()).getBitmap();
if (bitmap != null)
getPalette(bitmap, holder);
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Bitmap> target, boolean isFirstResource) {
return false;
}
@Override
public void onError() {
holder.appName.setTextColor(Color.WHITE);
holder.appData.setBackgroundColor(Color.DKGRAY);
public boolean onResourceReady(Bitmap resource, Object model, Target<Bitmap> target, DataSource dataSource, boolean isFirstResource) {
getPalette(resource, holder);
return false;
}
});
})
.into(holder.appBackground);
}
private void drawIcon(App app, ViewHolder holder) {
Picasso.with(context)
Glide.with(context)
.load(app.getIconInfo().getUrl())
.placeholder(R.color.transparent)
.apply(new RequestOptions()
.diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
.placeholder(R.color.transparent))
.into(holder.appIcon);
}
private void getPalette(Bitmap bitmap, ViewHolder holder) {
Palette.from(bitmap)
.generate(palette -> {
Palette.Swatch mySwatch = palette.getDarkVibrantSwatch();
if (mySwatch != null) {
paintEmAll(palette.getDarkVibrantColor(Color.DKGRAY), holder);
}
});
.generate(palette -> paintEmAll(palette, holder));
}
private void paintEmAll(int color, ViewHolder holder) {
GradientDrawable gradientDrawable = new GradientDrawable(GradientDrawable.Orientation.BOTTOM_TOP,
new int[]{ColorUtils.setAlphaComponent(color, 150), 0x05000000});
gradientDrawable.setCornerRadius(0f);
holder.appData.setBackground(gradientDrawable);
private void paintEmAll(Palette palette, ViewHolder holder) {
Palette.Swatch swatch = palette.getDarkVibrantSwatch();
if (swatch != null) {
GradientDrawable gradientDrawable = new GradientDrawable(GradientDrawable.Orientation.BOTTOM_TOP,
new int[]{ColorUtils.setAlphaComponent(swatch.getRgb(), 150), 0x05000000});
holder.appData.setBackground(gradientDrawable);
}
}
protected void setText(TextView textView, String text) {
@@ -181,7 +189,6 @@ public class FeaturedAppsAdapter extends RecyclerView.Adapter<FeaturedAppsAdapte
private ImageView appBackground;
private ImageView appMenu3Dot;
ViewHolder(View view) {
super(view);
this.view = view;

View File

@@ -33,13 +33,14 @@ import android.widget.RatingBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.dragons.aurora.R;
import com.dragons.aurora.Util;
import com.dragons.aurora.activities.AuroraActivity;
import com.dragons.aurora.activities.DetailsActivity;
import com.dragons.aurora.fragment.details.ButtonDownload;
import com.dragons.aurora.model.App;
import com.squareup.picasso.Picasso;
import java.util.List;
@@ -76,10 +77,10 @@ public class RecyclerAppsAdapter extends RecyclerView.Adapter<RecyclerAppsAdapte
final App app = appsToAdd.get(position);
final boolean isInstalled = Util.isAlreadyInstalled(context, app.getPackageName());
Picasso
Glide
.with(context)
.load(app.getIconInfo().getUrl())
.placeholder(R.color.transparent)
.apply(new RequestOptions().placeholder(R.color.transparent))
.into(holder.appIcon);
setText(holder.view, holder.appRating, R.string.details_rating, app.getRating().getAverage());
holder.appName.setText(Util.getSimpleName(app.getDisplayName()));

View File

@@ -25,16 +25,20 @@ import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.bumptech.glide.request.RequestOptions;
import com.dragons.aurora.R;
import com.dragons.aurora.activities.FullscreenImageActivity;
import com.squareup.picasso.Picasso;
import java.util.List;
@@ -60,10 +64,15 @@ public class SmallScreenshotsAdapter extends RecyclerView.Adapter<SmallScreensho
public void onBindViewHolder(@NonNull final ViewHolder holder, int position) {
final SmallScreenshotsAdapter.Holder ssholder = this.ssholder.get(position);
String url = ssholder.url.get(position);
Picasso.with(context)
Glide
.with(context)
.load(url)
.placeholder(ContextCompat.getDrawable(context,R.drawable.screenshot_bg))
.apply(new RequestOptions()
.transforms(new CenterCrop(), new RoundedCorners(25))
.diskCacheStrategy(DiskCacheStrategy.AUTOMATIC))
.transition(new DrawableTransitionOptions().crossFade())
.into(holder.ss_image);
holder.ss_image.setOnClickListener(v -> {
Intent intent = new Intent(context, FullscreenImageActivity.class);
intent.putExtra(FullscreenImageActivity.INTENT_SCREENSHOT_NUMBER, position);

View File

@@ -33,7 +33,9 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.dragons.aurora.CircleTransform;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.RequestOptions;
import com.dragons.aurora.PlayStoreApiAuthenticator;
import com.dragons.aurora.R;
import com.dragons.aurora.Util;
@@ -41,7 +43,6 @@ import com.dragons.aurora.activities.LoginActivity;
import com.dragons.aurora.task.UserProvidedCredentialsTask;
import com.github.florent37.shapeofview.shapes.CircleView;
import com.percolate.caffeine.ViewUtils;
import com.squareup.picasso.Picasso;
import static com.dragons.aurora.Util.hide;
import static com.dragons.aurora.Util.isConnected;
@@ -184,10 +185,13 @@ public class AccountsFragment extends AccountsHelper {
}
private void loadAvatar(String Url) {
Picasso.with(getActivity())
Glide
.with(getContext())
.load(Url)
.placeholder(ContextCompat.getDrawable(getContext(),R.drawable.ic_dummy_avatar))
.transform(new CircleTransform())
.apply(new RequestOptions()
.placeholder(ContextCompat.getDrawable(getContext(), R.drawable.ic_dummy_avatar))
.circleCrop()
.diskCacheStrategy(DiskCacheStrategy.DATA))
.into(((ImageView) v.findViewById(R.id.accounts_AvatarG)));
}

View File

@@ -33,10 +33,10 @@ import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.dragons.aurora.CategoryManager;
import com.dragons.aurora.CircleTransform;
import com.dragons.aurora.R;
import com.dragons.aurora.Util;
import com.dragons.aurora.activities.AccountsActivity;
import com.dragons.aurora.activities.CategoryAppsActivity;
import com.dragons.aurora.playstoreapiv2.GooglePlayAPI;
@@ -45,7 +45,6 @@ import com.dragons.aurora.task.FeaturedTaskHelper;
import com.dragons.aurora.view.AdaptiveToolbar;
import com.dragons.aurora.view.MoreAppsCard;
import com.dragons.custom.TagView;
import com.squareup.picasso.Picasso;
import static com.dragons.aurora.Util.isConnected;
@@ -97,10 +96,12 @@ public class HomeFragment extends AccountsHelper {
protected void setUser() {
if (isGoogle()) {
Picasso.with(getActivity())
Glide
.with(getContext())
.load(PreferenceFragment.getString(getActivity(), "GOOGLE_URL"))
.placeholder(ContextCompat.getDrawable(getContext(), R.drawable.ic_user_placeholder))
.transform(new CircleTransform())
.apply(new RequestOptions()
.placeholder(ContextCompat.getDrawable(getContext(), R.drawable.ic_user_placeholder))
.circleCrop())
.into(adtb.getAvatar_icon());
} else {
(adtb.getAvatar_icon()).setImageDrawable(getResources()
@@ -186,7 +187,8 @@ public class HomeFragment extends AccountsHelper {
case "3":
subcategory = GooglePlayAPI.SUBCATEGORY.MOVERS_SHAKERS;
break;
default:subcategory = GooglePlayAPI.SUBCATEGORY.TOP_GROSSING;
default:
subcategory = GooglePlayAPI.SUBCATEGORY.TOP_GROSSING;
}
return subcategory;
}

View File

@@ -38,6 +38,8 @@ import android.widget.ScrollView;
import android.widget.Spinner;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.dragons.aurora.PlayStoreApiAuthenticator;
import com.dragons.aurora.R;
import com.dragons.aurora.SpoofDeviceManager;
@@ -45,7 +47,6 @@ import com.dragons.aurora.Util;
import com.dragons.aurora.activities.DeviceInfoActivity;
import com.dragons.aurora.activities.LoginActivity;
import com.dragons.aurora.task.SpoofTask;
import com.squareup.picasso.Picasso;
import java.io.IOException;
import java.util.HashMap;
@@ -67,7 +68,6 @@ public class SpoofFragment extends AccountsHelper {
private String deviceName;
private View view;
private List<Address> addresses;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -122,12 +122,7 @@ public class SpoofFragment extends AccountsHelper {
}
public void drawDevice() {
Picasso
.with(getContext())
.load(LineageURl + Build.DEVICE + ".png")
.placeholder(ContextCompat.getDrawable(getContext(), R.drawable.ic_device))
.into((ImageView) view.findViewById(R.id.device_avatar));
getDeviceImg(LineageURl + Build.DEVICE + ".png");
setText(R.id.device_model, R.string.device_model, Build.MODEL, Build.DEVICE);
setText(R.id.device_manufacturer, Build.MANUFACTURER);
setText(R.id.device_architect, Build.BOARD);
@@ -136,13 +131,7 @@ public class SpoofFragment extends AccountsHelper {
public void drawSpoofedDevice() {
Properties properties = new SpoofDeviceManager(this.getActivity()).getProperties(deviceName);
String Model = properties.getProperty("UserReadableName");
Picasso
.with(getContext())
.load(LineageURl + properties.getProperty("Build.DEVICE") + ".png")
.placeholder(ContextCompat.getDrawable(getContext(), R.drawable.ic_device))
.into((ImageView) view.findViewById(R.id.device_avatar));
getDeviceImg(LineageURl + properties.getProperty("Build.DEVICE") + ".png");
setText(R.id.device_model, R.string.device_model, Model.substring(0, Model.indexOf('(')), properties.getProperty("Build.DEVICE"));
setText(R.id.device_manufacturer, properties.getProperty("Build.MANUFACTURER"));
setText(R.id.device_architect, properties.getProperty("Build.HARDWARE"));
@@ -255,6 +244,15 @@ public class SpoofFragment extends AccountsHelper {
});
}
protected void getDeviceImg(String url) {
Glide
.with(getContext())
.load(url)
.apply(new RequestOptions().placeholder(ContextCompat.getDrawable(getContext(), R.drawable.ic_device)))
.into((ImageView) view.findViewById(R.id.device_avatar));
}
protected void setText(int viewId, String text) {
TextView textView = (TextView) view.findViewById(viewId);
if (null != textView)

View File

@@ -25,7 +25,7 @@ import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v7.graphics.Palette;
import android.support.v7.widget.CardView;
@@ -37,9 +37,18 @@ import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.PopupMenu;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.engine.GlideException;
import com.bumptech.glide.load.resource.bitmap.BitmapTransitionOptions;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.Target;
import com.dragons.aurora.CategoryManager;
import com.dragons.aurora.R;
import com.dragons.aurora.Util;
@@ -47,8 +56,6 @@ import com.dragons.aurora.activities.AuroraActivity;
import com.dragons.aurora.fragment.DetailsFragment;
import com.dragons.aurora.model.App;
import com.dragons.aurora.model.ImageSource;
import com.squareup.picasso.Callback;
import com.squareup.picasso.Picasso;
import java.util.ArrayList;
import java.util.Collections;
@@ -75,7 +82,6 @@ public class GeneralDetails extends AbstractHelper {
if (view != null) {
ImageView appIcon = view.findViewById(R.id.icon);
ImageView app_menu3dot = view.findViewById(R.id.app_menu3dot);
RelativeLayout relativeLayout = view.findViewById(R.id.details_header);
ImageSource imageSource = app.getIconInfo();
if (null != imageSource.getApplicationInfo()) {
appIcon.setImageDrawable(context.getPackageManager().getApplicationIcon(imageSource.getApplicationInfo()));
@@ -84,26 +90,28 @@ public class GeneralDetails extends AbstractHelper {
getPalette(bitmap);
}
} else {
Picasso
.with(context)
Glide.with(context)
.asBitmap()
.load(imageSource.getUrl())
.placeholder(R.color.transparent)
.into(appIcon, new Callback() {
.apply(new RequestOptions()
.diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
.placeholder(R.color.transparent)
.priority(Priority.HIGH))
.transition(new BitmapTransitionOptions().crossFade())
.listener(new RequestListener<Bitmap>() {
@Override
public void onSuccess() {
Bitmap bitmap = ((BitmapDrawable) appIcon.getDrawable()).getBitmap();
if (bitmap != null && COLOR_UI)
getPalette(bitmap);
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Bitmap> target, boolean isFirstResource) {
return false;
}
@Override
public void onError() {
if (Util.isDark(fragment.getContext()))
relativeLayout.setBackgroundColor(Color.LTGRAY);
else
relativeLayout.setBackgroundColor(Color.DKGRAY);
public boolean onResourceReady(Bitmap resource, Object model, Target<Bitmap> target, DataSource dataSource, boolean isFirstResource) {
if (COLOR_UI)
getPalette(resource);
return false;
}
});
})
.into(appIcon);
}
setText(view, R.id.displayName, app.getDisplayName());
@@ -133,10 +141,12 @@ public class GeneralDetails extends AbstractHelper {
private void drawBackground(ImageView appBackground) {
if (null != app.getPageBackgroundImage().getUrl())
Picasso
Glide
.with(context)
.load(app.getPageBackgroundImage().getUrl())
.placeholder(R.color.transparent)
.apply(new RequestOptions()
.placeholder(R.color.transparent)
.priority(Priority.HIGH))
.into(appBackground);
else
appBackground.setVisibility(View.GONE);
@@ -194,15 +204,18 @@ public class GeneralDetails extends AbstractHelper {
ImageView categoryImg = view.findViewById(R.id.categoryImage);
ImageView ratingImg = view.findViewById(R.id.rating_img);
Picasso
.with(context)
Glide.with(context)
.load(app.getCategoryIconUrl())
.placeholder(ContextCompat.getDrawable(context, R.drawable.ic_categories))
.apply(new RequestOptions()
.placeholder(ContextCompat.getDrawable(context, R.drawable.ic_categories))
.diskCacheStrategy(DiskCacheStrategy.AUTOMATIC))
.into(categoryImg);
Picasso
.with(context)
Glide.with(context)
.load(app.getRatingURL())
.placeholder(ContextCompat.getDrawable(context, R.drawable.ic_audience))
.apply(new RequestOptions()
.placeholder(ContextCompat.getDrawable(context,R.drawable.ic_audience))
.diskCacheStrategy(DiskCacheStrategy.AUTOMATIC))
.into(ratingImg);
drawOfferDetails(app);

View File

@@ -29,6 +29,9 @@ import android.widget.LinearLayout;
import android.widget.RatingBar;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.bumptech.glide.request.RequestOptions;
import com.dragons.aurora.R;
import com.dragons.aurora.ReviewStorageIterator;
import com.dragons.aurora.builders.UserReviewDialogBuilder;
@@ -36,7 +39,6 @@ import com.dragons.aurora.fragment.DetailsFragment;
import com.dragons.aurora.model.App;
import com.dragons.aurora.task.playstore.ReviewDeleteTask;
import com.dragons.aurora.task.playstore.ReviewLoadTask;
import com.squareup.picasso.Picasso;
import java.util.List;
@@ -152,10 +154,13 @@ public class Review extends AbstractHelper {
review.getTitle()
));
((TextView) reviewLayout.findViewById(R.id.comment)).setText(review.getComment());
Picasso
.with(fragment.getActivity())
Glide
.with(context)
.load(review.getUserPhotoUrl())
.placeholder(R.color.transparent)
.apply(new RequestOptions()
.placeholder(R.color.transparent)
.circleCrop())
.transition(new DrawableTransitionOptions().crossFade())
.into((ImageView) reviewLayout.findViewById(R.id.avatar));
parent.addView(reviewLayout);
}

View File

@@ -29,10 +29,12 @@ import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.bumptech.glide.request.RequestOptions;
import com.dragons.aurora.R;
import com.dragons.aurora.fragment.DetailsFragment;
import com.dragons.aurora.model.App;
import com.squareup.picasso.Picasso;
public class Video extends AbstractHelper {
@@ -61,11 +63,11 @@ public class Video extends AbstractHelper {
ImageView imageView = view.findViewById(R.id.thumbnail);
Picasso.with(context)
Glide
.with(context)
.load(URL)
.fit()
.placeholder(android.R.color.transparent)
.centerCrop()
.apply(new RequestOptions().centerCrop().placeholder(android.R.color.transparent))
.transition(new DrawableTransitionOptions().crossFade())
.into(imageView);
view.findViewById(R.id.app_video).setVisibility(View.VISIBLE);

View File

@@ -28,12 +28,15 @@ import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.bumptech.glide.request.RequestOptions;
import com.dragons.aurora.NetworkState;
import com.dragons.aurora.R;
import com.dragons.aurora.fragment.PreferenceFragment;
import com.dragons.aurora.model.App;
import com.dragons.aurora.model.ImageSource;
import com.squareup.picasso.Picasso;
import java.util.ArrayList;
import java.util.List;
@@ -74,10 +77,13 @@ public abstract class AppBadge extends ListItem {
if (null != imageSource.getApplicationInfo() && !noImages()) {
imageView.setImageDrawable(imageView.getContext().getPackageManager().getApplicationIcon(imageSource.getApplicationInfo()));
} else if (!noImages()) {
Picasso
Glide
.with(view.getContext())
.load(imageSource.getUrl())
.placeholder(ContextCompat.getDrawable(view.getContext(),R.drawable.ic_placeholder))
.apply(RequestOptions
.placeholderOf(ContextCompat.getDrawable(view.getContext(), R.drawable.ic_placeholder))
.diskCacheStrategy(DiskCacheStrategy.ALL))
.transition(new DrawableTransitionOptions().crossFade())
.into(imageView);
}
}

View File

@@ -43,7 +43,7 @@ public class InstalledAppBadge extends AppBadge {
if (manager.contains(app.getPackageName())) {
line3.add(c.getString(manager.isBlack() ? R.string.list_app_blacklisted : R.string.list_app_whitelisted));
}
drawIcon((ImageView) view.findViewById(R.id.icon));
drawIcon(view.findViewById(R.id.icon));
super.draw();
}
}

View File

@@ -117,7 +117,6 @@
android:layout_width="28dp"
android:layout_height="28dp"
android:alpha="0.7"
android:src="@drawable/ic_categories"
android:tint="?android:attr/colorForeground" />
<TextView

View File

@@ -93,8 +93,7 @@
android:id="@+id/rating_img"
android:layout_width="18dp"
android:layout_height="18dp"
android:alpha="0.7"
android:src="@drawable/ic_audience" />
android:alpha="0.7" />
<TextView
android:id="@+id/rating_lable"

View File

@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Aurora Store
~ Copyright (C) 2018 Rahul Kumar Patel <whyorean@gmail.com>
~
@@ -20,21 +19,12 @@
~ along with Aurora Store. If not, see <http://www.gnu.org/licenses/>.
-->
<com.github.florent37.shapeofview.shapes.RoundRectView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrn_itm_s"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="2dp"
app:shape_roundRect_bottomLeftRadius="8dp"
app:shape_roundRect_bottomRightRadius="8dp"
app:shape_roundRect_topLeftRadius="8dp"
app:shape_roundRect_topRightRadius="8dp">
<ImageView
android:id="@+id/scrn_itm_s"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:scaleType="centerCrop" />
</com.github.florent37.shapeofview.shapes.RoundRectView>
android:layout_margin="4dp"
android:clickable="true"
android:focusable="true"
android:scaleType="centerCrop" />

View File

@@ -113,7 +113,7 @@
<string-array name="opensource">
<item>JavaXDelta</item>
<item>Chainfire SuperSU</item>
<item>SquareUp Picasso</item>
<item>Bumptech Glide</item>
<item>SquareUp OKHTTP</item>
<item>Play Store API</item>
<item>AOSP CardView</item>