Hello! 👋
Congratulations on making it to the second round!
The take home assignment is to build an app that allows users to browse the trending gifs using Giphy API, searching gifs, and saving those they like. Your job is to finish the app by implementing some of the key features listed below.
- Finish the
LoginActivityto persist the login state between app launches such that next time the user will skip the activity if it's already logged in. - Add pagination support in
TrendingFragmentto make it loads the next page of gifs once the recycler view scrolls to the bottom. - Complete the searching functionality in
MainActivityandTrendingFragmentsuch that the search results will be displayed instead of the trending data when the query text is not empty. When query text is deleted, restore the previous trending data. - Complete the
GifPreviewActivityby passing the selected gif from previous activity and display the original image in the image view. Prompt user to share the gif to other apps when the share button is tapped. - Introduce a persistent layer that saves Gif object marked as favorite. The favorite button in
GifPreviewActivitywill toggle the favorite state of the gif. - Show all favorite gifs in the Favorite tab in
FavoriteFragmentby usingRecyclerView.
- No limitation on other libraries
The SDK is integrated within the project. There are some basic usage required for the assignment:
GPHApi client = new GPHApiClient("YOUR_API_KEY");Search all Giphy GIFs for a word or phrase. Punctuation will be stripped and ignored.
/// Gif Search
client.search("cats", MediaType.gif, null, null, null, null, new CompletionHandler<ListMediaResponse>() {
@Override
public void onComplete(ListMediaResponse result, Throwable e) {
if (result == null) {
// Do what you want to do with the error
} else {
if (result.getData() != null) {
for (Media gif : result.getData()) {
Log.v("giphy", gif.getId());
}
} else {
Log.e("giphy error", "No results found");
}
}
}
});Fetch GIFs currently trending online. Hand curated by the Giphy editorial team. The data returned mirrors the GIFs showcased on the Giphy homepage.
/// Trending Gifs
client.trending(MediaType.gif, null, null, null, new CompletionHandler<ListMediaResponse>() {
@Override
public void onComplete(ListMediaResponse result, Throwable e) {
if (result == null) {
// Do what you want to do with the error
} else {
if (result.getData() != null) {
for (Media gif : result.getData()) {
Log.v("giphy", gif.getId());
}
} else {
Log.e("giphy error", "No results found");
}
}
}
});
/// Trending Stickers
client.trending(MediaType.sticker, null, null, null, new CompletionHandler<ListMediaResponse>() {
@Override
public void onComplete(ListMediaResponse result, Throwable e) {
if (result == null) {
// Do what you want to do with the error
} else {
if (result.getData() != null) {
for (Media gif : result.getData()) {
Log.v("giphy", gif.getId());
}
} else {
Log.e("giphy error", "No results found");
}
}
}
});