remove context
This commit is contained in:
parent
945aa51c02
commit
0424d675c4
|
@ -333,19 +333,19 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
||||||
if (urlHeader != null && !urlHeader.contains("missing.png")) {
|
if (urlHeader != null && !urlHeader.contains("missing.png")) {
|
||||||
|
|
||||||
boolean disableGif = sharedpreferences.getBoolean(Helper.SET_DISABLE_GIF, false);
|
boolean disableGif = sharedpreferences.getBoolean(Helper.SET_DISABLE_GIF, false);
|
||||||
|
ImageView banner_pp = findViewById(R.id.banner_pp);
|
||||||
if( !disableGif){
|
if( !disableGif){
|
||||||
ImageView banner_pp = findViewById(R.id.banner_pp);
|
Glide.with(banner_pp.getContext())
|
||||||
Glide.with(getApplicationContext())
|
|
||||||
.load(urlHeader)
|
.load(urlHeader)
|
||||||
.into(banner_pp);
|
.into(banner_pp);
|
||||||
}else{
|
}else{
|
||||||
Glide.with(getApplicationContext())
|
Glide.with(banner_pp.getContext())
|
||||||
.asBitmap()
|
.asBitmap()
|
||||||
.load(urlHeader)
|
.load(urlHeader)
|
||||||
.into(new SimpleTarget<Bitmap>() {
|
.into(new SimpleTarget<Bitmap>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResourceReady(@NonNull Bitmap resource, Transition<? super Bitmap> transition) {
|
public void onResourceReady(@NonNull Bitmap resource, Transition<? super Bitmap> transition) {
|
||||||
ImageView banner_pp = findViewById(R.id.banner_pp);
|
|
||||||
banner_pp.setImageBitmap(resource);
|
banner_pp.setImageBitmap(resource);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1394,7 +1394,7 @@ public class Helper {
|
||||||
url = "https://" + account.getInstance() + account.getAvatar();
|
url = "https://" + account.getInstance() + account.getAvatar();
|
||||||
}
|
}
|
||||||
if(!url.equals("null"))
|
if(!url.equals("null"))
|
||||||
Glide.with(activity.getApplicationContext())
|
Glide.with(navigationView.getContext())
|
||||||
.asBitmap()
|
.asBitmap()
|
||||||
.load(url)
|
.load(url)
|
||||||
.into(new SimpleTarget<Bitmap>() {
|
.into(new SimpleTarget<Bitmap>() {
|
||||||
|
@ -1405,7 +1405,7 @@ public class Helper {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
else
|
else
|
||||||
Glide.with(activity.getApplicationContext())
|
Glide.with(navigationView.getContext())
|
||||||
.asBitmap()
|
.asBitmap()
|
||||||
.load(R.drawable.missing_peertube)
|
.load(R.drawable.missing_peertube)
|
||||||
.into(new SimpleTarget<Bitmap>() {
|
.into(new SimpleTarget<Bitmap>() {
|
||||||
|
@ -1852,7 +1852,7 @@ public class Helper {
|
||||||
if (currrentUserId != null && (!currrentUserId.equals(accountChoice.getId()) || !getLiveInstance(activity).equals(accountChoice.getInstance()))) {
|
if (currrentUserId != null && (!currrentUserId.equals(accountChoice.getId()) || !getLiveInstance(activity).equals(accountChoice.getInstance()))) {
|
||||||
icon = new ImageView(activity);
|
icon = new ImageView(activity);
|
||||||
ImageView finalIcon = icon;
|
ImageView finalIcon = icon;
|
||||||
Glide.with(activity.getApplicationContext())
|
Glide.with(finalIcon.getContext())
|
||||||
.asBitmap()
|
.asBitmap()
|
||||||
.apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(270)))
|
.apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(270)))
|
||||||
.listener(new RequestListener<Bitmap>(){
|
.listener(new RequestListener<Bitmap>(){
|
||||||
|
@ -1905,7 +1905,7 @@ public class Helper {
|
||||||
if( !accountChoice.getAvatar().startsWith("http"))
|
if( !accountChoice.getAvatar().startsWith("http"))
|
||||||
accountChoice.setAvatar("https://" + accountChoice.getInstance() + accountChoice.getAvatar());
|
accountChoice.setAvatar("https://" + accountChoice.getInstance() + accountChoice.getAvatar());
|
||||||
ImageView itemIconAcc = new ImageView(activity);
|
ImageView itemIconAcc = new ImageView(activity);
|
||||||
Glide.with(activity.getApplicationContext())
|
Glide.with(itemIconAcc.getContext())
|
||||||
.asBitmap()
|
.asBitmap()
|
||||||
.apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(270)))
|
.apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(270)))
|
||||||
.load(accountChoice.getAvatar())
|
.load(accountChoice.getAvatar())
|
||||||
|
@ -2060,13 +2060,14 @@ public class Helper {
|
||||||
changeDrawableColor(activity, header_option_menu,R.color.light_black);
|
changeDrawableColor(activity, header_option_menu,R.color.light_black);
|
||||||
}
|
}
|
||||||
if (!urlHeader.contains("missing.png")) {
|
if (!urlHeader.contains("missing.png")) {
|
||||||
Glide.with(activity.getApplicationContext())
|
ImageView backgroundImage = headerLayout.findViewById(R.id.back_ground_image);
|
||||||
|
Glide.with(backgroundImage.getContext())
|
||||||
.asBitmap()
|
.asBitmap()
|
||||||
.load(urlHeader)
|
.load(urlHeader)
|
||||||
.into(new SimpleTarget<Bitmap>() {
|
.into(new SimpleTarget<Bitmap>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResourceReady(@NonNull Bitmap resource, Transition<? super Bitmap> transition) {
|
public void onResourceReady(@NonNull Bitmap resource, Transition<? super Bitmap> transition) {
|
||||||
ImageView backgroundImage = headerLayout.findViewById(R.id.back_ground_image);
|
|
||||||
backgroundImage.setImageBitmap(resource);
|
backgroundImage.setImageBitmap(resource);
|
||||||
if( theme == THEME_LIGHT){
|
if( theme == THEME_LIGHT){
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
||||||
|
|
Loading…
Reference in New Issue