How about a DP?
This is an update story for the App’s Mastermind, the 2nd Screen
Lets track some past with the prequel designer stories.
This update has got nothing to do with making Auth Calls. So lets leave it at that.
A Pre-Note:
From an earlier update story on the UI, readers could’ve caught a faint suspicion on what’s coming with inserting a song or setting a DP. To be more abstract, what is gonna be the plan for a filestore multimedia DB, with now that I can’t tunnel my local endpoint to a public domain 24/7.
Remind you, with mobile apps, its all about responsiveness and impulse. And my definition for the scope of interactivity and dynamism is a class apart. That leaves me with….. Read the blog on 3rd screen, the Song Page for that :)
Reader Note: From the previous post, it should’ve been crystal clear for the reasons to chose to make a plot out of updates :)
What update?
This one is around a feature that’s gripping the selfie world. A DP is almost natural rather phenomenal for most of us today. I wouldn’t deny a requisite factor in my app either.
Those blue circles you’ve been seeing so far are artistic impressions of a profile pic. If you are one of the kind who fronts a formidable personal image over your interests, you are in a must-read story.
How to set a DP?
You can add a profile pic to my filestore DB and click open your friends’ anytime. Just tap on their circular minuscules and you zoom into their larger pics on a dusted out ‘Board of New People’, with high resolution.
Note: I don’t wanna get into the filestore details just yet. Look for my 3rd screen.
With the Data models
I’ve got myself a table with just 2 fields, the user_id and a profile image link. And, the your_friends view is now bedecked with a link pointing to an image, so that I get friend_info in one shot.
I still don’t make any statements on the file source :) A link is all I can say.
With the Data APIs
There’s one and only one call to fetch the image. Just the link from the profile_image for a a given user_id.
Insert when you’ve got yourself a new pic and you Update when you’ve a stand-in ready. A Select to get your friends’ DP links and of course your DP as well.
Beneath the Cover: I’ve a Shared Preference in place to flag this step if at all the user sets a DP for the first time. Once the flag is true, thereon I update the set record.
Anything in the Mix?
To make the feature beckoning, I’ve an inter-app intent system set. You can capture photos from my app rightaway, without having to hand-operate the Camera app. Your pic gets saved instantly to Pictures Album, Gallery.
Beneath the Cover
I can start an activity instance of another app from my app and get the response with the content-uri in the onResult call. First I ask for user permissions with camera and file access. This is typical with android versions>5.0. Then, I capture something and create a file into which I trove in the pic. Finally, I put the snap into Gallery for an instant Click-Upload.
Note: I use a professional approach with fileproviders to get legitimate file paths.
What about ‘my’ DP?
If you set a DP, cool, you can’t inflate yours. Coz, you have it saved locally. I want people looking at others for a change :) Your DP is neatly crafted into a disk at top-right of the action bar.
But mind you, I’ve tried to snap this strife out of the way, but in vain
Menu bar reloads to prepare options as nav drawers open and close, so that I discard the irrelevant tools showing up. But, this took a toll on my DP, as it refreshes every time. It should be faster with cache :)
Beneath the Cover
- I’ve used a zoom in out animation for the display.
- I’ve got a Picasso loading the image into a bitmap from an url, for both the icon (which I achieved with a transform function for a croppped circle) & the enlarged views.
A few other technical points are discussed then and there.
Conclusion
I would commend the DP as a trendy way of finding people when it comes to Social Media. But, I’m happy for how I managed this feature into my own app, with my own data style.
As for when I load these pics, I should really say, I load the entire Home Page script in a shot when the app starts :) . After that, its all dynamic.
Please find my Postman collection here for more. Refer up to the story on Data API calls to know about Postman Collections.
Hope the update helped clearing buffers in the readers’ minds :) Stay amazed.