Add number category to the info screen

This commit is contained in:
xynngh 2020-05-10 23:59:54 +04:00
parent b628fc6dd1
commit fc3986e057
1 changed files with 10 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;
import dummydomain.yetanothercallblocker.data.NumberInfo;
import dummydomain.yetanothercallblocker.sia.model.NumberCategory;
public class InfoDialogHelper {
@ -24,10 +25,19 @@ public class InfoDialogHelper {
String name = "";
NumberCategory category = numberInfo.communityDatabaseItem != null
? NumberCategory.getById(numberInfo.communityDatabaseItem.getCategory())
: null;
if (category != null && category != NumberCategory.NONE) {
name += NumberCategory.getString(context, category);
}
String contactName = numberInfo.contactItem != null
? numberInfo.contactItem.displayName : null;
if (!TextUtils.isEmpty(contactName)) {
if (!TextUtils.isEmpty(name)) name += "\n";
name += contactName;
}