mirror of
https://github.com/gsantner/dandelion
synced 2024-11-22 04:12:08 +01:00
Display app launcher icon instead of nothing when no avatar image set. Fix #55
This commit is contained in:
parent
024bba8260
commit
5bcc99dfba
1 changed files with 12 additions and 4 deletions
|
@ -53,6 +53,7 @@ import android.text.Html;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
import android.text.method.LinkMovementMethod;
|
import android.text.method.LinkMovementMethod;
|
||||||
import android.text.util.Linkify;
|
import android.text.util.Linkify;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
|
@ -400,10 +401,17 @@ public class MainActivity extends AppCompatActivity
|
||||||
navheaderDescription.setText(appSettings.getPodDomain());
|
navheaderDescription.setText(appSettings.getPodDomain());
|
||||||
}
|
}
|
||||||
if (!appSettings.getAvatarUrl().equals("")) {
|
if (!appSettings.getAvatarUrl().equals("")) {
|
||||||
// Try to load image
|
Log.d(App.TAG, "AVATAR URL != \"\": "+appSettings.getAvatarUrl());
|
||||||
if (!app.getAvatarImageLoader().loadToImageView(navheaderImage)) {
|
//Display app launcher icon instead of default avatar asset
|
||||||
// If not yet loaded, start download
|
//(Which would by the way not load because of missing pod domain prefix in the url)
|
||||||
app.getAvatarImageLoader().startImageDownload(navheaderImage, appSettings.getAvatarUrl());
|
if(appSettings.getAvatarUrl().startsWith("/assets/user/default")) {
|
||||||
|
navheaderImage.setImageResource(R.drawable.ic_launcher);
|
||||||
|
} else {
|
||||||
|
// Try to load image
|
||||||
|
if (!app.getAvatarImageLoader().loadToImageView(navheaderImage)) {
|
||||||
|
// If not yet loaded, start download
|
||||||
|
app.getAvatarImageLoader().startImageDownload(navheaderImage, appSettings.getAvatarUrl());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue