Added letter icon in avatar if user has no avatar

This commit is contained in:
ChronosX88 2019-05-23 17:05:05 +04:00
parent 6f844cb924
commit 8a062745d9
3 changed files with 10 additions and 2 deletions

View File

@ -65,6 +65,7 @@ dependencies {
implementation 'net.sourceforge.streamsupport:streamsupport:1.7.0'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'net.sourceforge.streamsupport:android-retrofuture:1.7.0'
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
}
repositories {
mavenCentral()

View File

@ -23,6 +23,8 @@ import android.graphics.BitmapFactory;
import androidx.appcompat.app.AlertDialog;
import com.amulyakhare.textdrawable.TextDrawable;
import com.amulyakhare.textdrawable.util.ColorGenerator;
import com.stfalcon.chatkit.dialogs.DialogsListAdapter;
import org.greenrobot.eventbus.EventBus;
@ -52,7 +54,12 @@ public class DialogListPresenter implements CoreContracts.IDialogListPresenterCo
private CoreContracts.IChatListViewContract view;
private CoreContracts.IDialogListLogicContract logic;
private DialogsListAdapter<GenericDialog> dialogListAdapter = new DialogsListAdapter<>((imageView, url, payload) -> {
imageView.setImageResource(R.mipmap.ic_launcher);
imageView.setImageDrawable(TextDrawable.builder()
.beginConfig()
.width(32)
.height(32)
.endConfig()
.buildRound(Character.toString(url.charAt(0)), ColorGenerator.MATERIAL.getColor(Character.toString(url.charAt(0)))));
CompletableFuture.supplyAsync(() -> {
while (AppHelper.getXmppConnection() == null);
while (AppHelper.getXmppConnection().isConnectionAlive() != true);

View File

@ -6,7 +6,7 @@ buildscript {
google()
jcenter()
maven {
url "http://tomp2p.net/dev/mvn/"
url 'http://dl.bintray.com/amulyakhare/maven'
}
}
dependencies {