Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for IconCompat#toIcon #64

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/src/main/java/androidx/core/app/Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import androidx.annotation.RestrictTo;
import androidx.core.graphics.drawable.IconCompat;

import com.google.android.samples.socialite.SocialApp;

import java.util.Objects;

/**
Expand Down Expand Up @@ -424,7 +426,7 @@ static Person fromAndroidPerson(android.app.Person person) {
static android.app.Person toAndroidPerson(Person person) {
return new android.app.Person.Builder()
.setName(person.getName())
.setIcon((person.getIcon() != null) ? person.getIcon().toIcon() : null)
.setIcon((person.getIcon() != null) ? person.getIcon().toIcon(SocialApp.app) : null)
Goooler marked this conversation as resolved.
Show resolved Hide resolved
.setUri(person.getUri())
.setKey(person.getKey())
.setBot(person.isBot())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,13 @@ import android.app.Application
import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp
class SocialApp : Application()
class SocialApp : Application() {
override fun onCreate() {
super.onCreate()
app = this
}

companion object {
lateinit var app: SocialApp
}
}
Loading