remove default values from setupPhoto

This commit is contained in:
Chumva 2018-07-13 18:56:26 +03:00
parent 85a01ba2c7
commit baa952fde3
3 changed files with 5 additions and 5 deletions

View file

@ -15,8 +15,8 @@ object TelegramUiHelper {
app: TelegramApplication, app: TelegramApplication,
iv: ImageView?, iv: ImageView?,
photoPath: String?, photoPath: String?,
placeholderId: Int = R.drawable.img_user_picture, placeholderId: Int,
useThemedIcon: Boolean = true useThemedIcon: Boolean
) { ) {
if (iv == null) { if (iv == null) {
return return
@ -49,6 +49,7 @@ object TelegramUiHelper {
chatId = chat.id chatId = chat.id
chatTitle = chat.title chatTitle = chat.title
photoPath = chat.photo?.small?.local?.path photoPath = chat.photo?.small?.local?.path
placeholderId = R.drawable.img_user_picture
} }
val type = chat.type val type = chat.type
if (type is TdApi.ChatTypePrivate || type is TdApi.ChatTypeSecret) { if (type is TdApi.ChatTypePrivate || type is TdApi.ChatTypeSecret) {
@ -63,7 +64,6 @@ object TelegramUiHelper {
res.latLon = LatLon(content.location.latitude, content.location.longitude) res.latLon = LatLon(content.location.latitude, content.location.longitude)
} }
} }
res.placeholderId = R.drawable.img_user_picture
} else if (type is TdApi.ChatTypeBasicGroup) { } else if (type is TdApi.ChatTypeBasicGroup) {
res.placeholderId = R.drawable.img_group_picture res.placeholderId = R.drawable.img_group_picture
res.membersCount = helper.getBasicGroupFullInfo(type.basicGroupId)?.members?.size ?: 0 res.membersCount = helper.getBasicGroupFullInfo(type.basicGroupId)?.members?.size ?: 0

View file

@ -355,7 +355,7 @@ class MyLocationTabFragment : Fragment(), TelegramListener {
override fun onBindViewHolder(holder: ChatViewHolder, position: Int) { override fun onBindViewHolder(holder: ChatViewHolder, position: Int) {
val chat = chats[position] val chat = chats[position]
val lastItem = position == itemCount - 1 val lastItem = position == itemCount - 1
val placeholderId: Int = if (telegramHelper.isGroup(chat)) R.drawable.img_group_picture else R.drawable.img_user_picture val placeholderId = if (telegramHelper.isGroup(chat)) R.drawable.img_group_picture else R.drawable.img_user_picture
val live = app.settings.isSharingLocationToChat(chat.id) val live = app.settings.isSharingLocationToChat(chat.id)
TelegramUiHelper.setupPhoto(app, holder.icon, chat.photo?.small?.local?.path, placeholderId, false) TelegramUiHelper.setupPhoto(app, holder.icon, chat.photo?.small?.local?.path, placeholderId, false)

View file

@ -212,7 +212,7 @@ class SetTimeDialogFragment : DialogFragment() {
override fun onBindViewHolder(holder: ChatViewHolder, position: Int) { override fun onBindViewHolder(holder: ChatViewHolder, position: Int) {
val chat = chats[position] val chat = chats[position]
val placeholderId: Int = if (telegramHelper.isGroup(chat)) R.drawable.img_group_picture else R.drawable.img_user_picture val placeholderId = if (telegramHelper.isGroup(chat)) R.drawable.img_group_picture else R.drawable.img_user_picture
TelegramUiHelper.setupPhoto(app, holder.icon, chat.photo?.small?.local?.path, placeholderId, false) TelegramUiHelper.setupPhoto(app, holder.icon, chat.photo?.small?.local?.path, placeholderId, false)
holder.title?.text = chat.title holder.title?.text = chat.title