This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@GET("api/me/") | |
Observable<User> getLoggedUserProfile(@Header("token") String token); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Observable<User> getLoggedUserProfile() { | |
return callWithToken(resolvedToken -> api.getLoggedUserProfile(resolvedToken)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tokenResolver.token().flatMap(token -> retrofit.getLoggedUserProfile(token) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
firebaseTokenObservable.flatMap(token -> retrofit.getLoggedUserProfile(token) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private <T>Observable<T> callWithToken(Func1<String, Observable<T>> apiCall) { | |
return tokenResolver | |
.token() | |
.flatMap(apiCall); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
compile 'agency.tango.android:avatar-view:{latest_release}' | |
//if you want to use Picasso for loading images | |
compile 'agency.tango.android:avatar-view-picasso:{latest_release}' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<agency.tango.android.avatarview.views.AvatarView | |
android:layout_width="100dp" | |
android:layout_height="100dp" | |
app:av_border_color="@android:color/white" | |
app:av_border_width="4dp" | |
app:av_text_size_percentage="35" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AvatarView avatarView; | |
IImageLoader imageLoader; | |
@Override | |
protected void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
avatarView = (AvatarView) findViewById(R.id.avatar_view_example); | |
imageLoader = new PicassoLoader(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
compile 'agency.tango.android:avatar-view:{latest_release}' | |
compile 'agency.tango.android:avatar-view-bindings:{latest_release}' | |
//if you want to use Picasso for loading images | |
compile 'agency.tango.android:avatar-view-picasso:{latest_release}' | |
} |
OlderNewer