|
@@ -1046,13 +1046,13 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
|
|
|
|
|
|
if (navigationHeader != null) {
|
|
|
String background = getStorageManager().getCapability(getAccount().name).getServerBackground();
|
|
|
+ int primaryColor = ThemeUtils.primaryColor(getAccount());
|
|
|
|
|
|
if (URLUtil.isValidUrl(background) || background.isEmpty()) {
|
|
|
// background image
|
|
|
SimpleTarget target = new SimpleTarget<Drawable>() {
|
|
|
@Override
|
|
|
public void onResourceReady(Drawable resource, GlideAnimation glideAnimation) {
|
|
|
- int primaryColor = ThemeUtils.primaryColor(getAccount());
|
|
|
Drawable[] drawables = {new ColorDrawable(primaryColor), resource};
|
|
|
LayerDrawable layerDrawable = new LayerDrawable(drawables);
|
|
|
|
|
@@ -1062,6 +1062,19 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
|
|
|
navigationHeader.setBackground(layerDrawable);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onLoadFailed(Exception e, Drawable errorDrawable) {
|
|
|
+ Drawable[] drawables = {new ColorDrawable(primaryColor),
|
|
|
+ getResources().getDrawable(R.drawable.background)};
|
|
|
+ LayerDrawable layerDrawable = new LayerDrawable(drawables);
|
|
|
+
|
|
|
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
|
|
|
+ navigationHeader.setBackgroundDrawable(layerDrawable);
|
|
|
+ } else {
|
|
|
+ navigationHeader.setBackground(layerDrawable);
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
Glide.with(this)
|