Skip to content

Commit

Permalink
Use tel: schema for glide handler
Browse files Browse the repository at this point in the history
  • Loading branch information
moezbhatti committed Oct 28, 2019
1 parent 18d8f24 commit ae2d482
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ContactImageLoader(
) : ModelLoader<String, InputStream> {

override fun handles(model: String): Boolean {
return phoneNumberUtils.isPossibleNumber(model)
return model.startsWith("tel:")
}

override fun buildLoadData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class NotificationManagerImpl @Inject constructor(
person.setIcon(GlideApp.with(context)
.asBitmap()
.circleCrop()
.load(message.address)
.load("tel:${message.address}")
.submit(64.dpToPx(context), 64.dpToPx(context))
.let { futureGet -> tryOrNull(false) { futureGet.get() } }
?.let(IconCompat::createWithBitmap))
Expand All @@ -182,7 +182,7 @@ class NotificationManagerImpl @Inject constructor(
GlideApp.with(context)
.asBitmap()
.circleCrop()
.load(address)
.load("tel:$address")
.submit(64.dpToPx(context), 64.dpToPx(context))
}
?.let { futureGet -> tryOrNull(false) { futureGet.get() } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class QkChooserTargetService : ChooserTargetService() {
val request = GlideApp.with(this)
.asBitmap()
.circleCrop()
.load(address)
.load("tel:$address")
.submit()
val bitmap = tryOrNull(false) { request.get() }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ShortcutManagerImpl @Inject constructor(
val request = GlideApp.with(context)
.asBitmap()
.circleCrop()
.load(address)
.load("tel:$address")
.submit(shortcutManager.iconMaxWidth, shortcutManager.iconMaxHeight)
val bitmap = tryOrNull(false) { request.get() }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class AvatarView @JvmOverloads constructor(context: Context, attrs: AttributeSet
photo.setImageDrawable(null)
address?.let { address ->
GlideApp.with(photo)
.load(address)
.load("tel:$address")
.signature(ObjectKey(lastUpdated ?: 0L))
.into(photo)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class WidgetAdapter(intent: Intent) : RemoteViewsService.RemoteViewsFactory {
contact?.numbers?.firstOrNull()?.address?.let { address ->
val futureGet = GlideApp.with(context)
.asBitmap()
.load(address)
.load("tel:$address")
.submit(48.dpToPx(context), 48.dpToPx(context))

try {
Expand Down

0 comments on commit ae2d482

Please sign in to comment.