A few years ago, I made a post called “Replicating Facebook Profile UI in Xamarin Forms” which I loved to do đ and I was thinking that over time languages, Frameworks have new functionalities which are designed to make our Apps more effective, for this reason, it’s important to keep them updated. In the following paragraph I give you some important points to keep in mind:
đ Schedule the refactoring of your code:Â It’s great that you update your code, but keep in mind the unforeseen events that may occur when making these changes. By integrating / modifying / eliminating new functionalities you can face different unforeseen events triggered by some conditions that your App currently needs and that you did not contemplate at the time, for this reason, you must create a schedule to do it.
đ”ïžââïž Make a little analysis first: Part of the previous point of the planning, is based on an estimate of time, and that’s why I recommend you to make an information survey, to see the opportunities for improvements that your App needs (For example: Which Nuget Package you must update, which other you can remove updates in layouts (as with the Grid đ€)).
Last but not least important, we will be breaking down the code step by step. At the time of the previous publication, we focused on the definition of general points and uploading the repository, Â without covering the step-by-step. That’s why we will be covering it in this post!
Before starting, to get the best out of the post, Iâll leave you some instructional notes so that you have a better experience reproducing the UI:
Letâs start!
Letâs divide the original design into blocks
To better understand, I have divided the original design into blocks, which are listed in the order in which we will be reproducing each one, these are:
Let’s start with the Header block, we are going to divide this block into different sub-blocks, which will be the following:
- Main layout: As the main layout we will use the Grid. One of the most important changes that we will make in the code in general, is to replace the Grids with “Long structure” with the simple structure, making our code cleaner and reduced, without affecting the final result.
- Timeline: To add the TimeLine, I used the PancakeView which helps me round the corners! đ
- Profile picture, name and description: To make the image rounded I used a small Tip using a Frame to achieve the circular shape!
đ„Â I previously used the FFImageLoading, you can continue using this Nuget without problems! I only give you an additional option to do it! đ
- Styles by platform: As you have noticed, some buttons like “Add history” have different styles for both Android and iOS, let’s see how to do it in a simple way!
As this is a set of user information that depends on the amount of registration, it means that you can also reduce or increase the position of the layout, which is why I chose to work with BindableLayout! It’s super cute, if you want to know more information, check it out here!
And now, let’s create the photo album, to do it, we are going to use a CollectionView. (If you want to know more information about it, you can enter here.)
Letâs continue with the Friends block, and also using the CollectionView! đ€
Finally, let’s add the comments, here we will also use a BindableLayout to achieve it!