mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2023-12-13 20:50:18 +01:00
Fix crash if wiki page has no title
This commit is contained in:
parent
8c1b07c2c8
commit
c80982ad07
|
@ -220,10 +220,14 @@ public class WikiListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
|||
|
||||
ColorGenerator generator = ColorGenerator.Companion.getMATERIAL();
|
||||
int color = generator.getColor(wikiPageMetaData.getTitle());
|
||||
String firstCharacter = String.valueOf(wikiPageMetaData.getTitle().charAt(0));
|
||||
if (wikiPageMetaData.getTitle() != null && wikiPageMetaData.getTitle().length() > 0) {
|
||||
String firstCharacter = String.valueOf(wikiPageMetaData.getTitle().charAt(0));
|
||||
|
||||
TextDrawable drawable = TextDrawable.builder().beginConfig().useFont(Typeface.DEFAULT).fontSize(18).toUpperCase().width(28).height(28).endConfig().buildRoundRect(firstCharacter, color, 14);
|
||||
avatar.setImageDrawable(drawable);
|
||||
TextDrawable drawable = TextDrawable.builder().beginConfig().useFont(Typeface.DEFAULT).fontSize(18).toUpperCase().width(28).height(28).endConfig().buildRoundRect(firstCharacter, color, 14);
|
||||
avatar.setImageDrawable(drawable);
|
||||
} else {
|
||||
avatar.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if(!((RepoDetailActivity) ctx).repository.getPermissions().isPush()) {
|
||||
wikiMenu.setVisibility(View.GONE);
|
||||
|
|
Loading…
Reference in a new issue